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 |
---|---|---|---|---|---|---|
Allow preinsert logic to be applied to row | public function _insert()
{
$this->notifyObservers(__FUNCTION__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function beforeInserting()\n {\n }",
"public function insertRow($row);",
"protected function beforeInsert()\n {\n }",
"protected function afterInsertAccepting()\n {\n }",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"protected function afterInserting()\n {\n }",
"protected function _insert()\n\t{\n\t}",
"protected function _prepareRowsAction() {\n \n }",
"protected function _postInsert()\n\t{\n\t}",
"public function insertRowPrepare(RowInterface $row) : InsertInterface\n {\n $this->events->beforeInsert($this, $row);\n\n $insert = $this->insert();\n $cols = $row->getArrayCopy();\n $autoinc = $this->getAutoinc();\n if ($autoinc) {\n unset($cols[$autoinc]);\n }\n $insert->cols($cols);\n\n $this->events->modifyInsert($this, $row, $insert);\n return $insert;\n }",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"protected function preInsert( ModelInterface &$model ) {\n }",
"function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}",
"public function after_insert() {}",
"protected function afterInsert()\n {\n }",
"function processBeforeInsert($record, $pObj) {\n\t\t\t// Perform operation only for the fe_users table and for external index 0\n\t\tif ($pObj->getTableName() == 'fe_users' && $pObj->getIndex() == 0) {\n\t\t\t\t// Simply reverse the username to create the password\n\t\t\t$record['password'] = strrev($record['username']);\n\t\t}\n\t\treturn $record;\n\t}",
"function insert()\n\t{\n\t\t$this->edit(true);\n\t}",
"protected function loadRow() {}",
"public function addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\n }",
"public function prepopulateRowWhenEmpty()\n {\n return $this->withMeta(['prepopulateRowWhenEmpty' => true]);\n }",
"protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }",
"public function prepareSave($row, $postData)\n { if ($this->getSave() === false || $this->getInternalSave() === false) return;\n\n $new = $this->_getIdsFromPostData($postData);\n\n// $avaliableKeys = array(6,20,17);\n //foreach ($this->_getFields() as $field) {\n// $avaliableKeys[] = $field->getKey();\n// }\n\n $relModel = $row->getModel()->getDependentModel($this->getRelModel());\n $ref = $relModel->getReference($this->getRelationToValuesRule());\n $valueKey = $ref['column'];\n\n $s = $this->getChildRowsSelect();\n if (!$s) $s = array();\n foreach ($row->getChildRows($this->getRelModel(), $s) as $savedRow) {\n $id = $savedRow->$valueKey;\n if (true || in_array($id, $avaliableKeys)) {\n if (!in_array($id, $new)) {\n $savedRow->delete();\n } else {\n unset($new[array_search($id, $new)]);\n }\n }\n }\n\n foreach ($new as $id) {\n if (true || in_array($id, $avaliableKeys)) {\n $i = $row->createChildRow($this->getRelModel());\n $i->$valueKey = $id;\n }\n }\n\n }",
"protected function saveInsert()\n {\n }",
"public function insert(phpDataMapper_Model_Row $row)\n\t{\n\t\t$rowData = $row->getData();\n\t\t\n\t\t// Fields that exist in the table\n\t\t$tableFields = array_keys($this->fields);\n\t\t\n\t\t// Fields that have been set/updated on the row that also exist in the table\n\t\t$rowFields = array_intersect($tableFields, array_keys($rowData));\n\t\t\n\t\t// Get \"col = :col\" pairs for the update query\n\t\t$insertFields = array();\n\t\t$binds = array();\n\t\tforeach($rowData as $field => $value) {\n\t\t\tif($this->fieldExists($field)) {\n\t\t\t\t$insertFields[] = $field;\n\t\t\t\t// Empty values will be NULL (easier to be handled by databases)\n\t\t\t\t$binds[$field] = $this->isEmpty($value) ? null : $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ensure there are actually values for fields on THIS table\n\t\tif(count($insertFields) > 0) {\n\t\t\t// build the statement\n\t\t\t$sql = \"INSERT INTO \" . $this->getTable() .\n\t\t\t\t\" (\" . implode(', ', $rowFields) . \")\" .\n\t\t\t\t\" VALUES(:\" . implode(', :', $rowFields) . \")\";\n\t\t\t\n\t\t\t// Add query to log\n\t\t\t$this->logQuery($sql, $binds);\n\t\t\t\n\t\t\t// Prepare update query\n\t\t\t$stmt = $this->adapter->prepare($sql);\n\t\t\t\n\t\t\tif($stmt) {\n\t\t\t\t// Bind values to columns\n\t\t\t\t$this->bindValues($stmt, $binds);\n\t\t\t\t\n\t\t\t\t// Execute\n\t\t\t\tif($stmt->execute()) {\n\t\t\t\t\t$rowPk = $this->adapter->lastInsertId();\n\t\t\t\t\t$pkField = $this->getPrimaryKeyField();\n\t\t\t\t\t$row->$pkField = $rowPk;\n\t\t\t\t\t$result = $rowPk;\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t\t\n\t\t// Save related rows\n\t\tif($result) {\n\t\t\t$this->saveRelatedRowsFor($row);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"abstract public function insert(string $table, array $row, array $options = []);",
"public function insert(Table $table, $row);",
"public function insert() {\n \n }",
"abstract public function insert();",
"public function insertRow(TableRow $row, $position = null);",
"protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }",
"public abstract function insert();",
"protected function beforeInsert() {\n\t\t$lookup = new LookupImageCodeDao();\n\t\t$lookup->setCode($this->getCode());\n\t\t$lookup->setImageId($this->getId());\n\t\t$lookup->setProjectId($this->getProjectId());\n\t\t$lookup->save();\n\t}",
"protected function replacePluginForRows()\n {\n $this->newRow(new Row); // NOVA LINHA\n $col = new Col($this->currentRow); // CRIANDO COLUNA\n $this->currentRow->newCol($col); // ADICIONANDO COLUNA NA LINHA ATUAL\n $col->newPlugin($this->plugins[0]); // ADICIONANDO PLUGIN ATUAL NA COLUNA\n $this->plugins = null; // EXCLUINDO PLUGIN ANTIGO DA COLUNA\n }",
"public function beforeSave($args)\n {\n if ($args['insert']) {\n $column = $this->_addedColumn;\n if (!$column) {\n return;\n }\n $this->_setTimestamp($column);\n }\n\n $column = $this->_modifiedColumn;\n if (!$column) {\n return;\n }\n $this->_setTimestamp($column);\n }",
"public function changeRowData(&$row){}",
"public function add_or_ignore()\n {\n $this->insert_ignore('table', array('foo' => 'bar'));\n\n // you can also do\n $this->ignore();\n $this->insert('table', array('foo' => 'bar'));\n }",
"function prepare_update($rowindex) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->on_edit_callback != '') {\r\n $this->ds->{$colvar}[$rowindex] = eval($col->on_edit_callback);\r\n }\r\n }\r\n return True;\r\n }",
"public function prepareSave($row, $postData)\n {\n }",
"public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"protected function _prepareRowForDb(array $rowData)\n {\n $rowData = $this->_customFieldsMapping($rowData);\n\n $rowData = parent::_prepareRowForDb($rowData);\n\n static $lastSku = null;\n\n if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {\n return $rowData;\n }\n\n $lastSku = $rowData[self::COL_SKU];\n\n if ($this->isSkuExist($lastSku)) {\n $newSku = $this->skuProcessor->getNewSku($lastSku);\n $rowData[self::COL_ATTR_SET] = $newSku['attr_set_code'];\n $rowData[self::COL_TYPE] = $newSku['type_id'];\n }\n\n return $rowData;\n }",
"public function Do_insert_Example1(){\n\n\t}",
"protected function _beforeSave()\n {\n $this->_prepareData();\n return parent::_beforeSave();\n }",
"function setRowDatas(&$row) {\r\n\t\t/* for optimization reason, do not save row. save just needed parameters */\r\n\t}",
"public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }",
"protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }",
"protected static function afterGetFromDB(&$row){}",
"function InlineInsert() {\n\t\tglobal $Language, $objForm, $gsFormError;\n\t\t$this->LoadOldRecord(); // Load old recordset\n\t\t$objForm->Index = 0;\n\t\t$this->LoadFormValues(); // Get form values\n\n\t\t// Validate form\n\t\tif (!$this->ValidateForm()) {\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t\treturn;\n\t\t}\n\t\t$this->SendEmail = TRUE; // Send email on add success\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\n\t\t\tif ($this->getSuccessMessage() == \"\")\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\n\t\t} else { // Add failed\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t}\n\t}",
"public function prepareRow($row) {\n\t\n if ($row->DateQuit) {\n\t\t$row->DateQuit = $this->formatdate($row->DateQuit);\t\t\n }\n if ($row->Postcode) {\n\t\t$Postcode = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $row->Postcode);\n\t\tif (ctype_digit($Postcode) && strlen($Postcode) == \"4\") {\n\t\t\t$row->Postcode = $Postcode;\t\t\t\n\t\t} else {\n\t\t\t$row->Postcode = \"\";\n\t\t}\n } \n if ($row->State) {\n\t\t$states = array( 'ACT','NSW','NT','QLD','SA','TAS','VIC','WA');\n\t\t$str = strtoupper($row->State);\n\t\tif (in_array($str, $states)) {\n\t\t\t$row->State = $str;\n\t\t} else {\n\t\t\t$row->State = \"\";\n\t\t}\n } \n if ($row->Gender) {\n\t\t$gender_options = array('male', 'female');\n\t\tif (in_array(strtolower($row->Gender), $gender_options)) {\n\t\t\t$gender = strtolower($row->Gender);\n\t\t\t$row->Gender = $gender;\n\t\t} else {\n\t\t\t$row->Gender = \"\";\n\t\t}\n }\n if ($row->DateOfBirth) {\t\n\t\t$row->DateOfBirth = $this->formatdate($row->DateOfBirth);\n }\n if ($row->DateTreatmentStart) {\t\n\t\t$row->DateTreatmentStart = $this->formatdate($row->DateTreatmentStart);\n }\n if ($row->PhoneMobile) {\n\t\t$PhoneMobile = preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $row->PhoneMobile);\n\t\tif (ctype_digit($PhoneMobile)) {\n\t\t\tif (substr( trim($PhoneMobile ), 0, 2 ) == \"61\" && strlen( trim($PhoneMobile) ) >= \"11\") {\n\t\t\t\t$newphone = substr(trim($PhoneMobile), 2);\n\t\t\t\t$row->PhoneMobile = $newphone;\n\t\t\t}\n\t\t\telse if (substr( trim($PhoneMobile ), 0, 1 ) == \"0\" && strlen( trim($PhoneMobile) ) >= \"10\") {\n\t\t\t\t$newphone = substr(trim($PhoneMobile), 1);\n\t\t\t\t$row->PhoneMobile = $newphone;\t\t\t\t\n\t\t\t}\n\t\t\tif (!(strlen($row->PhoneMobile) >= \"9\" && strlen($row->PhoneMobile) <= \"11\")) {\n\t\t\t\t$row->PhoneMobile = \"\";\n\t\t\t}\n\t\t\t//$row->PhoneMobile = '91'.$PhoneMobile;\n\t\t} else {\n\t\t\t$row->PhoneMobile = \"\";\n\t\t}\n } \n return TRUE;\n }",
"function setRowDatas(&$row) {\r\n\t\t/* for optimization reason, do not save row. save just needed parameters */\r\n\r\n\t\t//$this->_specific_data\t= isset($row->specific) ? $row->specific : '';\r\n\t}",
"public function insert()\n {\n \n }",
"public function setKeysFromInserted()\n\t{\n\t\t$keys = $this->database->getNewKeys();\n\n\t\t$this->data = Arr::mergeDeep($this->data, $keys);\n\n\t\t$this->key = $keys[$this->primaryKey] ?? null;\n\t}",
"function InlineInsert() {\r\n\t\tglobal $Language, $objForm, $gsFormError;\r\n\t\t$this->LoadOldRecord(); // Load old recordset\r\n\t\t$objForm->Index = 0;\r\n\t\t$this->LoadFormValues(); // Get form values\r\n\r\n\t\t// Validate form\r\n\t\tif (!$this->ValidateForm()) {\r\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\r\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\r\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->SendEmail = TRUE; // Send email on add success\r\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\r\n\t\t\tif ($this->getSuccessMessage() == \"\")\r\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\r\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\r\n\t\t} else { // Add failed\r\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\r\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\r\n\t\t}\r\n\t}",
"public function insertRow($row_start, $row_end) {\n\t}",
"protected abstract function insertRow($tableName, $data);",
"Static function MapToRowInsert($item){\n $retval['id_entreprise']=$item->id_entreprise;\n $retval['id_collaborateur']=$item->id_collaborateur;\n return $retval;\n }",
"public static function insert()\n {\n }",
"function add_row()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->rows[] = $this->_prep_args($args);\n\t}",
"protected function beforeInsert() {\n\t\t$date = gmdate('Y-m-d H:i:s');\n\t\t$this->setCreateTime($date);\n\t\t$this->setModifiedTime($date);\n\t\t$this->setActive('Y');\n\n\t\t$sequence = $this->getAppId();\n\t\t$this->setShardId($sequence);\n\n\t\t$builder = new QueryBuilder($this);\n\t\t$res = $builder->select('COUNT(*) as count')\n\t\t\t\t\t ->where('app_id', $this->getAppId())\n\t\t\t\t\t ->where('group_id', $this->getGroupId())\n\t\t\t\t\t ->order('rule_order')\n\t\t\t\t\t ->find();\n\n\t\t$order = $res['count']+1;\n\t\t$this->setRuleOrder($order);\n\t}",
"public function beforeInsert()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n // parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n // parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n // parent::preInsert($con);\n }\n return true;\n }",
"public function doInsert( $data ) {\t\t\r\n\r\n\t\t\r\n\t\t\t\t$newRow = $this->createRow();\r\n\t\t\t\r\n\t\t\t\tforeach ( $newRow->toArray() as $key => $v ) {\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t$newRow[ $key ] = Class_array::getValue( $data, $key );\r\n\t\t\t\t\r\n }\r\n\t\t\t\t$newRow->save();\t\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\treturn $newRow;\r\n\t\t\t\r\n\t\t//}\r\n\t}",
"function formatRow(){\n $this->hook('formatRow');\n }",
"protected function _insertNewPre()\n\t{\n\t\tif (empty($this->_curPre['title'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t$query = 'INSERT INTO predb (';\n\n\t\t$query .= (!empty($this->_curPre['size']) ? 'size, ' : '');\n\t\t$query .= (!empty($this->_curPre['category']) ? 'category, ' : '');\n\t\t$query .= (!empty($this->_curPre['source']) ? 'source, ' : '');\n\t\t$query .= (!empty($this->_curPre['reason']) ? 'nukereason, ' : '');\n\t\t$query .= (!empty($this->_curPre['files']) ? 'files, ' : '');\n\t\t$query .= (!empty($this->_curPre['reqid']) ? 'requestid, ' : '');\n\t\t$query .= (!empty($this->_curPre['group_id']) ? 'group_id, ' : '');\n\t\t$query .= (!empty($this->_curPre['nuked']) ? 'nuked, ' : '');\n\t\t$query .= (!empty($this->_curPre['filename']) ? 'filename, ' : '');\n\n\t\t$query .= 'predate, title) VALUES (';\n\n\t\t$query .= (!empty($this->_curPre['size']) ? $this->_pdo->escapeString($this->_curPre['size']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['category']) ? $this->_pdo->escapeString($this->_curPre['category']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['source']) ? $this->_pdo->escapeString($this->_curPre['source']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['reason']) ? $this->_pdo->escapeString($this->_curPre['reason']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['files']) ? $this->_pdo->escapeString($this->_curPre['files']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['reqid']) ? $this->_curPre['reqid'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['group_id']) ? $this->_curPre['group_id'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['nuked']) ? $this->_curPre['nuked'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['filename']) ? $this->_pdo->escapeString($this->_curPre['filename']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['predate']) ? $this->_curPre['predate'] . ', ' : 'NOW(), ');\n\n\t\t$query .= '%s)';\n\n\t\t$this->_pdo->ping(true);\n\n\t\t$this->_pdo->queryExec(\n\t\t\tsprintf(\n\t\t\t\t$query,\n\t\t\t\t$this->_pdo->escapeString($this->_curPre['title'])\n\t\t\t)\n\t\t);\n\n\t\t$this->_doEcho(true);\n\t}",
"function insert_row($tb=null){\nglobal $indb;\nif(@table_exists($tb)===false) {trigger_error(\"Table dose not exist\",E_USER_WARNING); return false;}\n\t//\n\tif ( $indb && connected($indb[\"db\"]) && $tb!==null) {\n\t// define new raw from input according to src\n\t$strata = parse_src($tb);\n\t$strakey = array_flip($strata);\n\t$argus = func_get_args();\n\tarray_shift($argus);\n\tif(count($argus)>0 && @current($argus[0])) {\n\t\t$wagner = array_intersect_key($argus[0],$strakey);\n\t\tif(count($wagner)===0) $wagner = array_slice($argus[0],0,count($strakey),true);\n\t\telseif(count($wagner)!==0 && count($wagner)<count($strata)) {\n\t\t\t$nululu = array_fill(0,count($strakey),\"null\");\n\t\t\t$emerson = array_combine($strata,$nululu);\n\t\t\treset($wagner);\n\t\t\tfor($iv=0;$iv<count($wagner);$iv++){\n\t\t\t\tif( array_key_exists(key($wagner),$emerson) ) $emerson[key($wagner)] = current($wagner);\n\t\t\tnext($wagner);\n\t\t\t}\n\t\t\t$wagner = $emerson;\n\t\t}\n\t\telse $wagner = array_slice($wagner,0,count($strakey),true);\n\t\t$angery = array_pad($wagner,count($strata),\"null\");;\n\t}\n\telseif(count($argus)>0 && !@current($argus[0])) {\n\t\t$wagner = array_slice($argus,0,count($strakey),false);\n\t\tif(count($wagner)< count($strata)) $wagner = array_pad($wagner,count($strata),\"null\");\n\t\t$angery = array_combine($strata,$wagner);\n\t}\n\telse return false;\n\t// insert in database\n\t$angery = array_pad($angery,count($strata),\"null\");// last calibration\n\t$gorila = array_map(\"FFDB\\pure_encode\",$angery);\n\t$tondar = implode(\"[|]\",$gorila);\n\t$tablert = _FFDBDIR_.$indb[\"db\"].\"/\".table_exists($tb).\".tbl\";\n\t$foterm = fopen($tablert,\"a+\");\n\tset_file_buffer($foterm,0);\n\t$counta = get_row_count($tb);\n\t$counti = ($counta===null?0:$counta+1);\n\t$thisrow = \"\\nrow_\".$counti.\"[=]\".$tondar.\"[+]\";\n\tif($foterm){ fwrite($foterm,$thisrow);\n\tfclose($foterm);\n\treturn $counti;\n\t} else return false;\n\t}\n\telseif($tb===null){\n\t\ttrigger_error(\"bad function invoking: input is null\",E_USER_WARNING);\n\t\treturn false;\n\t\t}\n\telse{\n\t\ttrigger_error(\"first connect to database\",E_USER_WARNING);\n\t\treturn false;\n\t\t}\n}",
"public function insertPreProcess($data = null)\n {\n EventUtil::notify(new Zikula_Event('dbobjectarray.insertpreprocess', $this));\n return $this->_objData;\n }",
"public function test_insert_row_before(){\n\t\t$listotron = new Listotron();\n\n\t\t$user1 = md5(rand() . md5(rand()));\n\t\t$now = $listotron->getNOW();\n\n\t\t// modify the middle of List\n\t\t$rows = $listotron->insertRowBefore(4, $user1);\n\n\t\t// now get the rows changed by not me\n\t\t// since before NOW()\n\t\t$this->assertEqual(count($rows), 2);\n\t\t\n\t\t$this->assertEqual($rows[0][\"row_id\"], 7);\n\t\t$this->assertEqual($rows[0][\"par\"], 1);\n\t\t$this->assertEqual($rows[0][\"prev\"], 3);\n\t\t$this->assertEqual($rows[0][\"lm\"], $now);\n\t\t$this->assertEqual($rows[0][\"lmb\"], $user1);\n\t\t\n\t\t$this->assertEqual($rows[1][\"row_id\"], 4);\n\t\t$this->assertEqual($rows[1][\"par\"], 1);\n\t\t$this->assertEqual($rows[1][\"prev\"], 7);\n\t\t$this->assertEqual($rows[1][\"lm\"], $now);\n\t\t$this->assertEqual($rows[1][\"lmb\"], $user1);\n\n\t\t// modify the beginning of List\n\t\t$rows = $listotron->insertRowBefore(1, $user1);\n\n\t\t// now get the rows changed by not me\n\t\t// since before NOW()\n\t\t$this->assertEqual(count($rows), 2);\n\t\t\n\t\t$this->assertEqual($rows[0][\"row_id\"], 8);\n\t\t$this->assertEqual($rows[0][\"par\"], null);\n\t\t$this->assertEqual($rows[0][\"prev\"], null);\n\t\t$this->assertEqual($rows[0][\"lm\"], $now);\n\t\t$this->assertEqual($rows[0][\"lmb\"], $user1);\n\t\t\n\t\t$this->assertEqual($rows[1][\"row_id\"], 1);\n\t\t$this->assertEqual($rows[1][\"par\"], null);\n\t\t$this->assertEqual($rows[1][\"prev\"], 8);\n\t\t$this->assertEqual($rows[1][\"lm\"], $now);\n\t\t$this->assertEqual($rows[1][\"lmb\"], $user1);\n\n\n\t\t// modify the end of List\n\t\t$rows = $listotron->insertRowBefore(6, $user1);\n\n\t\t// now get the rows changed by not me\n\t\t// since before NOW()\n\t\t$this->assertEqual(count($rows), 2);\n\t\t\n\t\t$this->assertEqual($rows[0][\"row_id\"], 9);\n\t\t$this->assertEqual($rows[0][\"par\"], 1);\n\t\t$this->assertEqual($rows[0][\"prev\"], 5);\n\t\t$this->assertEqual($rows[0][\"lm\"], $now);\n\t\t$this->assertEqual($rows[0][\"lmb\"], $user1);\n\t\t\n\t\t$this->assertEqual($rows[1][\"row_id\"], 6);\n\t\t$this->assertEqual($rows[1][\"par\"], 1);\n\t\t$this->assertEqual($rows[1][\"prev\"], 9);\n\t\t$this->assertEqual($rows[1][\"lm\"], $now);\n\t\t$this->assertEqual($rows[1][\"lmb\"], $user1);\n\t}",
"public function prepareRow($row) {\n if ($row->parent_id == 0) {\n $row->parent_id = NULL;\n }\n }",
"private function before_custom_save()\n\t\t{\n\t\t\t$fields = self::$db->table_info($this->table_name);\n\t\t\tforeach($fields AS $field)\n\t\t\t{\n\t\t\t\tif(!strlen($this->$field['name'])) {\n\t\t\t\t\t$this->$field['name'] = 'NULL';\n\t\t\t\t}\n\t\t\t\tif(method_exists($this, 'preSave_'.$field['name'])) {\n\t\t\t\t\t$this->{'preSave_'.$field['name']}($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function loadRow($rowData)\n\t{\n\t\t\n }",
"protected function preInsert(&$entity) {\n $this->validateEntity($entity);\n\n $this->startTransaction();\n if (isset($entity['parent_id']) && !empty($entity['parent_id'])) {\n $lastCommentForEntityAndParent = $this->getLastCommentForEntity($entity);\n if (!empty($lastCommentForEntityAndParent)) {\n $entity['level'] = $lastCommentForEntityAndParent['level'];\n $lastChild = $this->getLastChild($lastCommentForEntityAndParent);\n $entity['sortorder'] = $lastChild['sortorder'];\n } else {\n $parent = $this->getOneWhere(array('id' => $entity['parent_id']), 'id, sortorder, parent_id, level');\n $entity['level'] = $parent['level'] + 1;\n $entity['sortorder'] = $parent['sortorder'];\n }\n $this->incrementSortorderForEntity($entity);\n } else {\n $maxSortOrder = $this->getMaxSortorderForEntity($entity);\n $entity['level'] = 0;\n $entity['sortorder'] = $maxSortOrder + 1;\n }\n\n $this->commitTransaction();\n }",
"public abstract function Insert();",
"function postCreateTable(){\n\t}",
"public function preInsert(Doctrine_Event $event)\n {\n if ( ! $this->_options['created']['disabled']) {\n $createdName = $event->getInvoker()->getTable()->getFieldName($this->_options['created']['name']);\n $modified = $event->getInvoker()->getModified();\n if ( ! isset($modified[$createdName])) {\n $event->getInvoker()->$createdName = $this->getUserId();\n }\n }\n\n if ( ! $this->_options['updated']['disabled'] && $this->_options['updated']['onInsert']) {\n $updatedName = $event->getInvoker()->getTable()->getFieldName($this->_options['updated']['name']);\n $modified = $event->getInvoker()->getModified();\n if ( ! isset($modified[$updatedName])) {\n $event->getInvoker()->$updatedName = $this->getUserId();\n }\n }\n }",
"function before_insert()\r\n\t{\r\n\t\t$this->reviewed_at = date(SQL_DATETIME_FORMAT);\r\n\t}",
"function insert_stmt(){\n\t\tglobal $in;\n\t\tif ($this->attributes['BYTB']!='' )$this->fields_value_bytb($this->attributes['BYTB']);\n\t\t\n\t\t\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\t\t\t\t\n\t\t\t\t$this->field_stmt[$i]=\"{$key}\";\n\t\t\t\t$this->value_stmt[$i]=\"{$in[$key]}\";\n\t\t\t\t\n\t\t\t\tif($in[$key]==1){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t#GC 20/04/2015 gestione popolamento decode\n\t\t\t\t\tif (isset($this->attributes['DECODE'][$key])) $this->value_stmt[$i]=\"{$this->attributes['DECODE'][$key]}\";\n\t\t\t\t\telse $this->value_stmt[$i]=$val;\n\t\t\t\t}\n\t\t\t\t#GC 20/04/2015 gestione sbiancamento decode\n\t\t\t\tif($in[$key]==0){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t$this->value_stmt[$i]=\"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n return parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n return parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n return parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n return parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n return parent::preInsert($con);\n }\n return true;\n }",
"public function preInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::preInsert')) {\n return parent::preInsert($con);\n }\n return true;\n }",
"public function insertIgnore($data)\n {\n if (isset($this->columns[\"created\"])) {\n $data[\"created\"] = date(\"Y-m-d H:i:s\");\n }\n return $this->schema->insert($this->name, $data, true);\n }",
"private function processGrammarPreposition($row) {\r\n \r\n $timer = Debug::GetTimer(); \r\n \r\n $row['event']['preposition'] = Grammar::getPrepositionTo($row);\r\n $row['event']['preposition'] = Grammar::getPrepositionFrom($row);\r\n $row['event']['preposition'] = Grammar::getPrepositionOf($row);\r\n $row['event']['preposition'] = Grammar::getPrepositionIn($row);\r\n \r\n Debug::LogEvent(__METHOD__, $timer);\r\n \r\n return $row;\r\n \r\n }",
"public function beforeSave($insert) {\n $data = json_decode($this->json_schema);\n $this->json_schema = json_encode($data, JSON_PRETTY_PRINT);\n return parent::beforeSave($insert);\n }",
"public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }",
"public function preSave() {}",
"protected function doInsert() {\n return '';\n }",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }",
"function testInsertPreKey()\n\t{\n\t\t$this->initScript('line-item-init.sql');\n\n\t\t$item = new LineItem();\n\n\t\t$item->setId(10);\n\t\t$item->setCode(\"blah\");\n\t\t$item->setOrder(new Order());\n\t\t$item->getOrder()->setId(9);\n\t\t$item->setPrice(44.00);\n\t\t$item->setQuantity(1);\n\n\t\t$key = $this->sqlmap->Insert(\"InsertLineItemPreKey\", $item);\n\n\t\t$this->assertIdentical(99, $key);\n\t\t$this->assertIdentical(99, $item->getId());\n\n\t\t$param[\"Order_ID\"] = 9;\n\t\t$param[\"LineItem_ID\"] = 99;\n\n\t\t$testItem = $this->sqlmap->QueryForObject(\"GetSpecificLineItem\", $param);\n\n\t\t$this->assertNotNull($testItem);\n\t\t$this->assertIdentical(99, $testItem->getId());\n\n\t\t$this->initScript('line-item-init.sql');\n\t}",
"public function PushRow() {\n $this->PushOutput($this->currow);\n// if (is_callable(array($this,$this->curtpl)))\n call_user_func(array($this,$this->curtpl), $this);\n }",
"public function insert()\n {\n }",
"public function insert()\n {\n }",
"function initRow( $row ) {\r\n\t\t$this->oid = $row['id'];\n\t\t$this->uid = $row['uid'];\n\t\t$this->name = $row['name'];\n\t\t$this->description = $row['description'];\n\t\t\r\n\t}",
"function PreprocessSql($sql);",
"public function setLastRowInsert($row){\r\n $this->lastRowInsert = $row;\r\n }",
"public abstract function getInsert(Table $table, $item = array());",
"public function beforeSave() {\n $beforeSave = parent::beforeSave();\n \n // Get all translated data as arrays\n $translations = $this->getTranslatedFields();\n\t\t\n\t\t$resId = $this->getProperty('id');\n\t\t\n foreach($translations as $lang => $fields){ \n \tif(\t$row = $this->modx->getObject('Translation',array(\n\t\t\t\t'articleID' => $resId,\n\t\t\t\t'language' => $lang\n\t\t\t))){\n\t\t\t\t$row->set('pagetitle',$fields['pagetitle']);\n\t\t\t\t$row->set('longtitle',$fields['longtitle']);\n\t\t\t\t$row->set('menutitle',$fields['menutitle']);\n\t\t\t\t$row->set('introtext',$fields['introtext']);\n\t\t\t\t$row->set('description',$fields['description']);\n\t\t\t\t$row->set('content',$fields['content']);\n\t\t \t$row->save();\n \t};\n };\n \n return $beforeSave;\n }"
] | [
"0.7007145",
"0.6657182",
"0.6554749",
"0.6538644",
"0.64149684",
"0.64149684",
"0.63400006",
"0.63211316",
"0.63029146",
"0.6198176",
"0.6192815",
"0.61885804",
"0.61443335",
"0.6142744",
"0.60965663",
"0.60347295",
"0.5967215",
"0.59478086",
"0.5947458",
"0.59267515",
"0.5872636",
"0.5850338",
"0.584761",
"0.57926244",
"0.5791356",
"0.57851714",
"0.5775352",
"0.5771475",
"0.5743502",
"0.5732838",
"0.5721927",
"0.5717459",
"0.5712682",
"0.5711085",
"0.5684038",
"0.5676856",
"0.56713665",
"0.5656744",
"0.56463224",
"0.564053",
"0.5634116",
"0.5629181",
"0.5624832",
"0.56224334",
"0.5617096",
"0.56020266",
"0.55981016",
"0.55929977",
"0.5574036",
"0.5572553",
"0.5565737",
"0.5553685",
"0.5552716",
"0.55511606",
"0.5550587",
"0.55483997",
"0.5541432",
"0.5513214",
"0.5508708",
"0.55050397",
"0.550483",
"0.55041414",
"0.55041414",
"0.55041414",
"0.55011034",
"0.5494324",
"0.54926336",
"0.54925054",
"0.5492248",
"0.54852057",
"0.5471869",
"0.5471266",
"0.5449458",
"0.5445479",
"0.5426311",
"0.542261",
"0.5414069",
"0.5411482",
"0.5407831",
"0.5400238",
"0.5400238",
"0.5400238",
"0.5400238",
"0.5400238",
"0.5400238",
"0.53957325",
"0.53956383",
"0.5395384",
"0.53885776",
"0.5378412",
"0.5376088",
"0.53734535",
"0.53696716",
"0.5367902",
"0.5367778",
"0.5367778",
"0.5366819",
"0.53662723",
"0.5365885",
"0.5357526",
"0.5348866"
] | 0.0 | -1 |
Allows postinsert logic to be applied to row. | public function _postInsert()
{
$this->notifyObservers(__FUNCTION__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _postInsert()\n\t{\n\t}",
"protected function afterInserting()\n {\n }",
"protected function afterInsert()\n {\n }",
"protected function afterInsertAccepting()\n {\n }",
"public function after_insert() {}",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n {\n \n }",
"protected function _insert()\n\t{\n\t}",
"public function afterInsert() {\n\t\t\tparent::afterInsert();\n\t\t\t//$this->pos = 1;\n\t\t\t$this->updatePos(1);\n\t\t}",
"public function insertRow($row);",
"protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}",
"protected function saveInsert()\n {\n }",
"protected function beforeInserting()\n {\n }",
"public function prepareSave($row, $postData)\n { if ($this->getSave() === false || $this->getInternalSave() === false) return;\n\n $new = $this->_getIdsFromPostData($postData);\n\n// $avaliableKeys = array(6,20,17);\n //foreach ($this->_getFields() as $field) {\n// $avaliableKeys[] = $field->getKey();\n// }\n\n $relModel = $row->getModel()->getDependentModel($this->getRelModel());\n $ref = $relModel->getReference($this->getRelationToValuesRule());\n $valueKey = $ref['column'];\n\n $s = $this->getChildRowsSelect();\n if (!$s) $s = array();\n foreach ($row->getChildRows($this->getRelModel(), $s) as $savedRow) {\n $id = $savedRow->$valueKey;\n if (true || in_array($id, $avaliableKeys)) {\n if (!in_array($id, $new)) {\n $savedRow->delete();\n } else {\n unset($new[array_search($id, $new)]);\n }\n }\n }\n\n foreach ($new as $id) {\n if (true || in_array($id, $avaliableKeys)) {\n $i = $row->createChildRow($this->getRelModel());\n $i->$valueKey = $id;\n }\n }\n\n }",
"public function prepareSave($row, $postData)\n {\n }",
"function wp_after_insert_post($post, $update, $post_before)\n {\n }",
"protected function performPostPersistCallback()\n {\n // echo 'inserted a record ...';\n return true;\n }",
"protected static function afterGetFromDB(&$row){}",
"public function setLastRowInsert($row){\r\n $this->lastRowInsert = $row;\r\n }",
"function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}",
"protected function _postInsert()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.insert',$this->id);\n\t\t//end events\n\n $demo_user_id = \\Base\\Config::get('demo_user_id');\n if($demo_user_id && 1 == $this->id && array_key_exists('password', $this->_modifiedFields)) {\n $old_file = \\Core\\Log::getFilename();\n \\Core\\Log::setFilename('password_admin.log');\n \\Core\\Log::log(var_export([\n 'GET' => $_GET,\n 'POST' => $_POST,\n 'SERVER' => $_SERVER\n ], true));\n \\Core\\Log::setFilename($old_file);\n }\n\t}",
"public function post()\n {\n if ($this->request->is('post')) {\n\n $this->Row->create();\n $this->request->data['Row']['feed_id'] = (int)$this->request->data['Row']['feed_id'];\n\n $this->Row->save(\n array(\n 'Row' => $this->request->data['Row']\n )\n );\n\n $this->log(\n 'created row by datatables, ' . '(' . __CLASS__ . ':' . __FUNCTION__ . '=' . $this->Row->id . ')',\n LOG_DEBUG\n );\n\n }\n die($this->Row->id); //datatables wants this\n }",
"function insert()\n\t{\n\t\t$this->edit(true);\n\t}",
"protected function beforeInsert()\n {\n }",
"public function insert() {\n \n }",
"public function AfterInsertRecord()\n\t{\n\t\t$sql = 'INSERT INTO '.TABLE_BANNERS_DESCRIPTION.'(id, banner_id, language_id, image_text) VALUES ';\n\t\t$count = 0;\n\t\tforeach($this->arrTranslations as $key => $val){\n\t\t\tif($count > 0) $sql .= ',';\n\t\t\t$sql .= '(NULL, '.(int)$this->lastInsertId.', \\''.encode_text($key).'\\', \\''.encode_text(prepare_input($val['image_text'])).'\\')';\n\t\t\t$count++;\n\t\t}\n\t\tif(database_void_query($sql)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }",
"protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }",
"public function saveRow( $row );",
"function postCreateTable(){\n\t}",
"protected function _postSave()\r\n\t{\r\n\t}",
"public function insert(Table $table, $row);",
"public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}",
"public function save(){\n\t\t$res = true;\n\t\t$changedData = $this->changedData();\n\t\tif(count($changedData)){\n\t\t\tif(!empty($this->orig)){\n\t\t\t\t$res = (dbHelper::updateQry($this->tableName,$changedData,array($this->primaryKey=>$this->data[$this->primaryKey]))?true:false);\n\t\t\t\t$this->orig = $this->data;\n\t\t\t} else {\n\t\t\t\t//if this row has been deleted but someone else saves data to it this will automatically restore the row from $data\n\t\t\t\t$res = (dbHelper::insertQry($this->tableName,$this->data)?true:false);\n\t\t\t\t$this->data[$this->primaryKey] = db::insertID();\n\t\t\t\tdbData::addRow($this->tableName,$this->primaryKey,$this->data);\n\t\t\t\t$this->orig =& dbData::rowRefrence($this->tableName,$this->primaryKey,$this->data[$this->primaryKey]);\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}",
"public function insert()\n {\n \n }",
"protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }",
"abstract public function insert(string $table, array $row, array $options = []);",
"public abstract function insert();",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n // parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n // parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n // parent::postInsert($con);\n }\n }",
"abstract public function insert();",
"public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }",
"protected function _postSave()\n {\n $titlePhrase = $this->getExtraData(self::DATA_TITLE);\n if ($titlePhrase !== null) {\n $this->_insertOrUpdateMasterPhrase($this->_getTitlePhraseName($this->get('tab_name_id')), $titlePhrase, '');\n }\n\n $defaults = $this->getExtraData(self::DATA_DEFAULTS);\n if ($defaults !== null) {\n $this->_setDefaultOptions($defaults);\n }\n }",
"protected function _postUpdate()\n\t{\n\t}",
"public function afterSave()\n {\n if ($this->post === null) {\n return;\n }\n $relation = $this->owner->getRelation($this->attribute);\n /** @var ActiveQuery $via */\n $via = is_array($relation->via) ? $relation->via[1] : $relation->via;\n /** @var \\yii\\db\\ActiveRecord $viaClass */\n $viaTable = explode(' ', reset($via->from))[0];\n $link = $relation->link;\n $condition = [];\n foreach ($via->link as $viaAttribute => $ownerAttribute) {\n $condition[$viaAttribute] = $this->owner->$ownerAttribute;\n }\n $newIds = array_unique(array_filter($this->post, function($v){return !empty($v);}));\n $oldIds = $relation->select(array_keys($link))->column();\n \\Yii::$app->db->createCommand()->delete($viaTable,\n array_merge($condition, [reset($link) => array_diff($oldIds, $newIds)])\n )->execute();\n \\Yii::$app->db->createCommand()->batchInsert($viaTable, array_keys($condition)+$link, array_map(function ($id) use ($condition) {\n return array_merge($condition, [$id]);\n }, array_diff($newIds, $oldIds)))->execute();\n if ($this->callback) {\n call_user_func($this->callback, array_diff($newIds, $oldIds), array_diff($oldIds, $newIds));\n }\n }",
"protected function _postSave()\n\t{\n\t\t$templateTitles = array($this->get('template_title'), $this->getExisting('template_title'));\n\t\t$styleIds = $this->_getStyleModel()->getAllChildStyleIds($this->get('style_id'));\n\t\t$styleIds[] = $this->get('style_id');\n\n\t\t$db = $this->_db;\n\t\t$db->update(\n\t\t\t'xf_template_map',\n\t\t\tarray('template_final' => null, 'template_modifications' => null),\n\t\t\t'style_id IN (' . $db->quote($styleIds) . ') AND title IN (' . $db->quote($templateTitles) . ')'\n\t\t);\n\t}",
"public function insert()\n {\n # code...\n }",
"public function save()\n { \n return $this->checkForRows() ? $this->updateRow() : $this->insertRow();\n }",
"public function addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\n }",
"public function insert(phpDataMapper_Model_Row $row)\n\t{\n\t\t$rowData = $row->getData();\n\t\t\n\t\t// Fields that exist in the table\n\t\t$tableFields = array_keys($this->fields);\n\t\t\n\t\t// Fields that have been set/updated on the row that also exist in the table\n\t\t$rowFields = array_intersect($tableFields, array_keys($rowData));\n\t\t\n\t\t// Get \"col = :col\" pairs for the update query\n\t\t$insertFields = array();\n\t\t$binds = array();\n\t\tforeach($rowData as $field => $value) {\n\t\t\tif($this->fieldExists($field)) {\n\t\t\t\t$insertFields[] = $field;\n\t\t\t\t// Empty values will be NULL (easier to be handled by databases)\n\t\t\t\t$binds[$field] = $this->isEmpty($value) ? null : $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ensure there are actually values for fields on THIS table\n\t\tif(count($insertFields) > 0) {\n\t\t\t// build the statement\n\t\t\t$sql = \"INSERT INTO \" . $this->getTable() .\n\t\t\t\t\" (\" . implode(', ', $rowFields) . \")\" .\n\t\t\t\t\" VALUES(:\" . implode(', :', $rowFields) . \")\";\n\t\t\t\n\t\t\t// Add query to log\n\t\t\t$this->logQuery($sql, $binds);\n\t\t\t\n\t\t\t// Prepare update query\n\t\t\t$stmt = $this->adapter->prepare($sql);\n\t\t\t\n\t\t\tif($stmt) {\n\t\t\t\t// Bind values to columns\n\t\t\t\t$this->bindValues($stmt, $binds);\n\t\t\t\t\n\t\t\t\t// Execute\n\t\t\t\tif($stmt->execute()) {\n\t\t\t\t\t$rowPk = $this->adapter->lastInsertId();\n\t\t\t\t\t$pkField = $this->getPrimaryKeyField();\n\t\t\t\t\t$row->$pkField = $rowPk;\n\t\t\t\t\t$result = $rowPk;\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t\t\n\t\t// Save related rows\n\t\tif($result) {\n\t\t\t$this->saveRelatedRowsFor($row);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"protected function doInsert() {\n return '';\n }",
"private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }",
"public function insert()\n {\n }",
"public function insert()\n {\n }",
"public function Do_insert_Example1(){\n\n\t}",
"public abstract function Insert();",
"protected abstract function insertRow($tableName, $data);",
"protected function _insert()\n {\r\n $this->date_created = new Zend_Db_Expr(\"NOW()\");\r\n return parent::_insert();\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n parent::postInsert($con);\n }\n }",
"public function postInsert(ConnectionInterface $con = null)\n {\n if (is_callable('parent::postInsert')) {\n parent::postInsert($con);\n }\n }",
"public function onAfterSaveProperty($namespace, $row, $is_new)\n {\n // You can use this method to do a post-treatment (notification email ...)\n }",
"function post_handler() {\r\n\r\n if ($this->action == 'new' or $this->action == 'edit') { # handle new-save\r\n # check permission first\r\n if ( ($this->action == 'new' and !$this->allow_new) or ($this->action == 'edit' and !$this->allow_edit) )\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n\r\n $_REQUEST['num_row'] = intval($_REQUEST['num_row']) > 0? intval($_REQUEST['num_row']): 1; # new row should get the number of row to insert from num_row\r\n # import suggest field into current datasource (param sugg_field[..]). note: suggest field valid for all rows\r\n if ($this->action == 'new')\r\n $this->import_suggest_field_to_ds();\r\n # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n if ($this->_save == '') { # to accomodate -1 (preview)\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\r\n $this->import2ds(); # only do this if post come from edit form. bground: browse mode now can contain <input>, which value got passed to edit/new mode\r\n $this->db_count = $_REQUEST['num_row']; # new row should get the number of row to insert from num_row\r\n # check requirement\r\n\r\n if (!$this->validate_rows()) # don't continue if form does not pass validation\r\n return False;\r\n\r\n if ($this->action == 'new') {\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n if (!$this->check_datatype($i)) { # check duplicate index\r\n return False;\r\n }\r\n\r\n if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n return False;\r\n }\r\n if (!$this->check_insert($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->insert($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n while (@ob_end_clean());\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n elseif ($this->action == 'edit') {\r\n $this->populate($this->_rowid, True);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n #~ if (!$this->check_duplicate_index($i)) { # check duplicate index\r\n #~ return False;\r\n #~ }\r\n if (!$this->check_update($i)) { # check insertion\r\n return False;\r\n }\r\n }\r\n\r\n if ($this->preview[$this->action] and $this->_save == -1) { # show preview page instead\r\n $this->_preview = True;\r\n return False;\r\n }\r\n\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $this->update($i);\r\n }\r\n\r\n if ($this->_go != '') {\r\n #~ include('footer.inc.php');\r\n header('Location: '.$this->_go);\r\n exit;\r\n }\r\n }\r\n }\r\n elseif ($this->action == 'csv') {\r\n /* generate CSV representation of loaded datasource\r\n http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm\r\n */\r\n if (AADM_ON_BACKEND!=1)\r\n die('Permission not given for \"'.$this->action.'\" action.');\r\n $this->browse_rows = 0; # show all data\r\n $this->populate();\r\n $rows = array();\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = (strpos($col->label,',') === false)? $col->label: '\"'.$col->label.'\"';\r\n }\r\n $rows[] = join(',',$fields);\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n $fields = array();\r\n foreach ($this->properties as $colvar=>$col) {\r\n $vtemp = $this->ds->{$colvar}[$i];\r\n $vtemp = str_replace('\"','\"\"',$vtemp);\r\n $vtemp = (strpos($vtemp,',') === false and strpos($vtemp,'\"') === false and strpos($vtemp,\"\\n\") === false)? $vtemp: '\"'.$vtemp.'\"';\r\n $fields[] = $vtemp;\r\n }\r\n $rows[] = join(',',$fields);\r\n }\r\n #~ header('Content-type: application/vnd.ms-excel');\r\n header('Content-type: text/comma-separated-values');\r\n header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');\r\n header('Content-Disposition: inline; filename=\"dump.csv\"');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Expires: 0');\r\n\r\n echo join(\"\\r\\n\",$rows);\r\n exit();\r\n }\r\n else { # no-act handler, call its post function callbacks if available\r\n if (AADM_ON_BACKEND==1) {\r\n $callback = 'act_'.$this->action;\r\n if (method_exists($this, $callback)) {\r\n $this->$callback(True);\r\n }\r\n }\r\n }\r\n }",
"function after_insert_log($post_array, $primary_key)\n {\n $format = 'DATE_RFC822';\n $time = time();\n $date = standard_date($format, $time);\n\n $data = array(\n 'action' => 'insert',\n 'user' => $this->session->userdata('username'),\n 'section' => 'Idiomas',\n 'fk_section' => $primary_key,\n 'date' => $date\n\n );\n $this->db->insert('user_log', $data);\n }",
"public static function insert()\n {\n }",
"private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }",
"public function save(){\n global $wpdb;\n $table_name = $wpdb->prefix.static::$_table;\n \n $data = [];\n $pk = $this->getPk();\n foreach($this->_datas as $key => $value){\n if($key!=$pk && in_array($key, static::$_fields)){\n $data[$key] = $value.'';\n }\n }\n \n if( isset( $this->$pk ) ){\n // Update row\n $wpdb->update(\n $table_name,\n $data,\n [$pk=>$this->$pk]\n );\n }else{\n // Insert row\n $wpdb->insert(\n $table_name,\n $data\n );\n $this->$pk = $wpdb->insert_id;\n }\n \n return $this;\n }",
"public function insertRowPerform(RowInterface $row, InsertInterface $insert) : PDOStatement\n {\n $connection = $this->getWriteConnection();\n $pdoStatement = $connection->perform(\n $insert->getStatement(),\n $insert->getBindValues()\n );\n\n $rowCount = $pdoStatement->rowCount();\n if ($rowCount != 1) {\n throw Exception::unexpectedRowCountAffected($rowCount);\n }\n\n $autoinc = $this->getAutoinc();\n if ($autoinc) {\n $lastInsertIdName = $insert->getLastInsertIdName($autoinc);\n $row->$autoinc = $connection->lastInsertId($lastInsertIdName);\n }\n\n $this->events->afterInsert($this, $row, $insert, $pdoStatement);\n\n $row->setStatus($row::INSERTED);\n $this->identityMap->setRow($row, $row->getArrayCopy(), $this->getPrimaryKey());\n\n return $pdoStatement;\n }",
"public function onPostRowSave(MigratePostRowSaveEvent $event) {\n $migration = $event->getMigration();\n $migration_id = $migration->id();\n\n // Only act on rows for this migration.\n if (array_key_exists($migration_id, self::getMigrations())) {\n $row = $event->getRow();\n $destination_ids = $event->getDestinationIdValues();\n $reference_id = $destination_ids[0];\n\n // Contributors.\n $authors = $this->createContributors($row, 'author');\n $editors = $this->createContributors($row, 'editor');\n $series_editors = $this->createContributors($row, 'series_editor');\n $translators = $this->createContributors($row, 'translator');\n $src_contributors = $this->createContributors($row, 'contributor');\n $book_authors = $this->createContributors($row, 'book_author');\n $reviewed_authors = $this->createContributors($row, 'reviewed_author');\n\n $contributors = array_merge(\n $authors,\n $editors,\n $series_editors,\n $translators,\n $src_contributors,\n $book_authors,\n $reviewed_authors\n );\n\n // Instance and update reference.\n $item_type = $row->getSourceProperty('item_type');\n $entity_type = self::getZoteroTypeMappings()[$item_type];\n\n $reference = $this->typeManager\n ->getStorage($entity_type)\n ->load($reference_id);\n\n // Use source publication year if empty from publication date.\n $pub_year = trim($row->getSourceProperty('publication_year'));\n $src_year = $row->getSourceProperty('src_publication_year');\n\n if (empty($pub_year)) {\n $pub_year = !empty($src_year) ? $src_year : NULL;\n }\n\n if ((int) $pub_year == 0) {\n $pub_year = NULL;\n }\n\n // Default collection.\n $collection_name = self::getMigrations()[$migration_id];\n\n // If it's a religion migration, add to religion Collection.\n $parts = explode(': ', $collection_name);\n\n if ($parts[0] == 'Religion') {\n $collection_name = $parts[0];\n }\n\n if (!empty($collection_name)) {\n $existing = $this->typeManager->getStorage('yabrm_collection')\n ->getQuery()\n ->condition('name', $collection_name)\n ->accessCheck(FALSE)\n ->execute();\n\n reset($existing);\n $col_id = key($existing);\n\n // Create collection if doesn't exist.\n if (empty($col_id)) {\n $collection = BibliographicCollection::create([\n 'name' => $collection_name,\n ]);\n\n $collection->save();\n $col_id = $collection->id();\n }\n }\n\n $collections[] = $col_id ? $col_id : NULL;\n\n // Archive.\n $arch_name = $row->getSourceProperty('archive');\n\n if (!empty($arch_name)) {\n $existing = $this->typeManager->getStorage('taxonomy_term')\n ->getQuery()\n ->condition('name', $arch_name)\n ->condition('vid', 'nbbib_archives')\n ->accessCheck(FALSE)\n ->execute();\n\n reset($existing);\n $arch_id = key($existing);\n\n // Create archive if doesn't exist.\n if (empty($arch_id)) {\n $archive = Term::create([\n 'name' => $arch_name,\n 'vid' => 'nbbib_archives',\n ]);\n\n $archive->save();\n $arch_id = $archive->id();\n }\n }\n\n $archives[] = $arch_id ? $arch_id : NULL;\n\n // URL.\n $source_url = $row->getSourceProperty('url');\n $uri = substr(trim($source_url), 0, 4) === 'http' ? $source_url : NULL;\n $link_title = strlen($uri) > 125 ? substr($uri, 0, 125) . '...' : $uri;\n\n if ($uri) {\n\n $url = [\n 'uri' => $uri,\n 'title' => $link_title,\n 'options' => [\n 'attributes' => [\n 'target' => '_blank',\n ],\n ],\n ];\n\n $reference->setUrl($url);\n }\n\n $reference->setContributors($contributors);\n $reference->setPublicationYear($pub_year);\n $reference->setCollections($collections);\n $reference->setArchive($archives);\n $reference->setPublished(FALSE);\n $reference->save();\n }\n }",
"public function doInsert( $data ) {\t\t\r\n\r\n\t\t\r\n\t\t\t\t$newRow = $this->createRow();\r\n\t\t\t\r\n\t\t\t\tforeach ( $newRow->toArray() as $key => $v ) {\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t$newRow[ $key ] = Class_array::getValue( $data, $key );\r\n\t\t\t\t\r\n }\r\n\t\t\t\t$newRow->save();\t\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\treturn $newRow;\r\n\t\t\t\r\n\t\t//}\r\n\t}",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"protected function performPostSaveCallback()\n {\n // echo 'saved a record ...';\n return true;\n }",
"public abstract function getInsert(Table $table, $item = array());",
"public function afterInsert(): void\n {\n if ($this->owner->getAttribute($this->ownerParentIdAttribute)) {\n $this->addTreePathOwnerToParents();\n }\n $this->addTreePathOwnerToOwner();\n }",
"public function afterInsertEvent($self, $pkeys){\n }",
"public function insertRowCheckInjections($table, $row)\r\n {\r\n \r\n $array = $row;\r\n if (!is_array($array)) {\r\n $array = json_decode($row);\r\n }\r\n $count = 0;\r\n $columns_str = \"\";\r\n $values_str = \"\";\r\n $values_arr = array();\r\n $param_type = \"\"; //array();\r\n \r\n if (count($array) ==0) {\r\n array_push($this->error, \"Post does not contain any data!\");\r\n return false;\r\n }\r\n\r\n //check if any post data is not a valid column_name:\r\n $all_columns = $this->getRows(\"SHOW COLUMNS FROM $table \", true);\r\n $table_columns = array();\r\n foreach ($all_columns as $col_row) {\r\n $col_name = $col_row[\"Field\"];\r\n array_push($table_columns, $col_name);\r\n }\r\n $posted_columns = array_keys($array);\r\n foreach ($posted_columns as $posted_column) {\r\n if (!in_array($posted_column, $table_columns)) {\r\n array_push($this->error, \"field: $posted_column is not in table: $table\");\r\n return false;\r\n }\r\n }\r\n $required_columns = array();\r\n foreach ($all_columns as $col_row) {\r\n if ($col_row[\"Extra\"] != \"auto_increment\" && (is_null($col_row[\"Default\"])) && $col_row[\"Null\"] == \"NO\") {\r\n $col_name = $col_row[\"Field\"];\r\n if (!in_array($col_name, $posted_columns)) {\r\n array_push($required_columns, $col_name);\r\n }\r\n }\r\n }\r\n if (count($required_columns)>0) {\r\n $str_columns = \"\";\r\n foreach ($required_columns as $col) {\r\n $str_columns.=$col.\",\";\r\n }\r\n $str_columns = substr($str_columns, 0, strlen($str_columns)-1);\r\n array_push($this->error, \"Required to post: \".$str_columns.\" in table $table .\");\r\n return false;\r\n }\r\n\r\n foreach ($array as $key => $value) {\r\n $count+=1;\r\n $columns_str .= \",\".$key;\r\n $values_str .= \", ?\";\r\n array_push($values_arr, $value);\r\n $param_type .= \"s\";\r\n }\r\n $columns_str = substr($columns_str, 1);\r\n $values_str = substr($values_str, 2);\r\n $sql = \"insert into \".$table.\"(\".$columns_str.\") values (\".$values_str.\")\";\r\n $this->sql_statement = $sql;\r\n $stmt = $this->conn->prepare($sql);\r\n\r\n $a_params = array();\r\n array_push($a_params, $param_type);\r\n foreach ($values_arr as $singleValue) {\r\n array_push($a_params, $singleValue);\r\n }\r\n \r\n //echo json_encode($a_params);\r\n\r\n \r\n if (!$stmt) {\r\n array_push($this->error, \"insertRow: Error in preparing statement (\".$sql.\") \\n\".$this->conn->error);\r\n return false;\r\n } else {\r\n //bind with bind_param to avoid sql injections\r\n call_user_func_array(array($stmt, 'bind_param'), $this->refValues($a_params));\r\n $result = $stmt->execute();\r\n //$ins_stmt = $result->store_result();\r\n $count = $this->getConn()->affected_rows;\r\n $this->rowCount = $count;\r\n $this->pk_code = mysqli_insert_id($this->getConn());\r\n $stmt->close();\r\n\r\n //getting the primary key columns:\r\n $pk_columns = $this->getRows(\"SHOW KEYS FROM $table WHERE Key_name = 'PRIMARY'\", true);\r\n $pk_where = \"\";\r\n $i = 0;\r\n foreach ($pk_columns as $pkRow) {\r\n $pk_column = $pkRow['Column_name'];\r\n if (strlen($pk_where) > 0) {\r\n $pk_where .= \" and \";\r\n }\r\n $pk_value = $this->pk_code;\r\n if (is_array($pk_value)) {\r\n $pk_value = $pk_value[$i];\r\n }\r\n $pk_where .= $pk_column.\"='\".$pk_value.\"'\" ;\r\n $i++;\r\n }\r\n $result_row = $this->getRows(\"select * from $table WHERE $pk_where\", true);\r\n return $result_row;\r\n }\r\n }",
"public function Insert() // Inaczej !!! \n\t\t{\n\t\t\t$result = mysqli_query($this->link, $this->task);\n\t\t\treturn mysqli_affected_rows($this->link).\" line affected by SELECT\\n\\n\";\n\t\t}",
"protected function postSave() {\n\t\treturn true;\n\t}",
"public function insert()\n {\n $this->id = insert($this);\n }",
"public function insertRowPrepare(RowInterface $row) : InsertInterface\n {\n $this->events->beforeInsert($this, $row);\n\n $insert = $this->insert();\n $cols = $row->getArrayCopy();\n $autoinc = $this->getAutoinc();\n if ($autoinc) {\n unset($cols[$autoinc]);\n }\n $insert->cols($cols);\n\n $this->events->modifyInsert($this, $row, $insert);\n return $insert;\n }",
"public function insertPostProcess($data = null)\n {\n EventUtil::notify(new Zikula_Event('dbobjectarray.insertpostprocess', $this));\n return $this->_objData;\n }",
"function InlineInsert() {\n\t\tglobal $Language, $objForm, $gsFormError;\n\t\t$this->LoadOldRecord(); // Load old recordset\n\t\t$objForm->Index = 0;\n\t\t$this->LoadFormValues(); // Get form values\n\n\t\t// Validate form\n\t\tif (!$this->ValidateForm()) {\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t\treturn;\n\t\t}\n\t\t$this->SendEmail = TRUE; // Send email on add success\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\n\t\t\tif ($this->getSuccessMessage() == \"\")\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\n\t\t} else { // Add failed\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t}\n\t}",
"public function insert(){\n\n }",
"public function processInsert()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter insertModifyValidationRules\n $validationRules = $this->doFilter(\"insertModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter insertModifyValidationMessages\n $validationMessages = $this->doFilter(\"insertModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n if ($this->Request->ajax()) {\n // Send Response\n $JsonResponse = new JsonResponse($validator->errors(), 400);\n $JsonResponse->send();\n exit;\n } else {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set value for BLOB columns\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter insertModifyRequest\n $requestParameters = $this->doFilter(\"insertModifyRequest\", $requestParameters);\n // Insert record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($requestParameters) {\n $this->Model->dkCreate($requestParameters);\n // Hook Action insertAfterInsert\n $this->doHooks(\"insertAfterInsert\", array($this->Model));\n });\n } else {\n $this->Model->dkCreate($requestParameters);\n // Hook Action insertAfterInsert\n $this->doHooks(\"insertAfterInsert\", array($this->Model));\n }\n if ($this->Request->ajax()) {\n // Send Response\n $JsonResponse = new JsonResponse(trans('dkscaffolding.notification.insert.success'), 200);\n $JsonResponse = $this->doFilter(\"insertModifyResponse\", $JsonResponse);\n $JsonResponse->send();\n exit;\n } else {\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.insert.success'));\n // Hook Filter insertModifyResponse\n $Response = $this->doFilter(\"insertModifyResponse\", $Response);\n $this->redirect($Response);\n }\n }",
"protected function performPostUpdateCallback()\n {\n // echo 'updated a record ...';\n return true;\n }",
"public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }",
"Static function MapToRowInsert($item){\n $retval['id_entreprise']=$item->id_entreprise;\n $retval['id_collaborateur']=$item->id_collaborateur;\n return $retval;\n }",
"public function beforeInsert()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"private function _insert($data){\n \t\n \tif(isset($data['date_established'] )){\n \t\t$data['date_established'] = Application_Core_Utilities::ukDateToMysql($data['date_established']);\n \t}\n \t\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }",
"public function insert_in_table(array $post) {\n\n $return = null;\n $k_res ='';\n $values = '';\n // store schema in variable $res\n $res = $this->get_schema();\n // shell $res and store in variable $values\n foreach ($res as $key => $val){\n $k_res .= $val[0].\",\";\n }\n\n // remove the last charcter in $keys\n $k_res = substr($k_res, 0, -1);\n // convert $k_res to array\n $exp_res = explode(\",\", $k_res);\n // chekc the diffirent\n $result = array_diff($exp_res, $post);\n\n for ($i= 0; $i < count($result); $i ++){\n\n if($res[$i][5] == 'auto_increment'){\n\n $values .= \"DEFAULT, \";\n }else if(isset($post[$result[$i]]) and $post[$result[$i]] == null){\n\n $values .= \"NULL,\";\n }else if(!isset($post[$result[$i]])){\n\n $values .= \"NULL,\";\n }else if($post[$result[$i]] == 'now'){\n\n $values .= \"NOW(),\";\n }else if($post[$result[$i]] == \"FALSE\"){\n\n $values .= \"FALSE,\";\n }else if($post[$result[$i]] == \"LAST_INSERT_ID\"){\n\n $values .= \"LAST_INSERT_ID(),\";\n }else if($post[$result[$i]] == \"TRUE\"){\n\n $values .= \"TRUE,\";\n }else if($result[$i] == 'date'){\n \n\n $values .= \"'\".strtotime($post[$result[$i]]).\"',\";\n \n\n }else if($result[$i] == 'password'){\n // check password with Tools\n $password = services\\Tools::check_password($post[$result[$i]]);\n if ($password != false){\n $values .= \"'\".$password.\"',\";\n }else {\n\n $return = \"Invalid Password\";\n }\n\n }else if($result[$i] == 'mail'){\n\n // check mail with Tools\n $mail = services\\Tools::check_mail($post[$result[$i]]);\n\n if ($mail != false){\n $values .= \"'\".$post[$result[$i]].\"',\";\n }else {\n\n $return = \"Invalid mail\";\n }\n\n }else if(strpos($post[$result[$i]], \",\") !== false){\n\n $vergule = str_replace(\",\", \"ù\", $post[$result[$i]]);\n $values .= \"'\".$vergule.\"',\";\n }else {\n\n $values .= \"'\".addslashes(htmlentities(trim($post[$result[$i]]))).\"',\";\n }\n }\n\n\n $values = substr($values, 0, -1);\n\n if(strpos($values, \"ù\") !== false){\n\n $values= str_replace(\"ù\", \",\", $values);\n }\n\n if($return == null){\n\n $sql = \"INSERT INTO \".$this->_table.\"(\".$k_res.\") VALUES(\".$values.\")\";\n\n //echo $sql; die();\n \n $res = $this->_pdo->exec($sql)or var_dump($this->_pdo->errorInfo());\n\n return $return;\n }else {\n\n return $return;\n }\n }",
"public function insert() {\n\t\t$db = self::getDB();\n\t\t$sql = \"INSERT INTO posts\n\t\t\t\t\t(nome, conteudo, fk_idUsuario, fk_idTopico)\n\t\t\t\tVALUES\n\t\t\t\t\t(:nome, :conteudo, :fk_idUsuario, :fk_idTopico)\";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':nome' => $this->getNome(),\n\t\t\t':conteudo' => $this->getConteudo(),\n\t\t\t':fk_idUsuario' => $this->getFkIdUsuario(),\n\t\t\t':fk_idTopico' => $this->getFkIdTopico()\n\t\t]);\n\t\t$this->idPost = $db->lastInsertId();\n\t}"
] | [
"0.7673658",
"0.7196362",
"0.7171806",
"0.71128833",
"0.6955235",
"0.6626729",
"0.6626729",
"0.6540758",
"0.65086454",
"0.6499347",
"0.6473286",
"0.6462735",
"0.638358",
"0.63253045",
"0.62360656",
"0.6087291",
"0.6075813",
"0.60416967",
"0.60378164",
"0.60255736",
"0.60138667",
"0.59990346",
"0.5991803",
"0.5983034",
"0.59630406",
"0.59617025",
"0.59520394",
"0.5926901",
"0.592125",
"0.58866",
"0.5884117",
"0.5868889",
"0.5856641",
"0.5834535",
"0.5816756",
"0.57999027",
"0.5784828",
"0.57813126",
"0.57720166",
"0.57720166",
"0.57720166",
"0.57653797",
"0.57591105",
"0.5752055",
"0.5714196",
"0.57095146",
"0.5702527",
"0.5689945",
"0.5688058",
"0.5687384",
"0.5671919",
"0.5666289",
"0.5655544",
"0.5654303",
"0.5647034",
"0.5647034",
"0.5636812",
"0.56310326",
"0.560992",
"0.5573715",
"0.55719745",
"0.55719745",
"0.55719745",
"0.55719745",
"0.55719745",
"0.55719745",
"0.55586296",
"0.5549",
"0.554405",
"0.5508612",
"0.55042636",
"0.54902357",
"0.54782915",
"0.5464916",
"0.54584605",
"0.5454433",
"0.5442099",
"0.5442099",
"0.54389393",
"0.5413507",
"0.5410737",
"0.5407287",
"0.5405496",
"0.5398266",
"0.5392678",
"0.53834856",
"0.53829116",
"0.53801477",
"0.5375766",
"0.5374315",
"0.5368434",
"0.5355783",
"0.5338141",
"0.5331527",
"0.53291243",
"0.532644",
"0.53242296",
"0.5323378",
"0.53201485",
"0.5319124"
] | 0.65406346 | 8 |
Allow preupdate logic to be applied to row | public function _update()
{
$this->notifyObservers(__FUNCTION__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function beforeUpdating()\n {\n }",
"protected function _preupdate() {\n }",
"function prepare_update($rowindex) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->on_edit_callback != '') {\r\n $this->ds->{$colvar}[$rowindex] = eval($col->on_edit_callback);\r\n }\r\n }\r\n return True;\r\n }",
"protected function beforeUpdate()\n {\n }",
"public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }",
"public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }",
"function before_update() {}",
"protected function performPreUpdateCallback()\n {\n // echo 'updating a record ...';\n $this->validate();\n \n return true;\n }",
"protected function getUpdateBeforeFunction()\n {\n \n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }",
"public function beforeUpdate()\n {\n\t\t// Asignar fecha y hora de ultima actualizacion\n// $this->updatedon = time();\n }",
"function before_validation_on_update() {}",
"public function preUpdate()\n {\n }",
"protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }",
"public function onPreUpdate()\n {\n $now = new \\DateTime();\n $this->setUpdatedAt($now);\n }",
"public function onPreUpdate()\n {\n $this->setUpdated(new \\DateTime(\"now\"));\n }",
"public function doPreUpdate()\n {\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }",
"public function preUpdate()\n {\n $this->dateModification = new \\DateTime();\n }",
"protected function preUpdate( ModelInterface &$model ) {\n }",
"abstract protected function updateSpecificProperties($row);",
"public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }",
"public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }",
"public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }",
"public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }",
"public function preUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }",
"public function onPreUpdate()\n {\n $this->updateAt = new Carbon();\n }",
"public function beforeUpdate()\n {\n $this->update_at=time();\n }",
"public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime('now');\n }",
"public function onPreUpdate()\n {\n $this->modified_at = new \\DateTime(\"now\");\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }",
"public function preUpdate()\n {\n $this->updatedAt = new \\DateTime;\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }",
"public function preUpdate()\n {\n $this->dateUpdated = new \\DateTime();\n }",
"function wp_plugin_update_rows()\n {\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }",
"public function prepareUpdate() {\n $this->connection->update($this->mapTable)\n ->fields(array('needs_update' => MigrateMap::STATUS_NEEDS_UPDATE))\n ->execute();\n }",
"public function preUpdate($entity, PreUpdateEventArgs $eventArgs);",
"public function onPreUpdate()\r\n {\r\n $this->updated_at = new \\DateTime(\"now\");\r\n }",
"public function changeRowData(&$row){}",
"public function preUpdate(Doctrine_Event $event)\n {\n if ( ! $this->_options['updated']['disabled']) {\n $updatedName = $event->getInvoker()->getTable()->getFieldName($this->_options['updated']['name']);\n $modified = $event->getInvoker()->getModified();\n if ( ! isset($modified[$updatedName])) {\n $event->getInvoker()->$updatedName = $this->getUserId();\n }\n }\n }",
"protected function _beforeSave()\n {\n $this->_prepareData();\n return parent::_beforeSave();\n }",
"function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\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\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\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} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}",
"public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }",
"public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }",
"public function preSave() {}",
"public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }",
"function preUpdate(&$record)\n\t{\n\t\tif ($record['id'] != atkGetUser('id'))\n\t\t{\n\t\t\techo atktext('error_attributeedit_update');\n\t\t\tsession_regenerate_id(true);\n\t\t\tdie();\n\t\t}\n\n\t\t// flatten to single array\n\t\tfor ($i=1; $i < ($this->numOfRecords + 1); $i++){\n\t\t\t$singleArray[$record[\"key$i\"]] = $record[\"translation$i\"];\n\t\t}\n\n\t\t$record[\"customlang\"] = base64_encode(serialize($singleArray));\n\n\t}",
"protected function performUpdate() {}",
"public function beforeUpdate()\n {\n $this->modified_in = date('Y-m-d H:i:s');\n }",
"protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }",
"function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}",
"protected function beforeUpdate()\n {\n $this->idInitializationCheck(true);\n return $this->validation('update');\n }",
"protected function _postUpdate()\n\t{\n\t}",
"public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }",
"private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }",
"function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// model_id\n\t\t\t$this->model_id->SetDbValueDef($rsnew, $this->model_id->CurrentValue, 0, $this->model_id->ReadOnly);\n\n\t\t\t// title\n\t\t\t$this->title->SetDbValueDef($rsnew, $this->title->CurrentValue, NULL, $this->title->ReadOnly);\n\n\t\t\t// description\n\t\t\t$this->description->SetDbValueDef($rsnew, $this->description->CurrentValue, NULL, $this->description->ReadOnly);\n\n\t\t\t// s_order\n\t\t\t$this->s_order->SetDbValueDef($rsnew, $this->s_order->CurrentValue, 0, $this->s_order->ReadOnly);\n\n\t\t\t// status\n\t\t\t$this->status->SetDbValueDef($rsnew, $this->status->CurrentValue, 0, $this->status->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}",
"public function preProcess($model, &$row)\n {\n switch ($model) {\n case 'Loan':\n $row['start_date'] = date('Y/m/d H:i:s', $row['start_date']);\n $row['end_date'] = date('Y/m/d H:i:s', $row['end_date']);\n $row['status'] = boolval(intval($row['status']));\n break;\n \n default:\n # code...\n break;\n }\n \n return true;\n }",
"protected function _updatePre()\n\t{\n\t\tif (empty($this->_curPre['title'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t$query = 'UPDATE predb SET ';\n\n\t\t$query .= (!empty($this->_curPre['size']) ? 'size = ' . $this->_pdo->escapeString($this->_curPre['size']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['source']) ? 'source = ' . $this->_pdo->escapeString($this->_curPre['source']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['files']) ? 'files = ' . $this->_pdo->escapeString($this->_curPre['files']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['reason']) ? 'nukereason = ' . $this->_pdo->escapeString($this->_curPre['reason']) . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['reqid']) ? 'requestid = ' . $this->_curPre['reqid'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['group_id']) ? 'group_id = ' . $this->_curPre['group_id'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['predate']) ? 'predate = ' . $this->_curPre['predate'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['nuked']) ? 'nuked = ' . $this->_curPre['nuked'] . ', ' : '');\n\t\t$query .= (!empty($this->_curPre['filename']) ? 'filename = ' . $this->_pdo->escapeString($this->_curPre['filename']) . ', ' : '');\n\t\t$query .= (\n\t\t\t(empty($this->_oldPre['category']) && !empty($this->_curPre['category']))\n\t\t\t\t? 'category = ' . $this->_pdo->escapeString($this->_curPre['category']) . ', '\n\t\t\t\t: ''\n\t\t);\n\n\t\tif ($query === 'UPDATE predb SET '){\n\t\t\treturn;\n\t\t}\n\n\t\t$query .= 'title = ' . $this->_pdo->escapeString($this->_curPre['title']);\n\t\t$query .= ' WHERE title = ' . $this->_pdo->escapeString($this->_curPre['title']);\n\n\t\t$this->_pdo->ping(true);\n\n\t\t$this->_pdo->queryExec($query);\n\n\t\t$this->_doEcho(false);\n\t}",
"public function beforeSave(){\n //$this->updated = date('Y-m-d H:i:s');\n return parent::beforeSave();\n }",
"public function preSave() { }",
"public function updateRow($row);",
"function validate_on_update() {}",
"public function prepopulateRowWhenEmpty()\n {\n return $this->withMeta(['prepopulateRowWhenEmpty' => true]);\n }",
"public function preUpdate(Model $model, $entry) {\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n\n $this->preUpdateFields[$model->getName()][$entry->getId()] = $logModel->prepareLogUpdate($model, $entry);\n }",
"public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }",
"protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }",
"protected function _updatefields() {}",
"protected function _update()\n\t{\n\t}",
"function wp_theme_update_rows()\n {\n }",
"public function beforeUpdate()\n {\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"function onBeforeEdit() {\n\t\treturn true;\n\t}",
"protected function beforeUpdate(array &$data, Model $model)\n {\n }",
"public function preUpdate()\n {\n \t$this->dateFound = new \\DateTime(\"now\");\n }",
"protected function beforeUpdate(): bool\n {\n return true;\n }",
"protected function _prepareRowsAction() {\n \n }",
"public function preUpdate(\\Doctrine\\ODM\\MongoDB\\Event\\LifecycleEventArgs $eventArgs);",
"public function isUpdateRequired();",
"protected function _update()\n {\n \n }",
"protected function _update()\n {\n \n }",
"function after_validation_on_update() {}",
"public function preUpdate(PreUpdateEventArgs $eventArgs)\n {\n $this->dispatchEntityEvent($eventArgs->getEntity(), 'onPreUpdate', [$eventArgs]);\n }",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"public function beforeSave()\n {\n if ($this->fixResultSets)\n {\n foreach ($this->fixResultSets as $property => $__)\n {\n if (isset($this->$property) && ($value = $this->$property) instanceof \\Phalcon\\Mvc\\Model\\ResultSetInterface)\n {\n unset($this->fixResultSets[$property]);\n $this->$property = $value->filter(function($r) {\n return $r;\n });\n }\n }\n }\n }",
"public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }",
"public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }",
"public function update_or_ignore()\n {\n $this->update_ignore('table', array('foo' => 'bar'), array('hello' => 'world'));\n\n // you can also do\n $this->ignore();\n $this->update('table', array('foo' => 'bar'), array('hello' => 'world'));\n }",
"public function updateRowPrepare(RowInterface $row) : UpdateInterface\n {\n $this->events->beforeUpdate($this, $row);\n\n $update = $this->update();\n $init = $this->identityMap->getInitial($row);\n $diff = $row->getArrayDiff($init);\n foreach ($this->getPrimaryKey() as $primaryCol) {\n if (array_key_exists($primaryCol, $diff)) {\n $message = \"Primary key value for '$primaryCol' \"\n . \"changed from '$init[$primaryCol]' \"\n . \"to '$diff[$primaryCol]'.\";\n throw new Exception($message);\n }\n $update->where(\"{$primaryCol} = ?\", $row->$primaryCol);\n unset($diff[$primaryCol]);\n }\n $update->cols($diff);\n\n $this->events->modifyUpdate($this, $row, $update);\n return $update;\n }",
"function before_update_processor($row, $postData) {\r\n\tunset($postData['vupb_nama']);\r\n\tunset($postData['vgenerik']);\r\n\t\r\n\t//print_r($postData);exit();\r\n\treturn $postData;\r\n\r\n}",
"function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// nomr\n\t\t\t$this->nomr->SetDbValueDef($rsnew, $this->nomr->CurrentValue, \"\", $this->nomr->ReadOnly);\n\n\t\t\t// ket_nama\n\t\t\t$this->ket_nama->SetDbValueDef($rsnew, $this->ket_nama->CurrentValue, NULL, $this->ket_nama->ReadOnly);\n\n\t\t\t// ket_tgllahir\n\t\t\t$this->ket_tgllahir->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->ket_tgllahir->CurrentValue, 0), NULL, $this->ket_tgllahir->ReadOnly);\n\n\t\t\t// ket_alamat\n\t\t\t$this->ket_alamat->SetDbValueDef($rsnew, $this->ket_alamat->CurrentValue, NULL, $this->ket_alamat->ReadOnly);\n\n\t\t\t// ket_jeniskelamin\n\t\t\t$this->ket_jeniskelamin->SetDbValueDef($rsnew, $this->ket_jeniskelamin->CurrentValue, NULL, $this->ket_jeniskelamin->ReadOnly);\n\n\t\t\t// ket_title\n\t\t\t$this->ket_title->SetDbValueDef($rsnew, $this->ket_title->CurrentValue, NULL, $this->ket_title->ReadOnly);\n\n\t\t\t// dokterpengirim\n\t\t\t$this->dokterpengirim->SetDbValueDef($rsnew, $this->dokterpengirim->CurrentValue, 0, $this->dokterpengirim->ReadOnly);\n\n\t\t\t// statusbayar\n\t\t\t$this->statusbayar->SetDbValueDef($rsnew, $this->statusbayar->CurrentValue, 0, $this->statusbayar->ReadOnly);\n\n\t\t\t// kirimdari\n\t\t\t$this->kirimdari->SetDbValueDef($rsnew, $this->kirimdari->CurrentValue, 0, $this->kirimdari->ReadOnly);\n\n\t\t\t// keluargadekat\n\t\t\t$this->keluargadekat->SetDbValueDef($rsnew, $this->keluargadekat->CurrentValue, \"\", $this->keluargadekat->ReadOnly);\n\n\t\t\t// panggungjawab\n\t\t\t$this->panggungjawab->SetDbValueDef($rsnew, $this->panggungjawab->CurrentValue, \"\", $this->panggungjawab->ReadOnly);\n\n\t\t\t// masukrs\n\t\t\t$this->masukrs->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->masukrs->CurrentValue, 0), NULL, $this->masukrs->ReadOnly);\n\n\t\t\t// noruang\n\t\t\t$this->noruang->SetDbValueDef($rsnew, $this->noruang->CurrentValue, 0, $this->noruang->ReadOnly);\n\n\t\t\t// tempat_tidur_id\n\t\t\t$this->tempat_tidur_id->SetDbValueDef($rsnew, $this->tempat_tidur_id->CurrentValue, 0, $this->tempat_tidur_id->ReadOnly);\n\n\t\t\t// nott\n\t\t\t$this->nott->SetDbValueDef($rsnew, $this->nott->CurrentValue, \"\", $this->nott->ReadOnly);\n\n\t\t\t// NIP\n\t\t\t$this->NIP->SetDbValueDef($rsnew, $this->NIP->CurrentValue, \"\", $this->NIP->ReadOnly);\n\n\t\t\t// dokter_penanggungjawab\n\t\t\t$this->dokter_penanggungjawab->SetDbValueDef($rsnew, $this->dokter_penanggungjawab->CurrentValue, 0, $this->dokter_penanggungjawab->ReadOnly);\n\n\t\t\t// KELASPERAWATAN_ID\n\t\t\t$this->KELASPERAWATAN_ID->SetDbValueDef($rsnew, $this->KELASPERAWATAN_ID->CurrentValue, NULL, $this->KELASPERAWATAN_ID->ReadOnly);\n\n\t\t\t// NO_SKP\n\t\t\t$this->NO_SKP->SetDbValueDef($rsnew, $this->NO_SKP->CurrentValue, NULL, $this->NO_SKP->ReadOnly);\n\n\t\t\t// sep_tglsep\n\t\t\t$this->sep_tglsep->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglsep->CurrentValue, 5), NULL, $this->sep_tglsep->ReadOnly);\n\n\t\t\t// sep_tglrujuk\n\t\t\t$this->sep_tglrujuk->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglrujuk->CurrentValue, 5), NULL, $this->sep_tglrujuk->ReadOnly);\n\n\t\t\t// sep_kodekelasrawat\n\t\t\t$this->sep_kodekelasrawat->SetDbValueDef($rsnew, $this->sep_kodekelasrawat->CurrentValue, NULL, $this->sep_kodekelasrawat->ReadOnly);\n\n\t\t\t// sep_norujukan\n\t\t\t$this->sep_norujukan->SetDbValueDef($rsnew, $this->sep_norujukan->CurrentValue, NULL, $this->sep_norujukan->ReadOnly);\n\n\t\t\t// sep_kodeppkasal\n\t\t\t$this->sep_kodeppkasal->SetDbValueDef($rsnew, $this->sep_kodeppkasal->CurrentValue, NULL, $this->sep_kodeppkasal->ReadOnly);\n\n\t\t\t// sep_namappkasal\n\t\t\t$this->sep_namappkasal->SetDbValueDef($rsnew, $this->sep_namappkasal->CurrentValue, NULL, $this->sep_namappkasal->ReadOnly);\n\n\t\t\t// sep_kodeppkpelayanan\n\t\t\t$this->sep_kodeppkpelayanan->SetDbValueDef($rsnew, $this->sep_kodeppkpelayanan->CurrentValue, NULL, $this->sep_kodeppkpelayanan->ReadOnly);\n\n\t\t\t// sep_jenisperawatan\n\t\t\t$this->sep_jenisperawatan->SetDbValueDef($rsnew, $this->sep_jenisperawatan->CurrentValue, NULL, $this->sep_jenisperawatan->ReadOnly);\n\n\t\t\t// sep_catatan\n\t\t\t$this->sep_catatan->SetDbValueDef($rsnew, $this->sep_catatan->CurrentValue, NULL, $this->sep_catatan->ReadOnly);\n\n\t\t\t// sep_kodediagnosaawal\n\t\t\t$this->sep_kodediagnosaawal->SetDbValueDef($rsnew, $this->sep_kodediagnosaawal->CurrentValue, NULL, $this->sep_kodediagnosaawal->ReadOnly);\n\n\t\t\t// sep_namadiagnosaawal\n\t\t\t$this->sep_namadiagnosaawal->SetDbValueDef($rsnew, $this->sep_namadiagnosaawal->CurrentValue, NULL, $this->sep_namadiagnosaawal->ReadOnly);\n\n\t\t\t// sep_lakalantas\n\t\t\t$this->sep_lakalantas->SetDbValueDef($rsnew, $this->sep_lakalantas->CurrentValue, NULL, $this->sep_lakalantas->ReadOnly);\n\n\t\t\t// sep_lokasilaka\n\t\t\t$this->sep_lokasilaka->SetDbValueDef($rsnew, $this->sep_lokasilaka->CurrentValue, NULL, $this->sep_lokasilaka->ReadOnly);\n\n\t\t\t// sep_user\n\t\t\t$this->sep_user->SetDbValueDef($rsnew, $this->sep_user->CurrentValue, NULL, $this->sep_user->ReadOnly);\n\n\t\t\t// sep_flag_cekpeserta\n\t\t\t$this->sep_flag_cekpeserta->SetDbValueDef($rsnew, $this->sep_flag_cekpeserta->CurrentValue, NULL, $this->sep_flag_cekpeserta->ReadOnly);\n\n\t\t\t// sep_flag_generatesep\n\t\t\t$this->sep_flag_generatesep->SetDbValueDef($rsnew, $this->sep_flag_generatesep->CurrentValue, NULL, $this->sep_flag_generatesep->ReadOnly);\n\n\t\t\t// sep_nik\n\t\t\t$this->sep_nik->SetDbValueDef($rsnew, $this->sep_nik->CurrentValue, NULL, $this->sep_nik->ReadOnly);\n\n\t\t\t// sep_namapeserta\n\t\t\t$this->sep_namapeserta->SetDbValueDef($rsnew, $this->sep_namapeserta->CurrentValue, NULL, $this->sep_namapeserta->ReadOnly);\n\n\t\t\t// sep_jeniskelamin\n\t\t\t$this->sep_jeniskelamin->SetDbValueDef($rsnew, $this->sep_jeniskelamin->CurrentValue, NULL, $this->sep_jeniskelamin->ReadOnly);\n\n\t\t\t// sep_pisat\n\t\t\t$this->sep_pisat->SetDbValueDef($rsnew, $this->sep_pisat->CurrentValue, NULL, $this->sep_pisat->ReadOnly);\n\n\t\t\t// sep_tgllahir\n\t\t\t$this->sep_tgllahir->SetDbValueDef($rsnew, $this->sep_tgllahir->CurrentValue, NULL, $this->sep_tgllahir->ReadOnly);\n\n\t\t\t// sep_kodejeniskepesertaan\n\t\t\t$this->sep_kodejeniskepesertaan->SetDbValueDef($rsnew, $this->sep_kodejeniskepesertaan->CurrentValue, NULL, $this->sep_kodejeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_namajeniskepesertaan\n\t\t\t$this->sep_namajeniskepesertaan->SetDbValueDef($rsnew, $this->sep_namajeniskepesertaan->CurrentValue, NULL, $this->sep_namajeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_nokabpjs\n\t\t\t$this->sep_nokabpjs->SetDbValueDef($rsnew, $this->sep_nokabpjs->CurrentValue, NULL, $this->sep_nokabpjs->ReadOnly);\n\n\t\t\t// sep_status_peserta\n\t\t\t$this->sep_status_peserta->SetDbValueDef($rsnew, $this->sep_status_peserta->CurrentValue, NULL, $this->sep_status_peserta->ReadOnly);\n\n\t\t\t// sep_umur_pasien_sekarang\n\t\t\t$this->sep_umur_pasien_sekarang->SetDbValueDef($rsnew, $this->sep_umur_pasien_sekarang->CurrentValue, NULL, $this->sep_umur_pasien_sekarang->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}",
"public function incrementRowsUpdated(): void\n {\n $this->rowsUpdated++;\n }",
"protected function preSave() {\n\t\treturn true;\n\t}",
"function EditRow() {\r\n\t\tglobal $conn, $Security, $filesystem;\r\n\t\t$sFilter = $filesystem->KeyFilter();\r\n\t\t$filesystem->CurrentFilter = $sFilter;\r\n\t\t$sSql = $filesystem->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold =& $rs->fields;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Field gid\r\n\t\t\t$filesystem->gid->SetDbValueDef($filesystem->gid->CurrentValue, NULL);\r\n\t\t\t$rsnew['gid'] =& $filesystem->gid->DbValue;\r\n\r\n\t\t\t// Field snapshot\r\n\t\t\t$filesystem->snapshot->SetDbValueDef($filesystem->snapshot->CurrentValue, NULL);\r\n\t\t\t$rsnew['snapshot'] =& $filesystem->snapshot->DbValue;\r\n\r\n\t\t\t// Field tapebackup\r\n\t\t\t$filesystem->tapebackup->SetDbValueDef($filesystem->tapebackup->CurrentValue, NULL);\r\n\t\t\t$rsnew['tapebackup'] =& $filesystem->tapebackup->DbValue;\r\n\r\n\t\t\t// Field diskbackup\r\n\t\t\t$filesystem->diskbackup->SetDbValueDef($filesystem->diskbackup->CurrentValue, NULL);\r\n\t\t\t$rsnew['diskbackup'] =& $filesystem->diskbackup->DbValue;\r\n\r\n\t\t\t// Field type\r\n\t\t\t$filesystem->type->SetDbValueDef($filesystem->type->CurrentValue, NULL);\r\n\t\t\t$rsnew['type'] =& $filesystem->type->DbValue;\r\n\r\n\t\t\t// Field contact\r\n\t\t\t$filesystem->contact->SetDbValueDef($filesystem->contact->CurrentValue, NULL);\r\n\t\t\t$rsnew['contact'] =& $filesystem->contact->DbValue;\r\n\r\n\t\t\t// Field contact2\r\n\t\t\t$filesystem->contact2->SetDbValueDef($filesystem->contact2->CurrentValue, NULL);\r\n\t\t\t$rsnew['contact2'] =& $filesystem->contact2->DbValue;\r\n\r\n\t\t\t// Field rescomp\r\n\t\t\t$filesystem->rescomp->SetDbValueDef($filesystem->rescomp->CurrentValue, NULL);\r\n\t\t\t$rsnew['rescomp'] =& $filesystem->rescomp->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $filesystem->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$EditRow = $conn->Execute($filesystem->UpdateSQL($rsnew));\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t} else {\r\n\t\t\t\tif ($filesystem->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setMessage($filesystem->CancelMessage);\r\n\t\t\t\t\t$filesystem->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setMessage(\"Update cancelled\");\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$filesystem->Row_Updated($rsold, $rsnew);\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}",
"protected function preUpdateHook($object) { }",
"private function before_custom_save()\n\t\t{\n\t\t\t$fields = self::$db->table_info($this->table_name);\n\t\t\tforeach($fields AS $field)\n\t\t\t{\n\t\t\t\tif(!strlen($this->$field['name'])) {\n\t\t\t\t\t$this->$field['name'] = 'NULL';\n\t\t\t\t}\n\t\t\t\tif(method_exists($this, 'preSave_'.$field['name'])) {\n\t\t\t\t\t$this->{'preSave_'.$field['name']}($field);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }",
"function EditRow() {\r\n\t\tglobal $conn, $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Con_SIM\r\n\t\t\t$this->Con_SIM->SetDbValueDef($rsnew, $this->Con_SIM->CurrentValue, NULL, $this->Con_SIM->ReadOnly);\r\n\r\n\t\t\t// Observaciones\r\n\t\t\t$this->Observaciones->SetDbValueDef($rsnew, $this->Observaciones->CurrentValue, NULL, $this->Observaciones->ReadOnly);\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}",
"protected function beforeUpdateResponse(Model &$data)\n {\n }"
] | [
"0.697865",
"0.69745725",
"0.6933497",
"0.6844641",
"0.66080767",
"0.66080767",
"0.6581803",
"0.6564867",
"0.64681506",
"0.6433775",
"0.6383628",
"0.636981",
"0.6303676",
"0.6300327",
"0.6290271",
"0.6286377",
"0.6281343",
"0.6266917",
"0.6252489",
"0.62400335",
"0.6224616",
"0.61846733",
"0.61846733",
"0.61744165",
"0.6167494",
"0.6148705",
"0.6146968",
"0.613797",
"0.6135949",
"0.6130345",
"0.6117847",
"0.6117847",
"0.61162657",
"0.6104676",
"0.6095122",
"0.6077743",
"0.606817",
"0.606817",
"0.60678285",
"0.6064439",
"0.6062823",
"0.60541034",
"0.6016996",
"0.6014973",
"0.5997426",
"0.59970427",
"0.59970427",
"0.5983009",
"0.5961252",
"0.59591585",
"0.5957593",
"0.59409136",
"0.5931753",
"0.5919081",
"0.59165025",
"0.59144783",
"0.59131926",
"0.59131926",
"0.59069645",
"0.58708155",
"0.58571917",
"0.585331",
"0.5844309",
"0.5840352",
"0.582409",
"0.5821776",
"0.5811267",
"0.58074766",
"0.5801831",
"0.5782233",
"0.57748497",
"0.5772741",
"0.57690966",
"0.57448196",
"0.57245815",
"0.5717151",
"0.5714304",
"0.5712802",
"0.5709248",
"0.5707089",
"0.5698358",
"0.5688352",
"0.5688352",
"0.5687411",
"0.5685434",
"0.5684527",
"0.56792426",
"0.56716406",
"0.56716406",
"0.56662714",
"0.5660927",
"0.5650751",
"0.56417894",
"0.56295085",
"0.5609994",
"0.55987597",
"0.5596046",
"0.55920655",
"0.5582667",
"0.5576565",
"0.5574999"
] | 0.0 | -1 |
Allows postupdate logic to be applied to row. | public function _postUpdate()
{
$this->notifyObservers(__FUNCTION__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _postUpdate()\n\t{\n\t}",
"protected function performPostUpdateCallback()\n {\n // echo 'updated a record ...';\n return true;\n }",
"public function postUpdateCallback()\n {\n $this->performPostUpdateCallback();\n }",
"public function postUpdateCallback()\n {\n $this->performPostUpdateCallback();\n }",
"function prepare_update($rowindex) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->on_edit_callback != '') {\r\n $this->ds->{$colvar}[$rowindex] = eval($col->on_edit_callback);\r\n }\r\n }\r\n return True;\r\n }",
"protected function _postupdate($result) {\n }",
"protected function performUpdate() {}",
"protected function _postUpdate()\n {\n \tif($this->_old_currency_code != $this->currency_code) {\n \t\t$pins = new \\Pin\\Pin();\n \t\t$pins->update(array(\n \t\t\t'currency_code' => $this->currency_code\t\t\n \t\t), array(\n \t\t\t'user_id = ?' => $this->user,\n \t\t\t'currency_code IS NOT NULL' => true\n \t\t));\n \t}\n }",
"protected function _postSave()\r\n\t{\r\n\t}",
"protected function _postUpdate()\n\t{\n\t\t$pinTable = new \\Pin\\Pin();\n\t\t$wishlistTable = new \\Wishlist\\Wishlist();\n\t\t$userTable = new \\User\\User();\n\t\t$pinLikeTable = new \\Pin\\PinLike();\n\n\t\tif(array_key_exists('status', $this->_modifiedFields)) {\n\t\t\t//wishlist status change\n\t\t\t$wishlistTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t//pin status change\n\t\t\t$pinTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t//pin like status change\n\t\t\t$pinLikeTable = new \\Pin\\PinLike();\n\t\t\t$pinLikeTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t$userTable->update(array(\n\t\t\t\t\t'likes' => new \\Core\\Db\\Expr('('.$pinLikeTable->select()->from($pinLikeTable,'count(1)')->where('pin_like.user_id = user.id AND pin_like.status = 1').')')\n\t\t\t), array('status = ?' => 1));\n\t\t\t//follow\n\t\t\t$followWishlistTable = new \\Wishlist\\WishlistFollow();\n\t\t\t$followIgnoreWishlistTable = new \\Wishlist\\WishlistFollowIgnore();\n\t\t\t$followUserTable = new \\User\\UserFollow();\n\t\t\t$followWishlistTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t\t$followIgnoreWishlistTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t\t$followUserTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t}\n\t\t\n\t\tif(array_key_exists('public', $this->_modifiedFields)) {\n\t\t\t$wishlistTable->update(array('public'=>$this->public), array('user_id = ?' => $this->id));\n\t\t\t$pinTable->update(array('public'=>$this->public), array('user_id = ?' => $this->id));\n\t\t\t$pinLikeTable = new \\Pin\\PinLike();\n\t\t\t$pinLikeTable->update(array('status'=>3), array('user_id = ?' => $this->id));\n\t\t\t$userTable->update(array(\n\t\t\t\t\t'likes' => new \\Core\\Db\\Expr('('.$pinLikeTable->select()->from($pinLikeTable,'count(1)')->where('pin_like.user_id = user.id AND pin_like.status = 1').')')\n\t\t\t), array('status = ?' => 1));\n\t\t}\n\n\t\t$userTable->updateInfo($this->id);\n\t\t\n\t\t\\Base\\Event::trigger('user.update',$this->id);\n\n\t}",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"protected function afterUpdating()\n {\n }",
"function afterUpdate($post_array, $primary_key='0'){\n // $identificador=$primary_key;\n // while(strlen($identificador)<4) $identificador=\"0\".$identificador;\n // $id=$post_array['id_grupo'];\n // $texto_grupo=$this->db->query(\"SELECT texto_grupo FROM c_grupos WHERE id='$id'\")->row()->texto_grupo;\n // $descripcion=$identificador.'-'.$post_array['nombre_actividad'];\n // if($texto_grupo) $descripcion.='-'.$texto_grupo;\n // $this->db->query(\"UPDATE c_actividades_infantiles SET descripcion='$descripcion' WHERE id='$primary_key'\");\n }",
"abstract protected function updateSpecificProperties($row);",
"protected function afterUpdate()\n {\n }",
"protected function afterUpdate()\n {\n }",
"protected function afterUpdate() {\n\t}",
"public function postUpdate($entity);",
"public function updateRow($row);",
"public function onAfterSaveProperty($namespace, $row, $is_new)\n {\n // You can use this method to do a post-treatment (notification email ...)\n }",
"protected function postUpdateHook($object) { }",
"protected function saveUpdate()\n {\n }",
"protected function _postSave()\n\t{\n\t\t$templateTitles = array($this->get('template_title'), $this->getExisting('template_title'));\n\t\t$styleIds = $this->_getStyleModel()->getAllChildStyleIds($this->get('style_id'));\n\t\t$styleIds[] = $this->get('style_id');\n\n\t\t$db = $this->_db;\n\t\t$db->update(\n\t\t\t'xf_template_map',\n\t\t\tarray('template_final' => null, 'template_modifications' => null),\n\t\t\t'style_id IN (' . $db->quote($styleIds) . ') AND title IN (' . $db->quote($templateTitles) . ')'\n\t\t);\n\t}",
"protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }",
"public function product_update_post()\n\t\t\t\t{\n\t\t\t\t}",
"function after_validation_on_update() {}",
"protected function getUpdateAfterFunction()\n {\n \n }",
"private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }",
"function wp_plugin_update_rows()\n {\n }",
"public function post_Table_data(){\n\t\t$this->load->model('teach_func/auto_save_tbl', 'this_model');\n\n\t\t$Q = $this->this_model->auto_update();\n\t\t\n\t\tif ($Q) {\n\t\t\t\n\t\t\techo \"Student_grade_updated! :)\";\n\t\t}\n\n\t}",
"public function afterUpdate()\n {\n //only clean and change custom fields if they have been set\n if (!empty($this->customFields)) {\n $this->deleteAllCustomFields();\n $this->saveCustomFields();\n }\n }",
"public function AfterUpdateRecord()\n\t{\n\t\tforeach($this->arrTranslations as $key => $val){\n\t\t\t$sql = 'UPDATE '.TABLE_BANNERS_DESCRIPTION.'\n\t\t\t\t\tSET image_text = \\''.encode_text(prepare_input($val['image_text'])).'\\'\n\t\t\t\t\tWHERE banner_id = '.$this->curRecordId.' AND language_id = \\''.encode_text($key).'\\'';\n\t\t\tdatabase_void_query($sql);\n\t\t}\n\t}",
"public function prepareSave($row, $postData)\n { if ($this->getSave() === false || $this->getInternalSave() === false) return;\n\n $new = $this->_getIdsFromPostData($postData);\n\n// $avaliableKeys = array(6,20,17);\n //foreach ($this->_getFields() as $field) {\n// $avaliableKeys[] = $field->getKey();\n// }\n\n $relModel = $row->getModel()->getDependentModel($this->getRelModel());\n $ref = $relModel->getReference($this->getRelationToValuesRule());\n $valueKey = $ref['column'];\n\n $s = $this->getChildRowsSelect();\n if (!$s) $s = array();\n foreach ($row->getChildRows($this->getRelModel(), $s) as $savedRow) {\n $id = $savedRow->$valueKey;\n if (true || in_array($id, $avaliableKeys)) {\n if (!in_array($id, $new)) {\n $savedRow->delete();\n } else {\n unset($new[array_search($id, $new)]);\n }\n }\n }\n\n foreach ($new as $id) {\n if (true || in_array($id, $avaliableKeys)) {\n $i = $row->createChildRow($this->getRelModel());\n $i->$valueKey = $id;\n }\n }\n\n }",
"protected function postUpdateMeta()\n {\n $sql = sprintf(\"\n UPDATE\n %sfaqattachment\n SET virtual_hash = '%s',\n mime_type = '%s'\n WHERE id = %d\",\n PMF_Db::getTablePrefix(),\n $this->virtualHash,\n $this->readMimeType(),\n $this->id\n );\n\n $this->db->query($sql);\n }",
"public function after_update() {}",
"protected function _update()\n\t{\n\t}",
"protected function updateRow()\n { \n $tableName = $this->getTableName($this->className);\n $assignedValues = $this->getAssignedValues();\n $updateDetails = [];\n\n for ($i = 0; $i < count($assignedValues['columns']); $i++) { \n array_push($updateDetails, $assignedValues['columns'][$i] .' =\\''. $assignedValues['values'][$i].'\\'');\n }\n\n $connection = Connection::connect();\n\n $allUpdates = implode(', ' , $updateDetails);\n $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);\n \n if ($update->execute()) { \n return 'Row updated';\n } else { \n throw new Exception(\"Unable to update row\"); \n }\n }",
"public function postSave()\n {\n // check if the model already exists\n if ((!isset($this->revisionEnabled) || $this->revisionEnabled)) {\n // if it does, it means we're updating\n\n $changes_to_record = $this->changedRevisionableFields();\n\n $revisions = array();\n\n foreach ($changes_to_record as $key => $change) {\n\n $revisions[] = array(\n 'revisionable_type' => get_class($this),\n 'revisionable_id' => $this->getKey(),\n 'key' => $key,\n 'old_value' => array_get($this->originalData, $key),\n 'new_value' => $this->updatedData[$key],\n 'user_id' => $this->getSystemUserId(),\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime(),\n 'activity_id' => $this->getActivityId()\n );\n }\n\n if (count($revisions) > 0) {\n $revision = new Revision();\n \\DB::table($revision->getTable())->insert($revisions);\n }\n\n }\n\n }",
"protected function beforeUpdating()\n {\n }",
"public function save(){\n\t\t$res = true;\n\t\t$changedData = $this->changedData();\n\t\tif(count($changedData)){\n\t\t\tif(!empty($this->orig)){\n\t\t\t\t$res = (dbHelper::updateQry($this->tableName,$changedData,array($this->primaryKey=>$this->data[$this->primaryKey]))?true:false);\n\t\t\t\t$this->orig = $this->data;\n\t\t\t} else {\n\t\t\t\t//if this row has been deleted but someone else saves data to it this will automatically restore the row from $data\n\t\t\t\t$res = (dbHelper::insertQry($this->tableName,$this->data)?true:false);\n\t\t\t\t$this->data[$this->primaryKey] = db::insertID();\n\t\t\t\tdbData::addRow($this->tableName,$this->primaryKey,$this->data);\n\t\t\t\t$this->orig =& dbData::rowRefrence($this->tableName,$this->primaryKey,$this->data[$this->primaryKey]);\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}",
"function before_validation_on_update() {}",
"public function db_update() {}",
"protected function _postInsert()\n\t{\n\t}",
"protected function postSave() {\n\t\treturn true;\n\t}",
"protected function relationFieldUpdateExit(){\n return true;\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }",
"protected function _update()\n {\n \n }",
"protected function _update()\n {\n \n }",
"public function doUpdate() {\n\t\ttry {\n\t\t\tcall_user_func_array( $this->doUpdateFunction, $this->arguments );\n\t\t} catch ( Exception $ex ) {\n\t\t\t$this->exceptionHandler->handleException( $ex, 'data-update-failed',\n\t\t\t\t'A data update callback triggered an exception' );\n\t\t}\n\t}",
"protected function callAfterEditEvent()\n\t{\n\t\tif( !$this->eventsObject->exists(\"AfterEdit\") )\n\t\t\treturn;\n\n\t\t$this->eventsObject->AfterEdit( $this->newRecordData,\n\t\t\t$this->getWhereClause( false ),\n\t\t\t$this->getOldRecordData(),\n\t\t\t$this->keys,\n\t\t\t$this->mode == EDIT_INLINE,\n\t\t\t$this );\n\t}",
"public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$date=$values['bill_date'];\n$amount=$values['amount'];\n$item=$values['item'];\n$bill_no=$values['bill_no'];\n\n\n$sql_update=\"UPDATE student_billing SET \nitem='$item',amount='$amount',amount_balance='$amount',\ndate='$date',\nbill_no='$bill_no'\nWHERE proid='$proid'\";\ndb_exec($sql_update,$conn);\n\n;\t\t\n}",
"public function afterSave()\n {\n if ($this->post === null) {\n return;\n }\n $relation = $this->owner->getRelation($this->attribute);\n /** @var ActiveQuery $via */\n $via = is_array($relation->via) ? $relation->via[1] : $relation->via;\n /** @var \\yii\\db\\ActiveRecord $viaClass */\n $viaTable = explode(' ', reset($via->from))[0];\n $link = $relation->link;\n $condition = [];\n foreach ($via->link as $viaAttribute => $ownerAttribute) {\n $condition[$viaAttribute] = $this->owner->$ownerAttribute;\n }\n $newIds = array_unique(array_filter($this->post, function($v){return !empty($v);}));\n $oldIds = $relation->select(array_keys($link))->column();\n \\Yii::$app->db->createCommand()->delete($viaTable,\n array_merge($condition, [reset($link) => array_diff($oldIds, $newIds)])\n )->execute();\n \\Yii::$app->db->createCommand()->batchInsert($viaTable, array_keys($condition)+$link, array_map(function ($id) use ($condition) {\n return array_merge($condition, [$id]);\n }, array_diff($newIds, $oldIds)))->execute();\n if ($this->callback) {\n call_user_func($this->callback, array_diff($newIds, $oldIds), array_diff($oldIds, $newIds));\n }\n }",
"public function onUpdateField()\n {\n //TODO Validate input\n\n $post = post();\n\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::updateField(\n $post['name'],\n $post['code'],\n $post['description'],\n $post['type'],\n $validation,\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }",
"protected function beforeUpdate()\n {\n }",
"function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\t$res = parent::exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_UPDATEquery_postProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn $res;\n\t}",
"function wp_theme_update_rows()\n {\n }",
"protected static function afterGetFromDB(&$row){}",
"public function afterUpdate(&$id, \\stdClass $data, Entity $entity) { }",
"protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }",
"function after_update() {}",
"function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// model_id\n\t\t\t$this->model_id->SetDbValueDef($rsnew, $this->model_id->CurrentValue, 0, $this->model_id->ReadOnly);\n\n\t\t\t// title\n\t\t\t$this->title->SetDbValueDef($rsnew, $this->title->CurrentValue, NULL, $this->title->ReadOnly);\n\n\t\t\t// description\n\t\t\t$this->description->SetDbValueDef($rsnew, $this->description->CurrentValue, NULL, $this->description->ReadOnly);\n\n\t\t\t// s_order\n\t\t\t$this->s_order->SetDbValueDef($rsnew, $this->s_order->CurrentValue, 0, $this->s_order->ReadOnly);\n\n\t\t\t// status\n\t\t\t$this->status->SetDbValueDef($rsnew, $this->status->CurrentValue, 0, $this->status->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}",
"function before_update_processor($row, $postData) {\r\n\tunset($postData['vupb_nama']);\r\n\tunset($postData['vgenerik']);\r\n\t\r\n\t//print_r($postData);exit();\r\n\treturn $postData;\r\n\r\n}",
"public function prepareSave($row, $postData)\n {\n }",
"protected function runExtTablesPostProcessingHooks() {}",
"public function postSave() {}",
"public function processUpdate()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter updateModifyValidationRules\n $validationRules = $this->doFilter(\"updateModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter updateModifyValidationMessages\n $validationMessages = $this->doFilter(\"updateModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set initial configuration\n $Model->build($this->Model->getTable());\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter updateModifyRequest\n $this->Model = clone $Model;\n $parameters = $this->doFilter(\"updateModifyRequest\", $requestParameters);\n // Update record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($Model, $parameters) {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n });\n } else {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.update.success'));\n // Hook Filter updateModifyResponse\n $Response = $this->doFilter(\"updateModifyResponse\", $Response);\n $this->redirect($Response);\n }",
"function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\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\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\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} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}",
"protected function hook_afterSave(){}",
"public function commitUpdate();",
"public function timestampFieldIsUpdatedOnPostSave() {}",
"protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }",
"protected function update() {}",
"function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}",
"public function postHydrate(): void\n {\n if ('invalid' === $this->value) {\n $this->value = 'valid';\n }\n }",
"public function postUpdate($id)\n\t{\n\t\t//\n\t}",
"public function postUpdate(LifecycleEventArgs $args): void {\n\t\tif(!$this->enableIndexing) return;\n\t\t$this->updateEntity($args->getObject(), $args->getObjectManager());\n\t}",
"public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}",
"public static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }",
"public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }",
"public function _onEdit(&$row, $old_row)\n {\n $row[$this->edited_field] = TIP::formatDate('datetime_sql');\n $row[$this->editor_field] = TIP::getUserId();\n isset($this->edits_field) &&\n array_key_exists($this->edits_field, $row) &&\n ++ $row[$this->edits_field];\n\n $engine = &$this->data->getProperty('engine');\n if (!$engine->startTransaction()) {\n // This error must be caught here to avoid the rollback\n return false;\n }\n\n // Process the row\n $done = $this->data->updateRow($row, $old_row) &&\n $this->_onDbAction('Edit', $row, $old_row);\n $done = $engine->endTransaction($done) && $done;\n\n return $done;\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }",
"public function postCommitHook($status, $table, $id, $record, $oldRecord, $pObj);",
"public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }",
"public function postUpdate(Model $model, $entry) {\n $modelName = $model->getName();\n $id = $entry->getId();\n\n if (isset($this->preUpdateFields[$modelName][$id])) {\n $preUpdateFields = $this->preUpdateFields[$modelName][$id];\n\n unset($this->preUpdateFields[$modelName][$id]);\n if (!$this->preUpdateFields[$modelName]) {\n unset($this->preUpdateFields[$modelName]);\n }\n if (!$this->preUpdateFields) {\n unset($this->preUpdateFields);\n }\n } else {\n $preUpdateFields = null;\n }\n\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logUpdate($model, $entry, $preUpdateFields);\n }",
"public function changeRowData(&$row){}",
"private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }",
"public function postUpdate(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }",
"function _update($entity)\n {\n $key = $this->object->get_primary_key_column();\n return $this->object->_wpdb()->update($this->object->get_table_name(), $this->object->_convert_to_table_data($entity), array($key => $entity->{$key}));\n }",
"function EditRow() {\r\n\t\tglobal $conn, $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Con_SIM\r\n\t\t\t$this->Con_SIM->SetDbValueDef($rsnew, $this->Con_SIM->CurrentValue, NULL, $this->Con_SIM->ReadOnly);\r\n\r\n\t\t\t// Observaciones\r\n\t\t\t$this->Observaciones->SetDbValueDef($rsnew, $this->Observaciones->CurrentValue, NULL, $this->Observaciones->ReadOnly);\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}",
"public function onAfterDelete()\n {\n if (!$this->owner->ID) {\n return;\n }\n\n // Force SearchUpdater to mark this record as dirty\n // Note: Some extensions require entire hierarchy passed to augmentWrite()\n $manipulation = array();\n foreach (ClassInfo::ancestry($this->owner) as $class) {\n if (!is_subclass_of($class, DataObject::class)) {\n continue;\n }\n\n $tableName = DataObject::getSchema()->tableName($class);\n $manipulation[$tableName] = array(\n 'fields' => array(),\n 'id' => $this->owner->ID,\n 'class' => $class,\n // Note: 'delete' command not actually handled by manipulations,\n // but added so that SearchUpdater can detect the deletion\n 'command' => 'delete'\n );\n }\n\n $this->owner->extend('augmentWrite', $manipulation);\n\n SearchUpdater::handle_manipulation($manipulation);\n }",
"function validate_on_update() {}",
"protected function afterUpdate(array &$data, CrudModel $model)\n {\n return true;\n }",
"protected function useDynamicUpdate($dynamicUpdate) {}",
"protected function _afterSave()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterSave();\r\n }",
"protected function _updatefields() {}",
"public function postUpdate(){\n\t\t\t\n\t\tDB::table('room_price_calenders')\n\t\t\t->where('room_type_id','=',Input::get('roomType'))\n\t\t\t->where('service_id','=',Input::get('service'))\n\t\t\t->where('end_date','=', Input::get('to'))\n\t\t\t->update(['price'=>Input::get('price'),\n\t\t\t\t\t\t'discount_rate'=>Input::get('discount')]);\n\n\t\tSession::forget('calendar_id');\n\t\treturn 1;\t\t\t\n\t\t\n\t}",
"public function postProcess()\n {\n $pageId = Tools::getValue('id_page');\n if (Tools::isSubmit('submitEditCustomHTMLPage') || Tools::isSubmit('submitEditCustomHTMLPageAndStay')) {\n if ($pageId == 'new')\n $this->processAdd();\n else\n $this->processUpdate();\n }\n else if (Tools::isSubmit('status'.$this->table)) {\n $this->toggleStatus();\n }\n else if (Tools::isSubmit('delete'.$this->table)) {\n $this->processDelete();\n }\n }",
"public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }"
] | [
"0.764369",
"0.7096226",
"0.6803936",
"0.6803936",
"0.65842867",
"0.65068346",
"0.6397124",
"0.63328993",
"0.62986314",
"0.6209134",
"0.61819917",
"0.6180393",
"0.6168594",
"0.6160694",
"0.61061835",
"0.61061835",
"0.6101452",
"0.6099421",
"0.60917586",
"0.60811603",
"0.60285974",
"0.6025205",
"0.60240275",
"0.6023065",
"0.60227066",
"0.6021095",
"0.60078275",
"0.60074747",
"0.5975102",
"0.5941261",
"0.59330297",
"0.5929726",
"0.59280443",
"0.5912867",
"0.59066796",
"0.5865787",
"0.58606255",
"0.5834375",
"0.5827052",
"0.5818752",
"0.5810408",
"0.57764506",
"0.5768826",
"0.5759686",
"0.57589155",
"0.575062",
"0.575062",
"0.57475185",
"0.57475185",
"0.57444686",
"0.5731086",
"0.5717286",
"0.57100713",
"0.5708232",
"0.570415",
"0.5691043",
"0.56880766",
"0.56870514",
"0.5673163",
"0.56670064",
"0.5654839",
"0.5654062",
"0.5651991",
"0.5650304",
"0.5636256",
"0.5628499",
"0.5613271",
"0.5611838",
"0.5608362",
"0.5606742",
"0.56066525",
"0.56003004",
"0.5596096",
"0.55894065",
"0.55877894",
"0.55866724",
"0.5583341",
"0.557978",
"0.5566047",
"0.5563613",
"0.55450284",
"0.5542135",
"0.55376095",
"0.55366474",
"0.5530775",
"0.5527258",
"0.5525576",
"0.55239564",
"0.5513143",
"0.5505406",
"0.55038095",
"0.5497312",
"0.5490927",
"0.5486065",
"0.5470116",
"0.5469569",
"0.5468535",
"0.54548955",
"0.5450252",
"0.54480785"
] | 0.5743428 | 50 |
Allow predelete logic to be applied to row | public function _delete()
{
$this->notifyObservers(__FUNCTION__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _predelete() {\n }",
"protected function _preDelete() {}",
"public function preDelete() { }",
"function preDelete()\n {\n }",
"protected function preDelete() {\n\t\treturn true;\n\t}",
"public function onBeforeDelete();",
"function beforeDelete() {\n\t\t\treturn $this->_deletable($this->_Model->id);\n\t\t}",
"public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}",
"protected function beforeDelete()\n {\n }",
"protected function beforeDelete()\n { \n return parent::beforeDelete();\n }",
"function check_del($rowindex) {\r\n /* called on row delete validation */\r\n return True;\r\n }",
"function callbackRowDelete() {\n $this->deleted = true;\n foreach(array_keys($this->widgets) as $w) {\n $this->widgets[$w]->hide();\n $this->table->table->remove($this->widgets[$w]);\n $this->widgets[$w]->destroy();\n }\n $this->deleteMenuItem->hide();\n \n $this->table->deleteMenu->remove($this->deleteMenuItem);\n $this->deleteMenuItem->destroy();\n $this->table->frame->hide();\n $this->table->frame->show();\n }",
"protected function getDeleteBeforeFunction()\n {\n \n }",
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"function before_delete() {}",
"protected function preDelete( ModelInterface &$model ) {\n }",
"function undelete() {\n\t\t$query = \"UPDATE \".$this->table.\" SET \".$this->deleted_field.\" = '0'\".$this->where_this();\n\n\t\t$this->db->query($query);\n\n\t}",
"public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}",
"public function deleteRow($row);",
"public function beforeDelete() {\n\t\tif (parent::beforeDelete() && $this->hasAttribute('status')) {\n\t\t\t$this->status = self::STATUS_DELETED;\n\t\t\t$this->save(false);\n\t\t\treturn false; // Prevent actual DELETE query from being run\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function pre_delete()\r\n\t{\r\n\t\tparent::pre_delete();\r\n\t\t$Change = App::make('Change');\r\n\t\t$Change::where('fmodel', 'GalleryItem')\r\n\t\t\t ->where('fid', $this->id)\r\n\t\t\t ->delete();\r\n\t\t\t \r\n\t\t// Thumbs\r\n\t\t/*if($this->file) {\r\n\t\t\t# Should really check if these are used anywhere else, but no easy way to do that in other modules yet so just leaving them for now\r\n\t\t\t\r\n\t\t\t// Name\r\n\t\t\t$name = basename(public_path().$this->file);\r\n\t\t\t\r\n\t\t\t// Thumbs\r\n\t\t\t$thumbs = Config::get('galleries::thumbs');\r\n\t\t\tforeach($thumbs as $k => $v) {\r\n\t\t\t\tif(file_exists(public_path().$v['path'].$name)) unlink(public_path().$v['path'].$name);\r\n\t\t\t}\r\n\t\t}*/\r\n\t}",
"function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }",
"public function beforeDelete(): void\n {\n switch ($this->deletionType) {\n case self::DELETION_TYPE_1:\n $this->deletionType1();\n break;\n case self::DELETION_TYPE_0:\n default:\n $this->deletionType0();\n break;\n }\n }",
"function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}",
"protected function _postDelete()\n\t{\n\t}",
"public static function deleteData($row){\n\n\t\t$result = DB::delete($row['table'])->where('id', $row['id'])->execute();\n\t\treturn 1;\n\n\t}",
"public function beforeDelete()\r\n\t{\r\n\t\tself::deleteByParentId($this->id);\r\n\r\n\t\treturn TRUE;\r\n\t}",
"protected function MetaBeforeDelete() {\n\t\t\treturn SERIA_Meta::allowDelete($this);\n\t\t}",
"public function before_delete($primary_key)\n{\n \t$band= $this->equipos_model->verificar_equipos($primary_key);\n \tif ($band)\n \t{\n\t\treturn false;\n\t}\t\n \t$band= $this->entregas_model->verificar_entregas3($primary_key);\n \tif ($band)\n \t{\n\t\treturn false;\n\t}\t\t\n \t\n \n \n return true;\n}",
"function beforeDelete(&$model) {\n\t\textract($this->settings[$model->alias]);\n\t\t$this->reset($model, $model->field($parent));\n\t\treturn true;\n\t}",
"public function soft_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\t$this->data['deleted'] = 1;\n\t\t\treturn $this->save();\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }",
"public function disableDeleteClause() {}",
"public function hard_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\treturn $this->db\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->delete($this->table);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}",
"public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}",
"function preDelete($record)\n\t{\n\t\tif (is_numeric($record['id']) && $record['id']<=1999)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// return false if type is used\n\t\tif($this->checkFinanceTypeIsUsed($record['id']))\n\t\t{\n\t\t\t$this->display_error(atktext(\"feedback_delete_constrain_error\"));\n\t\t\tdie;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"function delete()\n {\n if ($this->GET('sure')) {\n $function = basename($this->table->tablename()) . \"_onRowDelete\";\n if (function_exists($function)) {\n $function($this->table->data($this->GET('id')), &$this->table);\n }\n\n $this->table->delete($this->GET('id'));\n $this->table->write();\n $this->browse();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete row \\'' . $this->GET('id') . '\\'?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . $this->GET('id') . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }",
"public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}",
"public function _onDelete(&$row, $old_row)\n {\n $engine = &$this->data->getProperty('engine');\n if (!$engine->startTransaction()) {\n // This error must be caught here to avoid the rollback\n return false;\n }\n\n // Process the row\n $done = $this->data->deleteRow($row) &&\n $this->_onDbAction('Delete', $row, $old_row);\n $done = $engine->endTransaction($done) && $done;\n\n return $done;\n }",
"function PersonalData_Deleted($row) {\n\n\t//echo \"PersonalData Deleted\";\n}",
"protected function beforeDelete()\n\t{\n\t\tif(parent::beforeDelete()){\n\t\t\t$avaiable = $this->chkAvaiableDelete($this->id);\n\t\t\tif($avaiable!=''){\n\t\t\t\techo $avaiable;\n\t\t\t\treturn false;\n\t\t\t}else\n\t\t\t\treturn true;\n\t\t}else \n\t\t\treturn false;\n\t}",
"function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['pegawai_id'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['tgl_shift'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['khusus_lembur'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['khusus_extra'];\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['temp_id_auto'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"protected function preDeleteHook($object) { }",
"function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }",
"public function deleteRowPrepare(RowInterface $row) : DeleteInterface\n {\n $this->events->beforeDelete($this, $row);\n\n $delete = $this->delete();\n foreach ($this->getPrimaryKey() as $primaryCol) {\n $delete->where(\"{$primaryCol} = ?\", $row->$primaryCol);\n }\n\n $this->events->modifyDelete($this, $row, $delete);\n return $delete;\n }",
"function DeleteRows() {\r\n\t\tglobal $conn, $Language, $Security, $rekeningju;\r\n\t\t$DeleteRows = TRUE;\r\n\t\t$sSql = $rekeningju->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\r\n\t\t\t$rs->Close();\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif (!$Security->CanDelete()) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Clone old rows\r\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\r\n\t\tif ($rs)\r\n\t\t\t$rs->Close();\r\n\r\n\t\t// Call row deleting event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$DeleteRows = $rekeningju->Row_Deleting($row);\r\n\t\t\t\tif (!$DeleteRows) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$sKey = \"\";\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$sThisKey = \"\";\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\r\n\t\t\t\t$sThisKey .= $row['kode_otomatis'];\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$DeleteRows = $conn->Execute($rekeningju->DeleteSQL($row)); // Delete\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($DeleteRows === FALSE)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\r\n\t\t\t\t$sKey .= $sThisKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// Set up error message\r\n\t\t\tif ($rekeningju->CancelMessage <> \"\") {\r\n\t\t\t\t$this->setFailureMessage($rekeningju->CancelMessage);\r\n\t\t\t\t$rekeningju->CancelMessage = \"\";\r\n\t\t\t} else {\r\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t} else {\r\n\t\t}\r\n\r\n\t\t// Call Row Deleted event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$rekeningju->Row_Deleted($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $DeleteRows;\r\n\t}",
"function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['Id_Item'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['Id_tercero'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"function row_delete()\n\t{\n\t $this->db->where('id', $id);\n\t $this->db->delete('testimonials'); \n\t}",
"function PersonalData_Deleted($row) {\r\n\r\n\t//echo \"PersonalData Deleted\";\r\n}",
"public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}",
"public function beforeDelete()\n {\n // Find the related custom value\n $customValues = CustomValueModel::where('product_id', '=', $this->id)->get();\n\n $customValues->each(function ($value) {\n // Delete relation\n $relation = DB::table('tiipiik_catalog_csf_csv')\n ->where('custom_value_id', '=', $value->id)\n ->delete();\n\n // Delete custom value\n CustomValueModel::find($value->id)->delete();\n });\n\n // Detach properties\n $this->properties()->detach();\n }",
"protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"public function hook_before_delete($id) {\n\t //Your code here\n\n\t }",
"public function hook_before_delete($id) {\n\t //Your code here\n\n\t }",
"public function hook_before_delete($id) {\n\t //Your code here\n\n\t }",
"function delete($primary){\n $this->primary=$primary;\n //\n //create the delete\n $update= new delete($this, $primary);\n //\n //Execute the the insert\n $update->query($this->entity->get_parent());\n }",
"protected function afterDelete()\r\n {\r\n }",
"function delete_row($selector, $i = 1, $post_id = \\false)\n{\n}",
"protected function MetaAfterDelete() {\n\t\t}",
"function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t}\n\t\tif (!$DeleteRows) {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"function DeleteRows() {\n\t\tglobal $Language, $Security;\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn = &$this->Connection();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['row_id'];\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t}\n\t\tif (!$DeleteRows) {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"public function supportsNativeDeleteTrigger();",
"public function afterDeleteCommit(): void\n {\n }",
"function OnBeforeDeleteItem(){\n }",
"public function onBeforeDelete()\n {\n // after deleting the code it's not validatable anymore, simply here for cleanup\n if ($this->TicketQRCode()->exists()) {\n $this->TicketQRCode()->delete();\n }\n\n parent::onBeforeDelete();\n }",
"public function action_delete_entry(): int {\n\t\treturn (int) ( new CRUD( $this->table->get_table_definition() ) )->delete_oldest_item();\n\t}",
"function DeleteRows() {\r\n\t\tglobal $conn, $Language, $Security;\r\n\t\t$DeleteRows = TRUE;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE) {\r\n\t\t\treturn FALSE;\r\n\t\t} elseif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\r\n\t\t\t$rs->Close();\r\n\t\t\treturn FALSE;\r\n\t\t} else {\r\n\t\t\t$this->LoadRowValues($rs); // Load row values\r\n\t\t}\r\n\t\tif (!$Security->CanDelete()) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t$conn->BeginTrans();\r\n\r\n\t\t// Clone old rows\r\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\r\n\t\tif ($rs)\r\n\t\t\t$rs->Close();\r\n\r\n\t\t// Call row deleting event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\r\n\t\t\t\tif (!$DeleteRows) break;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$sKey = \"\";\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$sThisKey = \"\";\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t\t\t$sThisKey .= $row['identries'];\r\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\r\n\t\t\t\t$sThisKey .= $row['id'];\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($DeleteRows === FALSE)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\r\n\t\t\t\t$sKey .= $sThisKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// Set up error message\r\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t// Use the message, do nothing\r\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t} else {\r\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($DeleteRows) {\r\n\t\t\t$conn->CommitTrans(); // Commit the changes\r\n\t\t} else {\r\n\t\t\t$conn->RollbackTrans(); // Rollback changes\r\n\t\t}\r\n\r\n\t\t// Call Row Deleted event\r\n\t\tif ($DeleteRows) {\r\n\t\t\tforeach ($rsold as $row) {\r\n\t\t\t\t$this->Row_Deleted($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $DeleteRows;\r\n\t}",
"protected function _delete()\n\t{\n\t}",
"protected function _beforeDelete()\n {\n $this->_protectFromNonAdmin();\n $this->cleanCache();\n\n return parent::_beforeDelete();\n }",
"public function prepareSave($row, $postData)\n { if ($this->getSave() === false || $this->getInternalSave() === false) return;\n\n $new = $this->_getIdsFromPostData($postData);\n\n// $avaliableKeys = array(6,20,17);\n //foreach ($this->_getFields() as $field) {\n// $avaliableKeys[] = $field->getKey();\n// }\n\n $relModel = $row->getModel()->getDependentModel($this->getRelModel());\n $ref = $relModel->getReference($this->getRelationToValuesRule());\n $valueKey = $ref['column'];\n\n $s = $this->getChildRowsSelect();\n if (!$s) $s = array();\n foreach ($row->getChildRows($this->getRelModel(), $s) as $savedRow) {\n $id = $savedRow->$valueKey;\n if (true || in_array($id, $avaliableKeys)) {\n if (!in_array($id, $new)) {\n $savedRow->delete();\n } else {\n unset($new[array_search($id, $new)]);\n }\n }\n }\n\n foreach ($new as $id) {\n if (true || in_array($id, $avaliableKeys)) {\n $i = $row->createChildRow($this->getRelModel());\n $i->$valueKey = $id;\n }\n }\n\n }",
"protected function onDeleting()\n {\n return true;\n }",
"protected function setDeleteData()\n\t{\n\n\t}",
"function BeforeDelete($where,&$deleted_values,&$message,&$pageObject)\n{\n\n\t\t\nglobal $conn;\n$bid=$deleted_values['bid'];\n\n\n$sql_at= \"SELECT sid FROM student_billing WHERE bid='$bid'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n\ndo{\n$sid=$row_at['sid'];\n$sql_del2 = \"DELETE FROM student_payment WHERE sid='$sid'\";\ndb_exec($sql_del2,$conn);\n}while($row_at=db_fetch_array($query_at));\n\n//2nd delete\n$sql_del=\"DELETE FROM student_billing WHERE bid=$bid\";\ndb_exec($sql_del,$conn);\n\n\nreturn true;\n;\t\t\n}",
"public function delete_invoice_row() {\n\n $deleteFlag = false;\n\n // Count the entries and rows from the invoice\n $count = $this->mockinvoice_model->count_invoice_entries( $_POST[ 'mockInvoiceId' ] );\n\n // Don't delete, but clear the data if it is the last one\n if ( $count[0]->invoiceRowCount == 1 ) {\n // Set null values\n $data = array(\n 'category' => null,\n 'description' => null,\n 'amount' => null\n );\n // Clear the data of the mock invoice row\n $this->mockinvoice_row_model->save( $data, $_POST[ 'mockInvoiceRowId' ] );\n\n // Else, more than 1 row so we delete\n } else {\n // Delete the mock invoice row\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceRowId', $_POST[ 'mockInvoiceRowId' ] );\n $deleteFlag = true;\n }\n\n\n // Send back how many rows there were and if 1 was deleted\n $returnArray[] = array( 'initialCount' => $count, 'rowDeleted' => $deleteFlag );\n $this->json_library->print_array_json_unless_empty( $returnArray );\n }",
"public function beforeDelete() {\n // Check foreign table treatment_schedules\n $treatmentSchedules = TreatmentSchedules::model()->findByAttributes(array('doctor_id' => $this->id));\n if (count($treatmentSchedules) > 0) {\n return false;\n }\n // Handle Agent relation\n OneMany::deleteAllManyOldRecords($this->id, OneMany::TYPE_AGENT_USER);\n // Handle Social network relation\n SocialNetworks::deleteAllOldRecord($this->id, SocialNetworks::TYPE_USER);\n\n return parent::beforeDelete();\n }",
"public function hook_before_delete($id) {\n\n }",
"function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }",
"function delete_sub_row($selector, $i = 1, $post_id = \\false)\n{\n}",
"protected function afterDelete()\n {\n }",
"public function onAfterDelete();",
"protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }",
"function DeleteRows() {\n\t\tglobal $conn, $Security, $patient_detail;\n\t\t$DeleteRows = TRUE;\n\t\t$sWrkFilter = $patient_detail->CurrentFilter;\n\n\t\t// Set up filter (Sql Where Clause) and get Return SQL\n\t\t// SQL constructor in patient_detail class, patient_detailinfo.php\n\n\t\t$patient_detail->CurrentFilter = $sWrkFilter;\n\t\t$sSql = $patient_detail->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setMessage(\"No records found\"); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\n\t\tif ($rs) $rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $patient_detail->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;\n\t\t\t\t$sThisKey .= $row['DetailNo'];\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$DeleteRows = $conn->Execute($patient_detail->DeleteSQL($row)); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($patient_detail->CancelMessage <> \"\") {\n\t\t\t\t$this->setMessage($patient_detail->CancelMessage);\n\t\t\t\t$patient_detail->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setMessage(\"Delete cancelled\");\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call recordset deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$patient_detail->Row_Deleted($row);\n\t\t\t}\t\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"public function predelete()\n\t{\n\t\t$no_error = true;\n\t\t$photos = $this->get_all_photos()->get();\n\t\tforeach ($photos as $photo) {\n\t\t\t$no_error &= $photo->predelete();\n\t\t\t$no_error &= $photo->delete();\n\t\t}\n\n\t\treturn $no_error;\n\t}",
"public function onDelete(){\n return false;\n }",
"function DeleteRows() {\n\t\tglobal $conn, $Language, $Security;\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\n\t\t//} else {\n\t\t//\t$this->LoadRowValues($rs); // Load row values\n\n\t\t}\n\t\t$rows = ($rs) ? $rs->GetRows() : array();\n\t\t$conn->BeginTrans();\n\n\t\t// Clone old rows\n\t\t$rsold = $rows;\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $this->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= $GLOBALS[\"EW_COMPOSITE_KEY_SEPARATOR\"];\n\t\t\t\t$sThisKey .= $row['idservicio_medico_prestado'];\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\t$DeleteRows = $this->Delete($row); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t// Use the message, do nothing\n\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$this->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"function del($fp_rowId)\n {\n foreach ((array)$fp_rowId as $k => $id) {\n $this->db->or_where('id', $id);\n }\n $this->db->from($this->table);\n $this->db->delete($this->table);\n //dump($this->db->last_query());\n return true;\n }",
"private function _delete()\n {\n if (!$this->isLoaded()) {\n return false;\n }\n\n $className = get_called_class();\n $db = self::getDb();\n $useValue = self::sModifyStr($this->getPrimaryValue(), 'formatToQuery');\n $db->query(\"delete from \" . self::structGet('tableName') . \" where \" . self::structGet('primaryKey') . \" = {$useValue}\",\n \"{$className}->_delete()\");\n if ($db->error()) {\n return false;\n }\n\n if (self::structGet('cbAuditing')) {\n $cbAuditing = self::structGet('cbAuditing');\n if (is_array($cbAuditing)) {\n call_user_func($cbAuditing, $this, $this->getPrimaryValue(), 'delete', false);\n } else {\n $cbAuditing($this, $this->getPrimaryValue(), 'delete', false);\n }\n }\n\n // Vamos processar eventListener:delete\n self::_handleEventListeners('delete', $this, $this->getPrimaryValue(), false);\n\n // Vamos marcar o objeto como !loaded\n $this->setLoaded(false);\n\n // Vamos processar eventListener:afterDelete\n self::_handleEventListeners('afterDelete', $this, $this->getPrimaryValue(), false);\n\n return true;\n }",
"public function process_bulk_action() {\n\n\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\tcase 'delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( 'on' !== $this->allow_delete ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepare wp_nonce action security check.\n\t\t\t\t\t$wp_nonce_action = \"wpda-delete-{$this->table_name}\";\n\n\t\t\t\t\t$row_to_be_deleted = []; // Gonna hold the row to be deleted.\n\t\t\t\t\t$i = 0; // Index, necessary for multi column keys.\n\n\t\t\t\t\t// Check all key columns.\n\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\tif ( ! isset( $_REQUEST[ $key ] ) ) { // input var okay.\n\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['key'] = $key;\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['value'] = sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t\t$i ++;\n\n\t\t\t\t\t\t// Add key values to wp_nonce action.\n\t\t\t\t\t\t$wp_nonce_action .= '-' . sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// All key column values available: delete record.\n\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t$next_row_to_be_deleted = [];\n\t\t\t\t\t$count_rows = count( $row_to_be_deleted );\n\t\t\t\t\tfor ( $i = 0; $i < $count_rows; $i ++ ) {\n\t\t\t\t\t\t$next_row_to_be_deleted[ $row_to_be_deleted[ $i ]['key'] ] = $row_to_be_deleted[ $i ]['value'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Row deleted', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Could not delete row', 'wp-data-access' ),\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( $this->allow_delete !== 'on' ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to delete.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to delete', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-delete-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce2'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce2'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be deleted.\n\n\t\t\t\t\t$rows_to_be_deleted = []; // Gonna hold rows to be deleted.\n\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t$j = 0; // Index used to build array.\n\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['key'] = $key;\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['value'] = $row_object[ $key ];\n\t\t\t\t\t\t\t\t$j ++;\n\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// Looks like eveything is there. Delete records from table...\n\t\t\t\t\t$no_key_cols = count( $this->wpda_list_columns->get_table_primary_key() );\n\t\t\t\t\t$rows_succesfully_deleted = 0; // Number of rows succesfully deleted.\n\t\t\t\t\t$rows_with_errors = 0; // Number of rows that could not be deleted.\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t\t$next_row_to_be_deleted = [];\n\n\t\t\t\t\t\t$row_found = true;\n\t\t\t\t\t\tfor ( $j = 0; $j < $no_key_cols; $j ++ ) {\n\t\t\t\t\t\t\tif ( isset( $rows_to_be_deleted[ $i ][ $j ]['key'] ) ) {\n\t\t\t\t\t\t\t\t$next_row_to_be_deleted[ $rows_to_be_deleted[ $i ][ $j ]['key'] ] = $rows_to_be_deleted[ $i ][ $j ]['value'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$row_found = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $row_found ) {\n\t\t\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t\t\t// Row(s) succesfully deleted.\n\t\t\t\t\t\t\t\t$rows_succesfully_deleted ++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Inform user about the results of the operation.\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( 1 === $rows_succesfully_deleted ) {\n\t\t\t\t\t\t$message = __( 'Row deleted', 'wp-data-access' );\n\t\t\t\t\t} elseif ( $rows_succesfully_deleted > 1 ) {\n\t\t\t\t\t\t$message = \"$rows_succesfully_deleted \" . __( 'rows deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( $rows_with_errors > 0 ) {\n\t\t\t\t\t\t$message = __( 'Not all rows have been deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-export':\n\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\tcase 'bulk-export-json':\n\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( ! WPDA::is_wpda_table( $this->table_name ) ) {\n\t\t\t\t\t\tif ( 'on' !== WPDA::get_option( WPDA::OPTION_BE_EXPORT_ROWS ) ) {\n\t\t\t\t\t\t\t// Exporting rows from list table is not allowed.\n\t\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [export not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to export.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to export', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if export is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-export-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be exported.\n\n\t\t\t\t\t$format_type = '';\n\t\t\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\t\t\t\t$format_type = 'xml';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-json':\n\t\t\t\t\t\t\t$format_type = 'json';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\t\t\t\t$format_type = 'excel';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t\t\t$format_type = 'csv';\n\t\t\t\t\t}\n\n\t\t\t\t\t$querystring = '';\n\t\t\t\t\tif ( ! is_admin() ) {\n\t\t\t\t\t\t// Add admin path for public access\n\t\t\t\t\t\t$querystring = admin_url() . 'admin.php';\n\t\t\t\t\t}\n\t\t\t\t\t$querystring .= \"?action=wpda_export&type=row&mysql_set=off&show_create=off&show_comments=off&schema_name={$this->schema_name}&table_names={$this->table_name}&_wpnonce=$wp_nonce&format_type=$format_type\";\n\n\t\t\t\t\t$j = 0;\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$querystring .= \"&{$key}[{$j}]=\" . urlencode( $row_object[ $key ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$j ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Export rows.\n\t\t\t\t\techo '\n\t\t\t\t\t\t<script type=\\'text/javascript\\'>\n\t\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\t\tjQuery(\"#stealth_mode\").attr(\"src\",\"' . $querystring . '\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>\n\t\t\t\t\t';\n\t\t\t}\n\n\t\t}",
"function remove_rows($table_id, $data) {\n\t$cmsEditDel = new cmsEditDel($table_id, $data);\n\t$delete_id = $cmsEditDel->dbChange();\n\tunset($cmsEditDel);\n\t\n\tif (empty($delete_id)) return;\n\t\n\t$child = getChildTables($table_id);\n\treset($child);\n\twhile (list($table_id, $field_name) = each($child)) {\n\t\tremove_rows($table_id, array($field_name => $delete_id));\n\t}\n\t\n}",
"public function deleteRowByPrimaryKey()\n {\n if ($this->getTipoId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'tipoId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getTipoId())\n );\n }",
"public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }",
"public function beforeDelete(){\n $files = $this->getFiles()->all();\n foreach($files as $file)\n $file->delete();\n\n return parent::beforeDelete();\n }",
"protected function getDeleteAfterFunction()\n {\n \n }",
"function DeleteRows() {\n\t\tglobal $conn, $Language, $Security, $tbl_profile;\n\t\t$DeleteRows = TRUE;\n\t\t$sSql = $tbl_profile->SQL();\n\t\t$conn->raiseErrorFn = 'up_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE) {\n\t\t\treturn FALSE;\n\t\t} elseif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // No record found\n\t\t\t$rs->Close();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (!$Security->CanDelete()) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoDeletePermission\")); // No delete permission\n\t\t\treturn FALSE;\n\t\t}\n\t\t$conn->BeginTrans();\n\t\t$this->WriteAuditTrailDummy($Language->Phrase(\"BatchDeleteBegin\")); // Batch delete begin\n\n\t\t// Clone old rows\n\t\t$rsold = ($rs) ? $rs->GetRows() : array();\n\t\tif ($rs)\n\t\t\t$rs->Close();\n\n\t\t// Call row deleting event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$DeleteRows = $tbl_profile->Row_Deleting($row);\n\t\t\t\tif (!$DeleteRows) break;\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$sKey = \"\";\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$sThisKey = \"\";\n\t\t\t\tif ($sThisKey <> \"\") $sThisKey .= UP_COMPOSITE_KEY_SEPARATOR;\n\t\t\t\t$sThisKey .= $row['facultyprofile_ID'];\n\t\t\t\t$conn->raiseErrorFn = 'up_ErrorFn';\n\t\t\t\t$DeleteRows = $conn->Execute($tbl_profile->DeleteSQL($row)); // Delete\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($DeleteRows === FALSE)\n\t\t\t\t\tbreak;\n\t\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t\t$sKey .= $sThisKey;\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Set up error message\n\t\t\tif ($tbl_profile->CancelMessage <> \"\") {\n\t\t\t\t$this->setFailureMessage($tbl_profile->CancelMessage);\n\t\t\t\t$tbl_profile->CancelMessage = \"\";\n\t\t\t} else {\n\t\t\t\t$this->setFailureMessage($Language->Phrase(\"DeleteCancelled\"));\n\t\t\t}\n\t\t}\n\t\tif ($DeleteRows) {\n\t\t\t$conn->CommitTrans(); // Commit the changes\n\t\t\tif ($DeleteRows) {\n\t\t\t\tforeach ($rsold as $row)\n\t\t\t\t\t$this->WriteAuditTrailOnDelete($row);\n\t\t\t}\n\t\t\t$this->WriteAuditTrailDummy($Language->Phrase(\"BatchDeleteSuccess\")); // Batch delete success\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback changes\n\t\t\t$this->WriteAuditTrailDummy($Language->Phrase(\"BatchDeleteRollback\")); // Batch delete rollback\n\t\t}\n\n\t\t// Call Row Deleted event\n\t\tif ($DeleteRows) {\n\t\t\tforeach ($rsold as $row) {\n\t\t\t\t$tbl_profile->Row_Deleted($row);\n\t\t\t}\n\t\t}\n\t\treturn $DeleteRows;\n\t}",
"public final function delete() {\n\t\t$sql = \"\n\tDELETE FROM\n\t\t\" . $this->table . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute(array($this->{$this->primaryField}));\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}",
"public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }",
"public function eliminarPreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->idCliente);\n return Database::executeRow($sql, $params);\n }"
] | [
"0.76999533",
"0.7658419",
"0.74922657",
"0.7345435",
"0.7160098",
"0.68156314",
"0.6791743",
"0.675912",
"0.6709964",
"0.6648998",
"0.6620292",
"0.66029984",
"0.65252066",
"0.6511829",
"0.651074",
"0.6503655",
"0.6390102",
"0.6367624",
"0.6354036",
"0.6325667",
"0.62965757",
"0.6269623",
"0.62695813",
"0.6244986",
"0.623826",
"0.6236388",
"0.620146",
"0.6166282",
"0.61660725",
"0.61519444",
"0.6127162",
"0.61157477",
"0.6102349",
"0.6084118",
"0.608374",
"0.6074054",
"0.60438645",
"0.60370696",
"0.60158414",
"0.59862626",
"0.5981031",
"0.59798187",
"0.59779984",
"0.59710115",
"0.5965792",
"0.59468895",
"0.59277844",
"0.5919477",
"0.5908252",
"0.5905613",
"0.5903891",
"0.59005845",
"0.5897401",
"0.5895213",
"0.58901906",
"0.58870983",
"0.5884118",
"0.5884118",
"0.5884118",
"0.58805513",
"0.587849",
"0.5873965",
"0.58677214",
"0.58631307",
"0.5856849",
"0.58549523",
"0.5843118",
"0.5826117",
"0.5817174",
"0.5813008",
"0.5811165",
"0.5803135",
"0.5800973",
"0.5796662",
"0.57964534",
"0.5792106",
"0.57916236",
"0.5788649",
"0.5784418",
"0.57817864",
"0.577755",
"0.5771928",
"0.5769045",
"0.5754732",
"0.5741975",
"0.5741043",
"0.57401145",
"0.57317924",
"0.57311034",
"0.57294655",
"0.5727254",
"0.5708054",
"0.5707693",
"0.57051796",
"0.5705117",
"0.57043254",
"0.5697081",
"0.5690383",
"0.5661864",
"0.5653418",
"0.5652798"
] | 0.0 | -1 |
Allows postdelete logic to be applied to row. | public function _postDelete()
{
$this->notifyObservers(__FUNCTION__);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _postDelete() {}",
"protected function _postDelete() {}",
"protected function _postDelete()\n\t{\n\t}",
"protected function postDelete() {\n\t\treturn true;\n\t}",
"protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}",
"function callbackRowDelete() {\n $this->deleted = true;\n foreach(array_keys($this->widgets) as $w) {\n $this->widgets[$w]->hide();\n $this->table->table->remove($this->widgets[$w]);\n $this->widgets[$w]->destroy();\n }\n $this->deleteMenuItem->hide();\n \n $this->table->deleteMenu->remove($this->deleteMenuItem);\n $this->deleteMenuItem->destroy();\n $this->table->frame->hide();\n $this->table->frame->show();\n }",
"protected function _preDelete() {}",
"protected function afterDelete()\r\n {\r\n }",
"protected function afterDelete()\n {\n }",
"protected function _predelete() {\n }",
"function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}",
"protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }",
"public function preDelete() { }",
"protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }",
"public function onAfterDelete();",
"public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}",
"protected function _postdelete($result) {\n }",
"public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}",
"protected function MetaAfterDelete() {\n\t\t}",
"protected function performPostRemoveCallback()\n {\n // echo 'deleted a record ...';\n \n return true;\n }",
"protected function afterDelete()\n {\n parent::afterDelete();\n self::extraAfterDelete($this);\n \n\t\t\t\n\t\t//Implements to delete The Term Relation Ship\t\t\n }",
"public function onBeforeDelete();",
"protected function _postDelete()\n {\n $this->clearResources();\n }",
"public function postDelete()\n {\n if ((!isset($this->revisionEnabled) || $this->revisionEnabled)\n && $this->isSoftDelete()\n && $this->isRevisionable('deleted_at')\n ) {\n $revisions[] = array(\n 'revisionable_type' => get_class($this),\n 'revisionable_id' => $this->getKey(),\n 'key' => 'deleted_at',\n 'old_value' => null,\n 'new_value' => $this->deleted_at,\n 'user_id' => $this->getSystemUserId(),\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime(),\n 'activity_id' => $this->getActivityId()\n );\n $revision = new \\Venturecraft\\Revisionable\\Revision;\n \\DB::table($revision->getTable())->insert($revisions);\n }\n }",
"public function deleteRow($row);",
"function check_del($rowindex) {\r\n /* called on row delete validation */\r\n return True;\r\n }",
"protected function _postDelete()\n {\n $tabNameId = $this->get('tab_name_id');\n\n $db = $this->_db;\n\n $db->delete('xf_tab_content', 'tab_name_id = ' . $db->quote($tabNameId));\n\n $this->_deleteMasterPhrase($this->_getTitlePhraseName($tabNameId));\n }",
"public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }",
"public function afterDelete() {\n $this->deleteMeta();\n parent::afterDelete();\n }",
"protected function _postDelete()\n {\n $this->getResource()->delete();\n\n $this->getIssue()->compileHorizontalPdfs();\n }",
"protected function onDeleting()\n {\n return true;\n }",
"protected function _delete()\n\t{\n\t}",
"public function onAfterDelete()\n {\n if (!$this->owner->ID) {\n return;\n }\n\n // Force SearchUpdater to mark this record as dirty\n // Note: Some extensions require entire hierarchy passed to augmentWrite()\n $manipulation = array();\n foreach (ClassInfo::ancestry($this->owner) as $class) {\n if (!is_subclass_of($class, DataObject::class)) {\n continue;\n }\n\n $tableName = DataObject::getSchema()->tableName($class);\n $manipulation[$tableName] = array(\n 'fields' => array(),\n 'id' => $this->owner->ID,\n 'class' => $class,\n // Note: 'delete' command not actually handled by manipulations,\n // but added so that SearchUpdater can detect the deletion\n 'command' => 'delete'\n );\n }\n\n $this->owner->extend('augmentWrite', $manipulation);\n\n SearchUpdater::handle_manipulation($manipulation);\n }",
"public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}",
"public function afterDelete(){\r\n\t\t//$sql = 'DELETE FROM {{apartment_comments}} WHERE email=\"'.$this->email.'\"';\r\n\t\t//Yii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'SELECT id FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\t$bookings = Yii::app()->db->createCommand($sql)->queryColumn();\r\n\t\t\r\n\t\tif($bookings){\r\n\t\t\t$sql = 'DELETE FROM {{payments}} WHERE order_id IN ('.implode(',', $bookings).')';\r\n\t\t\tYii::app()->db->createCommand($sql)->execute();\r\n\t\t}\r\n\r\n\t\t$sql = 'DELETE FROM {{booking}} WHERE user_id=\"'.$this->id.'\"';\r\n\t\tYii::app()->db->createCommand($sql)->execute();\r\n\r\n\t\t$sql = 'UPDATE {{apartment}} SET owner_id=1, owner_active=:active, active=:inactive WHERE owner_id=:userId';\r\n\t\tYii::app()->db->createCommand($sql)->execute(array(\r\n\t\t\t':active' => Apartment::STATUS_ACTIVE,\r\n\t\t\t':inactive' => Apartment::STATUS_INACTIVE,\r\n\t\t\t':userId' => $this->id,\r\n\t\t));\r\n\r\n\t\treturn parent::afterDelete();\r\n\t}",
"public function after_delete() {}",
"function delete()\n {\n if ($this->GET('sure')) {\n $function = basename($this->table->tablename()) . \"_onRowDelete\";\n if (function_exists($function)) {\n $function($this->table->data($this->GET('id')), &$this->table);\n }\n\n $this->table->delete($this->GET('id'));\n $this->table->write();\n $this->browse();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete row \\'' . $this->GET('id') . '\\'?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . $this->GET('id') . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }",
"public function process_bulk_action() {\n\n\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\tcase 'delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( 'on' !== $this->allow_delete ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepare wp_nonce action security check.\n\t\t\t\t\t$wp_nonce_action = \"wpda-delete-{$this->table_name}\";\n\n\t\t\t\t\t$row_to_be_deleted = []; // Gonna hold the row to be deleted.\n\t\t\t\t\t$i = 0; // Index, necessary for multi column keys.\n\n\t\t\t\t\t// Check all key columns.\n\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\tif ( ! isset( $_REQUEST[ $key ] ) ) { // input var okay.\n\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['key'] = $key;\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['value'] = sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t\t$i ++;\n\n\t\t\t\t\t\t// Add key values to wp_nonce action.\n\t\t\t\t\t\t$wp_nonce_action .= '-' . sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// All key column values available: delete record.\n\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t$next_row_to_be_deleted = [];\n\t\t\t\t\t$count_rows = count( $row_to_be_deleted );\n\t\t\t\t\tfor ( $i = 0; $i < $count_rows; $i ++ ) {\n\t\t\t\t\t\t$next_row_to_be_deleted[ $row_to_be_deleted[ $i ]['key'] ] = $row_to_be_deleted[ $i ]['value'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Row deleted', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Could not delete row', 'wp-data-access' ),\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( $this->allow_delete !== 'on' ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to delete.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to delete', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-delete-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce2'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce2'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be deleted.\n\n\t\t\t\t\t$rows_to_be_deleted = []; // Gonna hold rows to be deleted.\n\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t$j = 0; // Index used to build array.\n\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['key'] = $key;\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['value'] = $row_object[ $key ];\n\t\t\t\t\t\t\t\t$j ++;\n\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// Looks like eveything is there. Delete records from table...\n\t\t\t\t\t$no_key_cols = count( $this->wpda_list_columns->get_table_primary_key() );\n\t\t\t\t\t$rows_succesfully_deleted = 0; // Number of rows succesfully deleted.\n\t\t\t\t\t$rows_with_errors = 0; // Number of rows that could not be deleted.\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t\t$next_row_to_be_deleted = [];\n\n\t\t\t\t\t\t$row_found = true;\n\t\t\t\t\t\tfor ( $j = 0; $j < $no_key_cols; $j ++ ) {\n\t\t\t\t\t\t\tif ( isset( $rows_to_be_deleted[ $i ][ $j ]['key'] ) ) {\n\t\t\t\t\t\t\t\t$next_row_to_be_deleted[ $rows_to_be_deleted[ $i ][ $j ]['key'] ] = $rows_to_be_deleted[ $i ][ $j ]['value'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$row_found = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $row_found ) {\n\t\t\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t\t\t// Row(s) succesfully deleted.\n\t\t\t\t\t\t\t\t$rows_succesfully_deleted ++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Inform user about the results of the operation.\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( 1 === $rows_succesfully_deleted ) {\n\t\t\t\t\t\t$message = __( 'Row deleted', 'wp-data-access' );\n\t\t\t\t\t} elseif ( $rows_succesfully_deleted > 1 ) {\n\t\t\t\t\t\t$message = \"$rows_succesfully_deleted \" . __( 'rows deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( $rows_with_errors > 0 ) {\n\t\t\t\t\t\t$message = __( 'Not all rows have been deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-export':\n\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\tcase 'bulk-export-json':\n\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( ! WPDA::is_wpda_table( $this->table_name ) ) {\n\t\t\t\t\t\tif ( 'on' !== WPDA::get_option( WPDA::OPTION_BE_EXPORT_ROWS ) ) {\n\t\t\t\t\t\t\t// Exporting rows from list table is not allowed.\n\t\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [export not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to export.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to export', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if export is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-export-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be exported.\n\n\t\t\t\t\t$format_type = '';\n\t\t\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\t\t\t\t$format_type = 'xml';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-json':\n\t\t\t\t\t\t\t$format_type = 'json';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\t\t\t\t$format_type = 'excel';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t\t\t$format_type = 'csv';\n\t\t\t\t\t}\n\n\t\t\t\t\t$querystring = '';\n\t\t\t\t\tif ( ! is_admin() ) {\n\t\t\t\t\t\t// Add admin path for public access\n\t\t\t\t\t\t$querystring = admin_url() . 'admin.php';\n\t\t\t\t\t}\n\t\t\t\t\t$querystring .= \"?action=wpda_export&type=row&mysql_set=off&show_create=off&show_comments=off&schema_name={$this->schema_name}&table_names={$this->table_name}&_wpnonce=$wp_nonce&format_type=$format_type\";\n\n\t\t\t\t\t$j = 0;\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$querystring .= \"&{$key}[{$j}]=\" . urlencode( $row_object[ $key ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$j ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Export rows.\n\t\t\t\t\techo '\n\t\t\t\t\t\t<script type=\\'text/javascript\\'>\n\t\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\t\tjQuery(\"#stealth_mode\").attr(\"src\",\"' . $querystring . '\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>\n\t\t\t\t\t';\n\t\t\t}\n\n\t\t}",
"function preDelete()\n {\n }",
"protected function _afterDelete()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterDelete();\r\n\r\n }",
"function delete_row($selector, $i = 1, $post_id = \\false)\n{\n}",
"protected function getDeleteAfterFunction()\n {\n \n }",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tBookmark::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoCategory::model()->deleteAll( 'howto_id=' . $this->id );\n \t\tSlide::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tStep::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoTag::model()->deleteAll( 'howto_id=' . $this->id );\n\t}",
"public function _onDelete(&$row, $old_row)\n {\n $engine = &$this->data->getProperty('engine');\n if (!$engine->startTransaction()) {\n // This error must be caught here to avoid the rollback\n return false;\n }\n\n // Process the row\n $done = $this->data->deleteRow($row) &&\n $this->_onDbAction('Delete', $row, $old_row);\n $done = $engine->endTransaction($done) && $done;\n\n return $done;\n }",
"protected function beforeDelete()\n {\n }",
"public function afterDeleteCommit(): void\n {\n }",
"public function onDelete(){\n return false;\n }",
"function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}",
"public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }",
"function after_delete() {}",
"public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }",
"protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }",
"function doRealDelete()\n {\n /* Query data of this section */\n $this->dbQuerySingle();\n /* Check the presence of GET or POST parameter 'returntoparent'. */\n $this->processReturnToParent();\n /* The function above sets $this->rs to values that shall be\n displayed. By assigning $this->rs to Smarty variable 'section'\n we can fill the values of $this->rs into a template. */\n $this->_smarty->assign('section', $this->rs);\n\n /* Delete the record */\n $this->dbDeleteById();\n /* Delete the corresponding counter */\n $this->dbDeleteCounterById();\n\n /* Left column contains administrative menu */\n $this->_smarty->assign('leftcolumn', \"leftadmin.tpl\");\n }",
"protected function afterDelete()\n {\n if($this->status==Comment::STATUS_APPROVED)\n Post::model()->updateCounters(array('commentCount'=>-1), \"id={$this->postId}\");\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 }",
"protected function afterDelete()\n {\n parent::afterDelete();\n //Comment::model()->deleteAll('post_id='.$this->id);\n VideoTag::model()->updateFrequency($this->tags, '');\n }",
"protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll('photo_id='.$this->id);\n\t\tTag::model()->updateFrequency($this->tags, '');\n\t}",
"function before_delete() {}",
"function PersonalData_Deleted($row) {\n\n\t//echo \"PersonalData Deleted\";\n}",
"function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t\n\n$do=$deleted_values[\"LvID\"];\n\n$sqldel = \"DELETE FROM indleave WHERE LvID='$do'\";\nCustomQuery($sqldel);\n\n\n;\t\t\n}",
"protected function postDeleteHook($object) { }",
"public function deletePostSelection(){\n if(!empty($_POST['dg_item']))\n return $this->CI->db\n ->from($this->tbl_name)\n ->where_in($this->pk_col,$_POST['dg_item'])\n ->delete();\n }",
"public function afterDelete()\n {\n if (parent::afterDelete()) {\n (new Query)->createCommand()\n ->delete('comment', ['id' => $this->id])\n ->execute();\n }\n }",
"protected function _postDelete()\r\n {\r\n $this->_updateSocialNotices();\r\n\r\n parent::_postDelete();\r\n }",
"public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}",
"protected function delete() {\n\t}",
"protected function onDelete() {\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\t\t$this->post->delete();\n\t\t// $this->onRun();\n\t\treturn Redirect(Request::url());\n\t}",
"public function processDelete()\n {\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set initial configuration\n $Model->build($this->Model->getTable());\n // Delete record\n if ($this->getIsTransaction()) {\n $result = DB::transaction(function ($db) use ($Model) {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n });\n } else {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.delete.success'));\n // Hook Filter deleteModifyResponse\n $Response = $this->doFilter(\"deleteModifyResponse\", $Response);\n $this->redirect($Response);\n }",
"protected function preDelete() {\n\t\treturn true;\n\t}",
"function PersonalData_Deleted($row) {\r\n\r\n\t//echo \"PersonalData Deleted\";\r\n}",
"public static function deleteData($row){\n\n\t\t$result = DB::delete($row['table'])->where('id', $row['id'])->execute();\n\t\treturn 1;\n\n\t}",
"function delete_sub_row($selector, $i = 1, $post_id = \\false)\n{\n}",
"public function disableDeleteClause() {}",
"public function afterDelete()\n {\n foreach (static::find()->where(['parent_id' => $this->id])->all() as $item) {\n $item->delete();\n }\n }",
"protected function onDelete(): Delete\r\n {\r\n $delete = new Delete(Pemesanan::TNAME);\r\n $delete->append_where(new Column(Pemesanan::C_ID).\"=?\");\r\n $delete->appendParameter(new Parameter($delete->getParameterVariableIntegerOrder(), $this->id));\r\n return $delete;\r\n }",
"protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }",
"public function afterDelete()\n\t{\n\t\tif (parent::beforeDelete()) {\n\t\t\tComment::deleteAll('comment_id='.$this->id.' AND comment_table=\"'.Workflow::MODULE_BLOG.'\"');\n\t\t\tTag::updateFrequency($this->tags, '');\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }",
"function beforeDelete() {\n\t\t\treturn $this->_deletable($this->_Model->id);\n\t\t}",
"public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}",
"public function hook_after_delete($id) {\n\n }",
"function row_delete()\n\t{\n\t $this->db->where('id', $id);\n\t $this->db->delete('testimonials'); \n\t}",
"protected function beforeDelete()\n { \n return parent::beforeDelete();\n }",
"protected function _delete()\n {\n return parent::_delete();\n }",
"function undelete() {\n\t\t$query = \"UPDATE \".$this->table.\" SET \".$this->deleted_field.\" = '0'\".$this->where_this();\n\n\t\t$this->db->query($query);\n\n\t}",
"public function afterDelete()\n {\n $this->deleteAllCustomFields();\n }",
"private function _delete()\n {\n if (!$this->isLoaded()) {\n return false;\n }\n\n $className = get_called_class();\n $db = self::getDb();\n $useValue = self::sModifyStr($this->getPrimaryValue(), 'formatToQuery');\n $db->query(\"delete from \" . self::structGet('tableName') . \" where \" . self::structGet('primaryKey') . \" = {$useValue}\",\n \"{$className}->_delete()\");\n if ($db->error()) {\n return false;\n }\n\n if (self::structGet('cbAuditing')) {\n $cbAuditing = self::structGet('cbAuditing');\n if (is_array($cbAuditing)) {\n call_user_func($cbAuditing, $this, $this->getPrimaryValue(), 'delete', false);\n } else {\n $cbAuditing($this, $this->getPrimaryValue(), 'delete', false);\n }\n }\n\n // Vamos processar eventListener:delete\n self::_handleEventListeners('delete', $this, $this->getPrimaryValue(), false);\n\n // Vamos marcar o objeto como !loaded\n $this->setLoaded(false);\n\n // Vamos processar eventListener:afterDelete\n self::_handleEventListeners('afterDelete', $this, $this->getPrimaryValue(), false);\n\n return true;\n }",
"function OnAfterDeleteItem(){\n }",
"function delPostingHandler() {\n global $inputs;\n\n $sql = \"DELETE FROM `posting` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}",
"public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"function ondelete(){\n\t\tforeach($this->get_sections() as $one){\n\t\t\t$one->dbdelete();\n\t\t}\n\t\treturn true;\n\t}",
"public function supportsNativeDeleteTrigger();",
"protected function _delete()\r\n {\r\n parent::_delete();\r\n }",
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }",
"function call_delete() {\n parent::call_delete();\n }",
"public function afterDelete()\n {\n if ($this->image) $this->image->delete();\n if ($this->reindex) Slide::reindex();\n }"
] | [
"0.78720814",
"0.7871951",
"0.7701348",
"0.69382507",
"0.69176084",
"0.6883885",
"0.6865814",
"0.6825337",
"0.6759033",
"0.6688874",
"0.66051215",
"0.65748626",
"0.657291",
"0.6556499",
"0.6535632",
"0.6519383",
"0.6467252",
"0.64639306",
"0.6458847",
"0.64209455",
"0.6410352",
"0.6402369",
"0.6399373",
"0.6391214",
"0.6387751",
"0.6386217",
"0.6358202",
"0.63362426",
"0.6321471",
"0.6318732",
"0.6312943",
"0.63080597",
"0.6300211",
"0.6280106",
"0.6261368",
"0.6236561",
"0.6226253",
"0.6220648",
"0.62201",
"0.62055856",
"0.620303",
"0.61984074",
"0.6196749",
"0.61950475",
"0.61772066",
"0.6176054",
"0.61668617",
"0.6160768",
"0.61548",
"0.6108426",
"0.61051106",
"0.6098346",
"0.6094249",
"0.6084892",
"0.6078862",
"0.6077443",
"0.6077443",
"0.6077443",
"0.6068406",
"0.60679454",
"0.6064926",
"0.6059503",
"0.6053186",
"0.60448736",
"0.6038504",
"0.60353637",
"0.6031073",
"0.6011524",
"0.6011115",
"0.6008407",
"0.60054487",
"0.5985751",
"0.5971056",
"0.59694517",
"0.59676665",
"0.59668624",
"0.5952844",
"0.5952273",
"0.5950543",
"0.5940032",
"0.5931995",
"0.5928955",
"0.5925182",
"0.59241146",
"0.59215295",
"0.59132093",
"0.5907016",
"0.5906881",
"0.5901451",
"0.58940417",
"0.5880982",
"0.5867707",
"0.58628726",
"0.5862312",
"0.58513725",
"0.58462584",
"0.5845135",
"0.5837142",
"0.5817483",
"0.5814831"
] | 0.6180993 | 44 |
Get observers attached to this row | public static function getObservers()
{
$observers = self::$_observers;
return $observers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function observers()\n {\n return $this->observers;\n }",
"public function getObservers()\n {\n return $this->observers;\n }",
"public function getObservers()\n {\n return $this->observers;\n }",
"public function get_observers() : array\n\t{\n\t\treturn $this->_observers;\n\t}",
"public function observers();",
"public function getObservacions()\n {\n return $this->observacions;\n }",
"public final function GetObserver()\n {\n return $this->observer;\n }",
"public function getObservableEvents()\n {\n return array_merge(\n [\n 'retrieved', 'creating', 'created', 'updating', 'updated',\n 'saving', 'saved', 'restoring', 'restored', 'replicating',\n 'deleting', 'deleted', 'forceDeleted',\n ],\n static::getRelationshipObservables(),\n $this->observables,\n );\n }",
"public function getElementProgressObservers()\n {\n return $this->_elementProgressObservers;\n }",
"public function getObservableEvents()\n {\n return array_merge(\n [\n 'creating', 'created', 'updating', 'updated',\n 'deleting', 'deleted', 'saving', 'saved',\n 'fetching', 'fetched'\n ],\n $this->observables\n );\n }",
"public function getObservateurs()\n {\n return $this->observateurs;\n }",
"public static function get_observer_list() {\n $events = \\core\\event\\manager::get_all_observers();\n foreach ($events as $key => $observers) {\n foreach ($observers as $observerskey => $observer) {\n $events[$key][$observerskey]->parentplugin =\n \\core_plugin_manager::instance()->get_parent_of_subplugin($observer->plugintype);\n }\n }\n return $events;\n }",
"public function observer()\n {\n return $this->belongsTo(Observer::class);\n }",
"public function getObservables()\n {\n return is_array($this->observables) ? array_merge($this->observables, $this->translationEvent) : $this->translationEvent;\n }",
"public function getSubscribers()\n {\n return $this['subscribers'];\n }",
"function getObservaciones() {\r\n return $this->observaciones;\r\n }",
"public function getObservacoes()\n {\n return $this->observacoes;\n }",
"public function getObs()\n {\n return $this->obs;\n }",
"public function getSubscribers()\n\t\t{\n\t\t\treturn $this->subscribers;\n\t\t}",
"public function getEventListeners()\n {\n return $this->eventListeners;\n }",
"public function notifications() { return $this->notifications; }",
"public function events()\n {\n return $this->events;\n }",
"public function events()\n {\n return $this->events;\n }",
"public function getNotifications()\n {\n return $this->_notifications;\n }",
"public function getListeners(): array;",
"public function event_notification_methods_data_provider()\n {\n return array(\n array(ImplementationNotifierDataClassListener::BEFORE_DELETE), \n array(ImplementationNotifierDataClassListener::BEFORE_CREATE), \n array(ImplementationNotifierDataClassListener::BEFORE_SET_PROPERTY), \n array(ImplementationNotifierDataClassListener::BEFORE_UPDATE), \n array(ImplementationNotifierDataClassListener::AFTER_DELETE), \n array(ImplementationNotifierDataClassListener::AFTER_CREATE), \n array(ImplementationNotifierDataClassListener::AFTER_SET_PROPERTY), \n array(ImplementationNotifierDataClassListener::AFTER_UPDATE), \n array(ImplementationNotifierDataClassListener::GET_DEPENDENCIES));\n }",
"public function getEvents()\n {\n return $this->eventListeners;\n }",
"function GetNotifications () {\n\t\treturn $this->notifications;\n\t}",
"public function getListeners()\n {\n return $this->listeners;\n }",
"public function getListeners()\n {\n return $this->listeners;\n }",
"public function getEvents()\n {\n return $this->_events;\n }",
"public function getEvents() {\n return $this->_events;\n }",
"public function subscribers() {\n return new Subscriber($this);\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents()\n {\n return $this->events;\n }",
"public function getEvents() { return $this->_events; }",
"public function getObs()\n {\n return isset($this->obs) ? $this->obs : null;\n }",
"protected function _getSortedObservers()\n {\n $array = $this->_splObjectStorageToArray($this->observers);\n\n usort($array, function ($a, $b) {\n return (int) $a['data'] < (int) $b['data'];\n });\n\n return array_map(function ($item) {\n return $item['obj'];\n }, $array);\n }",
"public function behaviors() {\n\t\treturn $this->Behaviors;\n\t}",
"public function notifications()\n {\n return $this->morphMany(Notification::class, 'notificable');\n }",
"public function getSubscribedEvents()\n {\n return $this->wrapped->getSubscribedEvents();\n }",
"public function notifications()\n {\n return $this->morphMany(DatabaseNotification::class, 'notifiable')->orderBy('created_at', 'desc');\n }",
"protected function registerEloquentObservers()\n {\n App\\User::observe(Observers\\UserObserver::class);\n }",
"function getObserv()\n {\n if (!isset($this->sobserv) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sobserv;\n }",
"function getObserv()\n {\n if (!isset($this->sobserv) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sobserv;\n }",
"public function getTxObservaciones()\n\t{\n\t\treturn $this->tx_observaciones;\n\t}",
"public function getEvents();",
"public function getEvents();",
"function getElements() {\n return $this->rows_object;\n }",
"protected static function getHasAuditColumnModelEvents()\n {\n if (isset(static::$auditColumnEvents)) {\n return static::$auditColumnEvents;\n }\n\n return collect([\n 'creating',\n 'updating',\n 'deleting',\n ]);\n }",
"public function getImplementedListeners(): iterable;",
"public function &getOnAfterDataBindCallbacks()\n {\n return $this->onAfterDataBindCallbacks;\n }",
"public function getEvents()\n\t{\n\t\treturn $this->events;\n\t}",
"public static function getObservers(prototype\\Prototype $prototype) :array\n {\n return (isset(self::$observers[$prototype]) ? self::$observers[$prototype] : [] );\n }",
"public function getSubscribedEvents()\n {\n return [\n 'postPersist',\n 'postUpdate',\n 'preRemove',\n ];\n }",
"public function getSubscribedEvents()\n {\n return [\n 'postPersist',\n 'postUpdate',\n 'preRemove',\n ];\n }",
"public function getTeacherNotificationList()\n {\n $teachers = new Teachers();\n $notifications = $teachers->getTeachersStudentNotification($this->schoolid);\n return Datatables::of($notifications)->make(true);\n }",
"public function notifications()\n {\n return $this->morphToMany(Notification::class, 'notificationable', 'notificationables');\n }",
"function getjsOnRowChanged() { return $this->_jsonrowchanged; }",
"public function getBehaviors()\n {\n return $this->getSchema()->behaviors;\n }",
"public function getWindowResizeListeners() {\n return ($this->resizeListeners == null) ? new SplObjectStorage() : $this->resizeListeners;\n }",
"public function getNotifications()\n {\n return $this->hasMany(Notification::className(), ['user_id' => 'id']);\n }",
"function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }",
"public function notifications()\n {\n return $this->morphToMany(Notification::class, 'notifiable');\n }",
"public function getBehaviors()\n {\n return array(\n 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),\n );\n }",
"public function getBehaviors()\n {\n return array(\n 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ),\n );\n }",
"public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}",
"public function notifyObservers() {\n \n // Iterate through observer list\n foreach ($this->observers as $observer) {\n \n // Call notify on observer\n $observer->notify();\n \n }\n \n // Implement fluent interface\n return $this;\n }",
"public function getSubscribedEvents()\n {\n return [\n 'preUpdate',\n 'prePersist',\n 'preRemove',\n 'preFlush',\n 'postFlush',\n 'postPersist',\n 'postUpdate',\n 'postRemove',\n 'postLoad',\n 'onFlush',\n ];\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n// Events::preUpdate,\n ];\n\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::postUpdate,\n Events::postPersist,\n Events::preRemove\n ];\n }",
"public function getSubscribedEvents()\n {\n return array(self::prePersist);\n }",
"public function getEventHandlers()\n {\n return $this->eventHandlers;\n }",
"public function getSubscribedEvents()\n {\n return [\n 'prePersist',\n 'postPersist',\n 'preUpdate',\n 'postLoad',\n ];\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::postFlush,\n Events::preRemove\n ];\n }",
"public function getSubscribedEvents();",
"public function getTablesListening() {}",
"public function observe() {}",
"public function broadcastOn()\n {\n return [$this->reciever_id];\n }",
"public static function getSubscribedEvents() {\n return [];\n }",
"public function getSubscribedEvents()\n {\n return array(\n 'prePersist',\n 'preUpdate'\n );\n }",
"public function getSubscribedEvents()\n {\n return array(\n 'postPersist',\n \t'postFlush',\n 'onFlush'\n );\n }",
"protected function getEventsToSend()\n {\n return $this->getResource()->getEventsToSend();\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n Events::preRemove,\n ];\n }",
"public function getModelEvents();",
"public function getTriggeringEvents();",
"public function getUpdates()\n {\n return $this->updates;\n }",
"public function getNotificationRelation()\n {\n return $this->notifynderNotifications();\n }",
"public function getCachedSubscribersAttribute(): Collection\n {\n return Cache::remember($this->cacheKey().':subscribers', 10, function () {\n return $this->subscribers()->latest()->get();\n });\n }",
"public function getSubscribedEvents()\n {\n return [\n Events::prePersist,\n Events::postUpdate,\n Events::preRemove,\n ];\n }",
"public function getPlayers()\n {\n return $this->hasMany(Player::className(), ['id' => 'player_id'])\n ->viaTable('game_has_player', ['game_id' => 'id'])\n ->select('*, (SELECT presence FROM game_has_player WHERE game_id='.$this->id.' AND player_id=players.id LIMIT 1) as presence');\n }",
"public function getSubEvents()\n {\n return $this->subEvents;\n }",
"public function getSubscriberRecords() {\n if($stmt = $this->pdo->query(\"SELECT * FROM subscribers;\")){\n $subscribers = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $subscribers[] = $row;\n }\n return $subscribers;\n }else{\n return 'unset';\n }\n }",
"public function getSubscribedEvents()\n\t{\n\t\treturn [\n\t\t\tEvents::onFlush\n\t\t];\n\t}"
] | [
"0.78559965",
"0.74705446",
"0.74705446",
"0.6996944",
"0.68374246",
"0.62419736",
"0.6213425",
"0.61684084",
"0.6099628",
"0.6088177",
"0.594256",
"0.5937092",
"0.5788808",
"0.5774903",
"0.5770698",
"0.57029057",
"0.570119",
"0.57011217",
"0.5700989",
"0.5655671",
"0.55843157",
"0.55754274",
"0.55754274",
"0.55305403",
"0.5494244",
"0.5462586",
"0.5433287",
"0.5423272",
"0.5419617",
"0.5419617",
"0.53888816",
"0.5373246",
"0.5362906",
"0.53611624",
"0.53611624",
"0.53611624",
"0.53611624",
"0.53611624",
"0.53611624",
"0.53611624",
"0.53611624",
"0.534257",
"0.53418005",
"0.5337926",
"0.53294206",
"0.5325227",
"0.5323031",
"0.5312316",
"0.5292152",
"0.5287653",
"0.5287653",
"0.5283171",
"0.5262367",
"0.5262367",
"0.52611357",
"0.525212",
"0.52496386",
"0.52342933",
"0.52331513",
"0.5224975",
"0.5200029",
"0.5200029",
"0.51997906",
"0.51940364",
"0.5193576",
"0.5152907",
"0.51441",
"0.51370656",
"0.51362187",
"0.51204",
"0.5119519",
"0.5119519",
"0.51161873",
"0.5113554",
"0.5107314",
"0.51036257",
"0.50992346",
"0.50962687",
"0.5095952",
"0.50939",
"0.50892043",
"0.50841683",
"0.5078645",
"0.5075509",
"0.5075245",
"0.506906",
"0.50636053",
"0.50611806",
"0.5053998",
"0.50522286",
"0.50439024",
"0.50430536",
"0.5038201",
"0.5036615",
"0.5036123",
"0.5032967",
"0.50329596",
"0.5018709",
"0.5013409",
"0.50133413"
] | 0.710488 | 3 |
Add a static Observer object to the class | public static function attachStaticObserver(TA_Model_Observer_Interface $o)
{
array_push(self::$_observers, $o);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function observers();",
"function addObserver(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function add($observer){\n $this->observers[] = $observer;\n }",
"public function observe() {}",
"function attach( &$observer)\r\n\t{\r\n\t\tif (is_object($observer))\r\n\t\t{\r\n\t\t\t$class = get_class($observer);\r\n\t\t\tforeach ($this->_observers as $check) {\r\n\t\t\t\tif (is_a($check, $class)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->_observers[] =& $observer;\r\n\t\t} else {\r\n\t\t\t$this->_observers[] =& $observer;\r\n\t\t}\r\n\t}",
"function attach(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }",
"public function registerObserver($observer)\n {\n $this->observers[] = $observer;\n }",
"public function bindObserver($observer)\n\t{\n\t\t$file = dirname(__FILE__) . '/Observer/' . $observer . '.php';\n\t\tif(file_exists($file)){\n\t\t\trequire_once($file);\n\t\t\t$obj = new $observer($this->CI, $this->config);\n\t\t\tif($obj instanceof ObserverInterface){\n\t\t\t\t$this->observers[] = $obj;\n\t\t\t}\n\t\t}\n\t}",
"public function AddObserver(object $objObserver) {\n if(method_exists($objObserver,\"On\")) {\n $this->_arrObservers[] = $objObserver;\n }\n }",
"public function attach( $observer )\r\n {\r\n $this->observers []= $observer;\r\n }",
"function Net_FTP_Observer()\n {\n $this->_id = md5(microtime());\n }",
"public function attach(Observer $observer) {\n $this->observers[] = $observer;\n }",
"function attach(&$observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::setStaticObserver($nameHash, array('obs' => &$observer, 'eventID' => $eventID));\n }\n }",
"public function attach(Observer $observer)\n {\n $this->observers[] = $observer;\n }",
"function attach(AbstractObserver $observer)\n {\n $this->observers[] = $observer;\n\n }",
"public function attach(SplObserver $observer){\n $id = spl_object_hash($observer);\n $this->observers[$id] = $observer;\n }",
"public function __construct()\n {\n Hook::listen(__CLASS__);\n }",
"public function init (Observer $obs){\n\t \n\t}",
"public static function staticInit() {\n self::$logger = Logger::getLogger(__CLASS__);\n\n self::$domains = array (\n self::DOMAIN_COMMAND,\n self::DOMAIN_COMMAND_SET,\n self::DOMAIN_SERVICE_CONTRACT,\n );\n self::$categories = array (\n self::CATEGORY_ROADMAP\n );\n }",
"public function addObserver(WorkflowObserverInterface $observer)\n {\n $this->observers[] = $observer;\n }",
"public static function staticConstructor() {\n static::$loggingUtils = new LoggingUtils();\n }",
"function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"private function add_observers( $observers, $subject ) {\n \n if ( is_array( $observers ) ) {\n \n foreach ( $observers as $observer) {\n \n if ( class_exists( $observer ) ) {\n \n $subject->attach( new $observer() );\n \n }\n }\n \n }\n \n }",
"public function attach($observer)\n {\n $observerKey = spl_object_hash($observer);\n $this->observers[$observerKey] = $observer;\n }",
"public function attachObserver(ISimulatorObserver $observer) {\r\n \t$this->_observers[] = $observer;\r\n }",
"public function createObserver(SubjectInterface $subject);",
"protected static function _init()\n {\n /**\n * This functions a lot like a __construct in a instantiated class.\n */\n\n // Add the getFooter method to get_footer action.\n add_action('get_footer', [static::$_class, 'getFooter']);\n }",
"protected static function boot()\n {\n parent::boot();\n static::observe(new PlanObserver());\n }",
"public function observe(string $className)\n {\n return new PluginObserver($this, $className);\n }",
"public function __construct()\n\t{\n\t\t$this->observers = array();\n\t\t$this->authenticated = false;\n\t}",
"function attach(ftpClientObserver $observer) {\r\n\t\t$this->_listeners[$observer->getId()] = $observer;\r\n\t\treturn true;\r\n\t}",
"public function createSubscriber();",
"public function attach(SplObserver $observer)\n {\n $this->_observers->attach($observer);\n }",
"public static function staticInit() {\n self::$logger = Logger::getLogger(__CLASS__);\n }",
"public static function staticInit() {\n self::$logger = Logger::getLogger(__CLASS__);\n }",
"public static function staticInit() {\n self::$logger = Logger::getLogger(__CLASS__);\n }",
"private function __construct() {\n\t\t// Useful variables\n\t\tself::$url = trailingslashit( plugin_dir_url( __FILE__ ) );\n\t\tself::$path = trailingslashit( dirname( __FILE__ ) );\n\t\tself::$name = __( 'Outbound Link Tracking', 'outbound_link_tracking' );\n\n\t\tadd_action( 'init', array( $this, 'init' ) );\n\n\t\t// Add JS to head\n\t\tadd_action( 'wp_head', array( $this, 'do_outbound_link_tracking' ), 1 );\n\t}",
"protected static function boot()\n {\n parent::boot();\n\n static::observe(CampaignObserver::class);\n }",
"public function attach(\\SplObserver $observer)\n {\n $this->storage->attach($observer);\n }",
"public function listen(\\ReflectionClass $class): void;",
"public static function ReconfigureObservers()\r\n\t\t{\r\n\t\t\tif (!self::$observersSetuped)\r\n\t\t\t\tself::setupObservers();\r\n\t\t\t\r\n\t\t\tforeach (self::$EventObservers as &$observer)\r\n\t\t\t{\r\n\t\t\t\tif (method_exists($observer, \"__construct\"))\r\n\t\t\t\t\t$observer->__construct();\r\n\t\t\t}\r\n\t\t}",
"public function attach(ObservesProxyLoading $observer) : void;",
"public function boot()\n {\n //\n Item :: observe (ItemObserver :: class); \n }",
"public function attach( \\SplObserver $observer )\n {\n $this->_storage->attach( $observer );\n }",
"public static function init() {\n\t\t$class = get_called_class();\n\n\t\t// Admin menu entry for upload debugging.\n\t\tadd_action('admin_menu', array($class, 'menu_debug'));\n\n\t\t// Override upload file validation (general).\n\t\tadd_filter('wp_check_filetype_and_ext', array($class, 'check_filetype_and_ext'), 10, 4);\n\n\t\t// Override upload file validation (SVG).\n\t\tadd_filter('wp_check_filetype_and_ext', array($class, 'check_filetype_and_ext_svg'), 15, 4);\n\n\t\t// Set up translations.\n\t\tadd_action('plugins_loaded', array($class, 'localize'));\n\n\t\t// Update check on debug page.\n\t\tadd_action('admin_notices', array($class, 'debug_notice'));\n\n\t\t// AJAX hook for disabling contributor lookups.\n\t\tadd_action('wp_ajax_bm_ajax_disable_contributor_notice', array($class, 'disable_contributor_notice'));\n\n\t\t// And the corresponding warnings.\n\t\tadd_filter('admin_notices', array($class, 'contributors_changed_notice'));\n\n\t\t// Pull remote contributor information.\n\t\t$next = wp_next_scheduled('cron_get_remote_contributors');\n\t\tif ('disabled' === get_option('bm_contributor_notice', false)) {\n\t\t\t// Make sure the CRON job is disabled.\n\t\t\tif ($next) {\n\t\t\t\twp_unschedule_event($next, 'cron_get_remote_contributors');\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tadd_action('cron_get_remote_contributors', array($class, 'cron_get_remote_contributors'));\n\t\t\tif (!$next) {\n\t\t\t\twp_schedule_event(time(), 'hourly', 'cron_get_remote_contributors');\n\t\t\t}\n\t\t}\n\n\t\t// Register plugins page quick links if we aren't running in\n\t\t// Must-Use mode.\n\t\tif (!BLOBMIMES_MUST_USE) {\n\t\t\tadd_filter('plugin_action_links_' . plugin_basename(BLOBMIMES_INDEX), array($class, 'plugin_action_links'));\n\t\t}\n\t}",
"public function setAsGlobal()\n {\n static::$instance = $this;\n }",
"protected static function boot()\n {\n parent::boot();\n static::observe(new CategoryObserver());\n }",
"public static function observe( &$varname )\n\t\t{\n\t\t\t$this->observer_list[] =& $var;\n\t\t}",
"public static function initialize() {\n\n\t\tif ( null === self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t\tself::$instance->add_hooks();\n\t\t}\n\n\t\t// Not giving away the instance on purpose.\n\t}",
"public function attach(SplObserver $observer) {\n\t\tarray_push($this->_observers, $observer);\n\t\t$this->notify();\n\t}",
"public function __construct()\n {\n $this->_inotify = Watcher::getInstance();\n }",
"public static function boot ()\n {\n parent::boot();\n self::observe(new MailRecipientObserver());\n }",
"public static function boot()\n {\n parent::boot();\n\n self::observe(new CommentObserver());\n }",
"public function boot()\n {\n Dictionary::observe(DictionaryObserver::class);\n HouseLevy::observe(HouseLevyObserver::class);\n LandLevy::observe(LandLevyObserver::class);\n Period::observe(PeriodObserver::class);\n }",
"public final function GetObserver()\n {\n return $this->observer;\n }",
"public static function static_init(){\n\t\tself::$object_class = new ClassType(\n\t\t\tnew FullyQualifiedName(\"object\", FALSE),\n\t\t\tWhere::getSomewhere());\n\t}",
"function __construct() {\n if ( is_null( self::$instance ) ) {\n self::$instance = $this;\n \n add_action( 'admin_menu', array( $this, 'add_menu'));\n \n add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts') );\n \n add_action( 'wp_ajax_wp_sample_plugin_email_search', array( $this, 'ajax_wp_sample_plugin_email_search' ) );\n }\n }",
"public static function addObserverClassToClass($observerClass, $observableClass, $params = array())\n\t{\n\t\tif ($params !== false)\n\t\t{\n\t\t\tstatic::$observations[$observableClass][$observerClass] = $params;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunset(static::$observations[$observableClass][$observerClass]);\n\t\t}\n\t}",
"function __construct() {\n\t\t$request = Request::getInstance();\n\t\t$plugin = Plugin::getInstance();\n\t\t$plugin->triggerEvents('load' . $request->getController());\n\t}",
"static public function init() {\n\n\t\tadd_action( 'plugins_loaded', __CLASS__ . '::setup_hooks' );\n\t}",
"protected static function boot()\n {\n parent::boot();\n self::observe(new InterceptObserversModel);\n }",
"public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }",
"public function boot()\n {\n Artist::observe(ArtistObserver::class);\n Album::observe(AlbumObserver::class);\n Genre::observe(GenreObserver::class);\n Label::observe(LabelObserver::class);\n User::observe(UserObserver::class);\n }",
"function addOneTimeObserver($oSubscriber)\n\t\t{\n\t\t\t$query = \"insert into tbl_member set \n\t\t\tfirst_name='\".$oSubscriber->first_name.\"'\n\t\t\t,last_name='\".$oSubscriber->last_name.\"'\n\t\t\t,user_name='\".$oSubscriber->user_name.\"'\n\t\t\t,email='\".$oSubscriber->email.\"'\n\t\t\t,password=md5('\".$oSubscriber->password.\"')\n\t\t\t,member_type='observer'\n\t\t\t,reg_date=now()\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t$newid= mysql_insert_id();\n\t\t\t\n\t\t\t$query = \"insert into tbl_subscriber set \n\t\t\tsubscriber_id = '\".$newid.\"'\n\t\t\t,mail_street_address = '\".$oSubscriber->mail_address.\"'\n\t\t\t,mail_city = '\".$oSubscriber->mail_city.\"'\n\t\t\t,mail_state = '\".$oSubscriber->mail_state.\"'\n\t\t\t,mail_zip_code = '\".$oSubscriber->mail_postal_code.\"'\n\t\t\t,is_billing = '\".$oSubscriber->isBillingInfo.\"'\n\t\t\t,bill_street_address = '\".$oSubscriber->billingAddress.\"'\n\t\t\t,bill_city = '\".$oSubscriber->billingCity.\"'\n\t\t\t,bill_state = '\".$oSubscriber->billingState.\"'\n\t\t\t,bill_zip_code = '\".$oSubscriber->billingZipCode.\"'\n\t\t\t,prim_affiliate_id = '\".$oSubscriber->primary_afflliates.\"'\n\t\t\t,secondary_affiliates = '\".$oSubscriber->secondary_afflliates.\"'\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\treturn $newid;\n\t\t}",
"public static function __constructStatic() : void;",
"public function notify() {\n // Updates all classes subscribed to this object\n foreach ($this->observers as $obs) {\n $obs->update($this);\n }\n }",
"function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }",
"public static function init() {\n\t\tadd_action( 'job_manager_send_notification', array( __CLASS__, '_schedule_notification' ), 10, 2 );\n\t\tadd_action( 'job_manager_email_init', array( __CLASS__, '_lazy_init' ) );\n\t\tadd_action( 'job_manager_email_job_details', array( __CLASS__, 'output_job_details' ), 10, 4 );\n\t\tadd_action( 'job_manager_email_header', array( __CLASS__, 'output_header' ), 10, 3 );\n\t\tadd_action( 'job_manager_email_footer', array( __CLASS__, 'output_footer' ), 10, 3 );\n\t\tadd_action( 'job_manager_email_daily_notices', array( __CLASS__, 'send_employer_expiring_notice' ) );\n\t\tadd_action( 'job_manager_email_daily_notices', array( __CLASS__, 'send_admin_expiring_notice' ) );\n\t\tadd_filter( 'job_manager_settings', array( __CLASS__, 'add_job_manager_email_settings' ), 1 );\n\t\tadd_action( 'job_manager_job_submitted', array( __CLASS__, 'send_new_job_notification' ) );\n\t\tadd_action( 'job_manager_user_edit_job_listing', array( __CLASS__, 'send_updated_job_notification' ) );\n\t}",
"protected function registerEloquentObservers()\n {\n App\\User::observe(Observers\\UserObserver::class);\n }",
"public static function bootLoggable()\n {\n static::observe(app(LoggableObserver::class));\n }",
"public static function boot()\n {\n parent::boot();\n self::observe(OfficerObserver::class);\n }",
"public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }",
"public static function getObservers()\n\t{\n\t\t$observers = self::$_observers;\n\t\treturn $observers;\n\t}",
"public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }",
"public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"public function result() {\n echo \"this is observer1\";\n }",
"static function init() {\n\n # Only run these hooks once\n if (! self::$started) {\n\n // Hook into new blog creation\n add_action( 'wpmu_new_blog', [ __CLASS__, 'change_new_blog_domain_name' ], 10, 3 );\n\n add_action( 'network_site_new_form', [ __CLASS__, 'change_tld_with_javascript' ] );\n\n // Init is ready\n self::$started = true;\n\n // Set multisite cookies into upper level domain if this site is under the same tld\n if ( ! defined( 'COOKIE_DOMAIN' ) && self::get_multisite_tld() === self::get_upper_level_domain( $_SERVER['HTTP_HOST'] ) ) {\n define( 'COOKIE_DOMAIN', '.' . self::get_multisite_tld() );\n }\n }\n }",
"public static function detachStaticObserver(TA_Model_Observer_Interface $o)\n\t{\n\t\tforeach (self::$_observers as $key => $observer) {\n\t\t\tif ($observer == $o) {\n\t\t\t\tself::$_observers[$key] = null;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function execute(Observer $observer)\n {\n Bootstrap::init();\n }",
"public function testUpdateObserver() {\n\t\t$this->testSave();\n\t\t/** @var \\arConnector $observerConnector */\n\t\t$observerConnector = Mockery::namedMock(\"observerConnectorMock\", \\arConnector::class);\n\n\t\t\\arConnectorMap::register(new BucketContainer(), $observerConnector);\n\n\t\t// Observer is updated after tasks are added.\n\t\t$observerConnector->shouldReceive(\"read\")->once()->andReturn(1);\n\t\t$observerConnector->shouldReceive(\"update\")->once()->andReturn(true);\n\n\t\t$this->persistence->setConnector($observerConnector);\n\t\t$this->persistence->updateBucket($this->bucket);\n\t}",
"public function __construct()\n {\n $this->subscribe = new Subscribe();\n }",
"public function result() {\n echo \"this is observer2\";\n }",
"static public function init() {\n }",
"public function observers()\n {\n return $this->observers;\n }",
"function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}",
"public function result() {\n echo \"this is observer3\";\n }",
"public function boot()\n {\n parent::boot();\n\n Brand::observe(BrandObserver::class);\n Email::observe(EmailObserver::class);\n Media::observe(MediaObserver::class);\n\n Category::observe(ScrappedCategoryMappingObserver::class);\n\n ScrapedProducts::observe(ScrappedProductCategoryMappingObserver::class);\n //\n }",
"public static function callbackStaticTestFunction() {}",
"private function __construct() {\n\t\tadd_filter( 'init', array( $this, 'init' ) );\n\t\tadd_action( 'admin_init', array( $this, 'admin_init' ) );\n\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\n\t\tadd_action( 'get_footer', array( $this, 'insert_code' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'track_outgoing' ) );\n\t\tadd_filter( 'plugin_action_links', array( $this, 'add_plugin_page_links' ), 10, 2 );\n\t}",
"public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }",
"public static function init(): void {\r\n self::getInstance();\r\n }",
"public static function boot()\n {\n parent::boot();\n\n self::observe(new ModelObserver);\n }",
"public static function init() {\n add_action( self::$scheduled_event_hook, array( __CLASS__, 'cron_expiration_reminder' ) );\n add_filter( 'manage_edit-th_domain_sortable_columns', array( __CLASS__, 'manage_sortable_columns' ) );\n }",
"public function __construct() {\n\t\t$this->listen();\n\t\tadd_action( 'wp_ajax_tribe_timezone_update', array( $this, 'ajax_updater' ) );\n\t\tadd_filter( 'tribe_general_settings_tab_fields', array( $this, 'settings_ui' ) );\n\t}"
] | [
"0.6833247",
"0.67054194",
"0.6472937",
"0.6472937",
"0.6472937",
"0.64722073",
"0.64722073",
"0.64722073",
"0.6366079",
"0.619584",
"0.61669123",
"0.61455566",
"0.6084249",
"0.60706794",
"0.5959561",
"0.5883357",
"0.5873043",
"0.57347405",
"0.5712314",
"0.5692079",
"0.56391877",
"0.5552132",
"0.55246127",
"0.55244565",
"0.55224836",
"0.5518854",
"0.5502569",
"0.54798156",
"0.5459714",
"0.54438907",
"0.5443523",
"0.543581",
"0.5425554",
"0.5360504",
"0.5344121",
"0.5333607",
"0.5331718",
"0.53288317",
"0.5323739",
"0.53117776",
"0.53117776",
"0.53117776",
"0.5287783",
"0.5266126",
"0.5263791",
"0.52543944",
"0.52414966",
"0.5227368",
"0.5227136",
"0.5226855",
"0.5225225",
"0.5208925",
"0.520861",
"0.518677",
"0.51725984",
"0.5168759",
"0.5165926",
"0.5161206",
"0.51557064",
"0.5152073",
"0.5151542",
"0.5147895",
"0.51286006",
"0.51141965",
"0.5103454",
"0.5088019",
"0.508373",
"0.50816524",
"0.50766087",
"0.5075216",
"0.5074438",
"0.50564814",
"0.50497174",
"0.50409967",
"0.50350565",
"0.5026667",
"0.50201607",
"0.5017496",
"0.5016901",
"0.50148606",
"0.5009438",
"0.49939302",
"0.49887562",
"0.49833664",
"0.49809048",
"0.4978483",
"0.49670434",
"0.4959395",
"0.4953017",
"0.49525028",
"0.49515867",
"0.49412307",
"0.49401566",
"0.49333316",
"0.4923389",
"0.4918115",
"0.49154073",
"0.49109104",
"0.4907084",
"0.490123"
] | 0.7133692 | 0 |
Remove a static observer object from the class | public static function detachStaticObserver(TA_Model_Observer_Interface $o)
{
foreach (self::$_observers as $key => $observer) {
if ($observer == $o) {
self::$_observers[$key] = null;
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }",
"protected function removeInstance() {}",
"public static function remove() : void\n {\n static::clear();\n \n }",
"static function remove() {\n }",
"public function detach(\\SplObserver $observer) {}",
"public static function clearInstance(){\n self::$instance = null;\n }",
"public function removeObserver($observer)\n {\n if (in_array($observer, $this->observers)) {\n $key = array_search($observer, $this->observers);\n if (!empty($this->observers[$key])) {\n unset($this->observers[$key]);\n }\n }\n }",
"public static function destroy()\n {\n self::$instance = NULL;\n }",
"static public function unregister()\n {\n spl_autoload_unregister(array(self::getInstance(), 'autoload'));\n self::$registered = false;\n }",
"static public function unregister()\n {\n spl_autoload_unregister(array(self::getInstance(), 'autoload'));\n self::$registered = false;\n }",
"static public function deleteHandlers()\n\t{\n\t\tself::$handlers = array();\n\t}",
"public function __destruct()\n\t{\n\t\tif (static::$instance != NULL)\n\t\t\tstatic::$instance = NULL;\n\t\tforeach (static::$events as $event => $events)\n\t\t\tstatic::$events[$event] = [];\n\t}",
"function detach($observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::unsetStaticObserver($nameHash);\n }\n }",
"protected function __del__() { }",
"function detach(Observer $observer_in) {\n //or\n //$this->observers = array_diff($this->observers, array($observer_in));\n //or\n foreach($this->observers as $okey => $oval) {\n if ($oval == $observer_in) {\n unset($this->observers[$okey]);\n }\n }\n }",
"public function onRemove();",
"public static function unobserve(prototype\\Prototype $prototype, callable $callback) :void\n {\n if ( isset(self::$observers) && isset(self::$observers[$prototype]) ) {\n unset(self::$observers[$prototype][$callback]);\n }\n }",
"public function unsubscribe(): void;",
"public function unregister(): void;",
"public function unregister(): void;",
"public static function clear(): void\n {\n if (static::$Instance !== NULL) {\n static::$Instance = NULL;\n }\n }",
"public function remove($listener);",
"public function detach(SplObserver $observer){\n $id = spl_object_hash($observer);\n unset($this->observers[$id]);\n }",
"public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }",
"static function eliminar_instancia()\n\t{\n\t\tself::$instancia = null;\n\t}",
"static public function reset()\n\t{\n\t\tstatic::$instance = null;\n\t}",
"public function remove() {}",
"public function remove() {}",
"public static final function unregister()\n {\n\tspl_autoload_unregister('PathAutoload::loadClass');\n }",
"public static function destroy() {}",
"protected function removeOldInstanceIfExists() {}",
"public function detach($observer)\n\t{\n // Not implemented here\n }",
"public static function resetInstance()\n {\n static::$_instance = null;\n }",
"public function removeObserver(Component $observer) {\n $observer->attributes()->remove('data-equalizer-watch');\n return $this;\n }",
"public static function destroy()\n {\n static::getInstance()->destroy();\n }",
"public function unregister() {\n spl_autoload_unregister([$this, 'autoLoad']);\n }",
"public function unregister()\n {\n spl_autoload_unregister([$this, 'loadClass']);\n }",
"public function unSubscribe()\n {\n }",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function unregister()\n\t{\n\t\tspl_autoload_unregister([$this, 'loadClass']);\n\t}",
"public static function tearDown()\n {\n self::$instance = null;\n }",
"public function _delete()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClass'));\n }",
"public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClass'));\n }",
"public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClass'));\n }",
"public function detach($observer)\n {\n $observerKey = spl_object_hash($observer);\n unset($this->observers[$observerKey]);\n }",
"static public function __unsetRegistry()\n {\n self::$_registry = null;\n }",
"function detach(AbstractObserver $observer)\n {\n foreach($this->observers as $okey => $oval) {\n if ($oval == $observer) {\n unset($this->observers[$okey]);\n }\n }\n }",
"public function unregister () {\r\n\t\tspl_autoload_unregister( array( $this, 'loadClass' ) );\r\n\t}",
"public function newsletterUnsubscribe($observer)\n {\n $subscriber = $observer->getSubscriber();\n \n $result = Mage::getSingleton('extensions_store_constantcontact/constantcontact')->updateSubscriber($subscriber);\n \n return $observer; \n }",
"public function detach(Observer $observer)\n\t{\n\t\tunset($this->_observers[array_search($observer, $this->_observers)]);\n\t}",
"public function unregister()\n {\n spl_autoload_unregister( array( $this, 'loadClass' ) );\n }",
"public function detach(Observer $observer)\n {\n if (($key = array_search($observer, $this->observers, true)) !== false) {\n unset($this->observers[$key]);\n }\n }",
"public function remove ($obj) {}",
"public function removeEventSubscriber(IEventSubscriber $subscriber);",
"public static function _destroy(prototype\\Prototype $obj) :void\n {\n unset(self::$notExtensible[$obj]);\n unset(self::$sealed[$obj]);\n unset(self::$frozen[$obj]);\n unset(self::$observers[$obj]);\n if ( isset($obj->prototype) ) {\n $p = self::$instances[$obj->prototype];\n $p = array_filter($p, function($o) use ($obj) {\n return $o != $obj; // remove references to $obj\n });\n self::$instances[$obj->prototype] = $p;\n }\n }",
"final public static function emptyCacheStatic():void\n {\n static::$cacheStatic = [];\n }",
"public static function pruneInstance()\n {\n self::$instance = null;\n self::$refIdList = array();\n self::$refIdDefinitions = array();\n }",
"final public function __unset($class) {\n\t\t$this->detachObject($class);\n\t}",
"public function detach( $observer )\r\n {\r\n $this->observers []= $observer; // an an observer to the observer subject.\r\n }",
"public function unregister(): void {\n\t\t\\spl_autoload_unregister( [ $this, self::AUTOLOAD_METHOD ] );\n\t}",
"public function detach(Observer $observer) {\n foreach ($this->observers as $key => $obs) {\n if ($observer == $obs) {\n unset($this->observers[$key]);\n break;\n }\n }\n }",
"public static function clear()\n {\n static::getInstance()->clear();\n }",
"static public function dropContainer(): void {\n self::$instance = null;\n }",
"function unregister_notification_handler($method) {\n\tglobal $NOTIFICATION_HANDLERS;\n\n\tif (isset($NOTIFICATION_HANDLERS[$method])) {\n\t\tunset($NOTIFICATION_HANDLERS[$method]);\n\t}\n}",
"public function detach(ObservesProxyLoading $observer) : void;",
"public function clearSubscribers();",
"public function __destruct()\n {\n if ($this == self::$instance) {\n self::$instance = null;\n }\n }",
"function unregister()\n {\n spl_autoload_unregister([$this, 'resolve']);\n }",
"public function test_remove_filter_within_class_instance( $hook ) {\n $this->assertTrue( yourls_has_filter( $hook ) );\n $removed = yourls_remove_filter( $hook, array( self::$instance, 'change_variable' ) );\n $this->assertTrue( $removed );\n $this->assertFalse( yourls_has_filter( $hook ) );\n }",
"public function detach(\\SplObserver $observer)\n {\n $this->storage->detach($observer);\n }",
"public function unregister() {\n\n\t\tspl_autoload_unregister( array( $this, 'load' ) );\n\t}",
"function __destroy() {\n }",
"protected function afterRemoving()\n {\n }",
"public function destroySingletons ();",
"public static function destroy();",
"public static function purge() : Forge\n {\n static::$instance = static::$instance ?: new static();\n\n // clean and destroy the container\n static::$instance->forgetInstances();\n\n // destroy this instance reference\n static::$instance = NULL;\n\n // construct a new instance and return it\n return static::getInstance();\n }",
"public function unregister()\n {\n spl_autoload_unregister(array($this, 'loadClassWithAlias'));\n }",
"function __destruct() {\n\t\tif ( $this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = null;\n\t\t}\n\t}",
"function __destruct() {\n\t\tif ( $this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = null;\n\t\t}\n\t}",
"function __destruct() {\n\t\tif ( $this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = null;\n\t\t}\n\t}",
"public static function unsetEventDispatcher()\n {\n static::$dispatcher = null;\n }",
"public function remove() {\n }",
"public function __destruct() {\n if (class_exists('\\Sleepy\\Hook')) {\n Hook::addAction($this->clean_class() . '_postprocess');\n }\n }",
"public static function resetInstance() {\n \t// Reset the instance\n \tself::$oInsance = null;\n }",
"public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}",
"public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}",
"function unextend() {\n if ($this->observation) {\n $this->observation->cancel();\n $this->observation = NULL;\n }\n }",
"public function destroy(Subscriber $subscriber)\n {\n //\n }",
"protected function tearDown() {\n spl_autoload_unregister('autoloadForTesting');\n unset($this->object);\n }",
"protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }",
"public static function reinit() {\n\t\tself::$instance = NULL;\n\t\tself::init();\n\t}",
"abstract public function remove();",
"abstract public function remove();",
"abstract public function remove();",
"function __destruct()\n {\n $this->db = null;\n static::$instance = null;\n }",
"static function removeMatchingItem($exp){\n\t\tself::init();\n\t\tself::$backend->removeMatchingItem($exp);\n\t}"
] | [
"0.7610802",
"0.708865",
"0.67560804",
"0.662963",
"0.65068525",
"0.63159585",
"0.6248106",
"0.61832315",
"0.6081306",
"0.6081306",
"0.6025248",
"0.60128707",
"0.6003528",
"0.5998771",
"0.5979606",
"0.59649056",
"0.59577596",
"0.59554034",
"0.5944269",
"0.5944269",
"0.58814794",
"0.5854953",
"0.5790097",
"0.5783039",
"0.576865",
"0.57665694",
"0.57576394",
"0.57573986",
"0.57467055",
"0.57201046",
"0.5701483",
"0.5681641",
"0.56809425",
"0.56716824",
"0.56510735",
"0.56390744",
"0.5634594",
"0.5631217",
"0.5623884",
"0.5623884",
"0.5623884",
"0.5623884",
"0.56226796",
"0.5602909",
"0.55989873",
"0.55866516",
"0.55866516",
"0.55866516",
"0.5581259",
"0.5580929",
"0.55781984",
"0.5573741",
"0.55631536",
"0.5561964",
"0.5550823",
"0.5550462",
"0.5541749",
"0.55384296",
"0.5530418",
"0.5514629",
"0.5514217",
"0.55133057",
"0.55010206",
"0.5498774",
"0.54944533",
"0.5488054",
"0.547494",
"0.5474876",
"0.54525834",
"0.54510105",
"0.5440176",
"0.5437084",
"0.543245",
"0.54169816",
"0.540574",
"0.5402028",
"0.53975075",
"0.53941345",
"0.53770113",
"0.5374444",
"0.53558105",
"0.53460413",
"0.53460413",
"0.53460413",
"0.534441",
"0.53323495",
"0.53294075",
"0.5329006",
"0.53258204",
"0.53258204",
"0.5323579",
"0.5317075",
"0.5307848",
"0.53047454",
"0.5303895",
"0.5291453",
"0.5291453",
"0.5291453",
"0.52825165",
"0.52820426"
] | 0.6295088 | 6 |
Notify any observers use this if something happens the observers might be interested in | public function notifyObservers($method, $msg = null)
{
$observers = self::$_observers;
// loop through observers and notify each available observer method
foreach ($observers as $obs) {
if (is_callable(array($obs, $method))) {
$obs->$method($this, $msg);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }",
"function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }",
"public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}",
"public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}",
"public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }",
"public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }",
"public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }",
"public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }",
"public function notify() {\n // Updates all classes subscribed to this object\n foreach ($this->observers as $obs) {\n $obs->update($this);\n }\n }",
"public function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update();\n }\n }",
"public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }",
"public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }",
"public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }",
"public function observers();",
"public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }",
"public function notify()\n {\n foreach($this->_storage AS $observer) {\n $observer->update($this);\n }\n }",
"public function notifyObservers() {\n\t\tforeach ( $this->observers as $obs => $key )\n\t\t\t$key->update ( $this->actTemp, $this->maxTemp, $this->minTemp, $this->actPressure );\n\t}",
"public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }",
"public function observe() {}",
"public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"public function notify()\n {\n // @TODO: Needs to handle the various types of bounces: References, Recommendations, and general bounces that should be purged\n }",
"public function notify() {}",
"public function notify() {}",
"public function notify() {}",
"public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"protected function notifyAll()\n\t{\n\t\t$this->notifyBorrowers();\n\t\t$this->notifyLenders();\n\t}",
"public function notifyObservers() {\n \n // Iterate through observer list\n foreach ($this->observers as $observer) {\n \n // Call notify on observer\n $observer->notify();\n \n }\n \n // Implement fluent interface\n return $this;\n }",
"function notify($event) {\r\n\t\tif ( count($this->_listeners) > 0 ) {\r\n\t\t\tif ( false ) $listener = new ftpClientObserver();\r\n\t\t\tforeach ( $this->_listeners as $id => $listener ) {\r\n\t\t\t\t$listener->notify($event);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function measurementsChanged()\n {\n $this->notifyObservers();\n }",
"public function measurementsChanged(): void\n {\n $this->notifyObservers();\n }",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function attach(\\SplObserver $observer) {}",
"public function notify( mixed $extras = null ) : IObservable\n {\n\n if ( 1 < \\count( $this->_cache ) )\n {\n $this->_cache[] = $extras;\n }\n else\n {\n $this->_cache = $extras;\n }\n\n foreach ( $this->_observers as $ob )\n {\n $ob->onUpdate( $this, $this->_cache );\n }\n\n $this->_cache = [];\n\n return $this;\n\n }",
"function notify();",
"function update(AbstractSubject $subject)\n {\n write_in(\"Alert to observer\");\n write_in($subject->favorite);\n }",
"public function notify($instance);",
"function attach( &$observer)\r\n\t{\r\n\t\tif (is_object($observer))\r\n\t\t{\r\n\t\t\t$class = get_class($observer);\r\n\t\t\tforeach ($this->_observers as $check) {\r\n\t\t\t\tif (is_a($check, $class)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->_observers[] =& $observer;\r\n\t\t} else {\r\n\t\t\t$this->_observers[] =& $observer;\r\n\t\t}\r\n\t}",
"function notifyAnimate()\n {\n self::notifyAllPlayers(\"animate\", \"\", array());\n }",
"protected function notifyObservers($event_type_key, $date_occurred, $event_amount, $track_key, $space_key)\n\t{\n\t\tforeach ($this->observers as $d)\n\t\t{\n\t\t\t$d->invoke($this, $event_type_key, $date_occurred, $event_amount, $track_key, $space_key);\n\t\t}\n\t}",
"public function attachAllHitStatObservers()\n\t{\n\t\t$event_log = new Stats_OLP_Observe_Eventlog();\n\t\t$event_log->observeHitStat($this);\n\t}",
"protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }",
"public function forceSynchonization()\n {\n $observer = App::make(ObserverContract::class);\n\n $observer->forceSynchonization($this);\n }",
"public static function ReconfigureObservers()\r\n\t\t{\r\n\t\t\tif (!self::$observersSetuped)\r\n\t\t\t\tself::setupObservers();\r\n\t\t\t\r\n\t\t\tforeach (self::$EventObservers as &$observer)\r\n\t\t\t{\r\n\t\t\t\tif (method_exists($observer, \"__construct\"))\r\n\t\t\t\t\t$observer->__construct();\r\n\t\t\t}\r\n\t\t}",
"public function notify() : bool{}",
"public function observers()\n {\n return $this->observers;\n }",
"public function eventMethod1()\n {\n // some code here...\n\n $this->notify(\"action1\");\n }",
"public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }",
"public function notifyOne() : bool{}",
"function attach(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }",
"protected function notify($event, WorkflowEntityInterface $entity)\n {\n foreach ($this->observers as $observer) {\n $observer->$event($entity);\n }\n }",
"public function attach( $observer )\r\n {\r\n $this->observers []= $observer;\r\n }",
"protected function _markNew() \n {\n DomainWatcher::addNewObject($this);\n }",
"function notify($eventID, $param1 = array(), &$param2 = null, &$param3 = null, &$param4 = null, &$param5 = null, &$param6 = null, &$param7 = null, &$param8 = null, &$param9 = null)\n {\n $this->logNotifier($eventID, $param1, $param2, $param3, $param4, $param5, $param6, $param7, $param8, $param9);\n\n $observers = &$this->getStaticObserver();\n if (is_null($observers)) {\n return;\n }\n foreach ($observers as $key => $obs) {\n // identify the event\n $actualEventId = $eventID;\n $matchMap = [$eventID, '*'];\n\n // Adjust for aliases\n\n // if the event fired by the notifier is old and has an alias registered\n $hasAlias = $this->eventIdHasAlias($obs['eventID']);\n if ($hasAlias) {\n // then lookup the correct new event name\n $eventAlias = $this->substituteAlias($eventID);\n // use the substituted event name in the list of matches\n $matchMap = [$eventAlias, '*'];\n // and set the Actual event to the name that was originally attached to in the observer class\n $actualEventId = $obs['eventID'];\n }\n // check whether the looped observer's eventID is a match to the event or alias\n if (!in_array($obs['eventID'], $matchMap)) {\n continue;\n }\n\n // Notify the listening observers that this event has been triggered\n\n $methodsToCheck = [];\n // Check for a snake_cased method name of the notifier Event, ONLY IF it begins with \"NOTIFY_\" or \"NOTIFIER_\"\n $snake_case_method = strtolower($actualEventId);\n if (preg_match('/^notif(y|ier)_/', $snake_case_method) && method_exists($obs['obs'], $snake_case_method)) {\n $methodsToCheck[] = $snake_case_method;\n }\n // alternates are a camelCased version starting with \"update\" ie: updateNotifierNameCamelCased(), or just \"update()\"\n $methodsToCheck[] = 'update' . self::camelize(strtolower($actualEventId), true);\n $methodsToCheck[] = 'update';\n\n foreach($methodsToCheck as $method) {\n if (method_exists($obs['obs'], $method)) {\n $obs['obs']->{$method}($this, $actualEventId, $param1, $param2, $param3, $param4, $param5, $param6, $param7, $param8, $param9);\n continue 2;\n }\n }\n // If no update handler method exists then trigger an error so the problem is logged\n $className = (is_object($obs['obs'])) ? get_class($obs['obs']) : $obs['obs'];\n trigger_error('WARNING: No update() method (or matching alternative) found in the ' . $className . ' class for event ' . $actualEventId, E_USER_WARNING);\n }\n }",
"protected function registerEloquentObservers()\n {\n App\\User::observe(Observers\\UserObserver::class);\n }",
"function attach(AbstractObserver $observer)\n {\n $this->observers[] = $observer;\n\n }",
"public function hasObservers() : bool\n {\n\n return 0 < $this->countObservers();\n\n }",
"public function testObserversAreUpdated()\n {\n // only mock the update() method.\n $observer = $this->getMockBuilder('Company\\Product\\Observer')\n ->setMethods(array('update'))\n ->getMock();\n\n // Set up the expectation for the update() method\n // to be called only once and with the string 'something'\n // as its parameter.\n $observer->expects($this->once())\n ->method('update')\n ->with($this->equalTo('something'));\n\n // Create a Subject object and attach the mocked\n // Observer object to it.\n $subject = new \\Company\\Product\\Subject('My subject');\n $subject->attach($observer);\n\n // Call the doSomething() method on the $subject object\n // which we expect to call the mocked Observer object's\n // update() method with the string 'something'.\n $subject->doSomething();\n }",
"public function getObservers()\n {\n return $this->observers;\n }",
"public function getObservers()\n {\n return $this->observers;\n }",
"protected function notify_changes_saved() {\n $this->notify->good('gradessubmitted');\n }",
"public function notify($event, $params)\n {\n $observers = $this->getObservers();\n\n if (isset($observers[$event])) {\n foreach ($observers[$event] as $observer) {\n $observer->setTriggeredEvent($event);\n $observer->setTriggeredEventParams($params);\n $observer->setBag($this->getBag());\n $observer->run();\n }\n }\n }",
"public function notify($type, \\Phalcon\\Mvc\\CollectionInterface $model){ }",
"protected function notifyMatched(Subject $subject, array $descriptors)\n {\n $this->getNotifier()->notifyMatched($subject, $descriptors);\n }",
"function addObserver(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }",
"public function notify()\n\t\t{\n\t\t\techo \"Notifying via YM\\n\";\n\t\t}",
"public static function observe( &$varname )\n\t\t{\n\t\t\t$this->observer_list[] =& $var;\n\t\t}",
"public function subscribes();",
"public function notify(ParameterBag $params);",
"public function checkSignal()\n {\n if($this->current_signal){\n $this->fire($this->current_signal); \n }\n }",
"public function _postInsert()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public static function getObservers()\n\t{\n\t\t$observers = self::$_observers;\n\t\treturn $observers;\n\t}",
"public function collectSubscribers();",
"function attach(ftpClientObserver $observer) {\r\n\t\t$this->_listeners[$observer->getId()] = $observer;\r\n\t\treturn true;\r\n\t}",
"protected function _syncSubject() {}",
"public function _insert()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"public function inform() {\n $this->deliveryType(DELIVERY_TYPE_BOOL);\n $this->deliveryMethod(DELIVERY_METHOD_JSON);\n\n // Retrieve all notifications and inform them.\n NotificationsController::informNotifications($this);\n $this->fireEvent('BeforeInformNotifications');\n\n $this->render();\n }",
"public function activityNotify();",
"function notifyNewScores()\n {\n $scores = self::getCollectionFromDb(\"SELECT player_id, player_score FROM player\", true);\n self::notifyAllPlayers(\"newScores\", \"\", array(\"scores\" => $scores));\n }",
"public static function bootNotifiesMentionees()\n\t{\n\t\tstatic::saved(function ($model) {\n\t\t\tdispatch(new NotifyMentioneesJob($model));\n\t\t});\n\t}",
"public function get_observers() : array\n\t{\n\t\treturn $this->_observers;\n\t}",
"function notify($event)\n {\n return;\n }",
"public function notify($type,CollectionInterface $collection);",
"protected function _readObserversQueue() {\n if (Zend_Registry::isRegistered('observers_queue')) {\n $observerQueue = Zend_Registry::get('observers_queue');\n } else {\n $observerQueue = array();\n }\n\n\t\t$modelClassName = get_called_class();\n if (array_key_exists($modelClassName, $observerQueue) && !empty($observerQueue[$modelClassName])){\n foreach ($observerQueue[$modelClassName] as $observer) {\n if(Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(true)->autoload($observer)) {\n $this->registerObserver(new $observer());\n } else {\n if(Tools_System_Tools::debugMode()) {\n error_log('Unable to load an observer from the queue: ' . $observer);\n }\n }\n }\n }\n\n }",
"public function visit(SubjectInterface $subject)\n {\n\n // load the observers from the configuration\n $availableObservers = $subject->getConfiguration()->getObservers();\n\n // prepare the observers\n foreach ($availableObservers as $observers) {\n $this->prepareObservers($subject, $observers);\n }\n }",
"public function _postDelete()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public function add($observer){\n $this->observers[] = $observer;\n }",
"private function registerSubscribers()\n {\n $extensions = $this->dataGridFactory->getExtensions();\n\n foreach ($extensions as $extension) {\n $extension->registerSubscribers($this);\n }\n }",
"function onAfterSaveItem( &$item, &$post )\n\t{\n\t\tglobal $mainframe;\n\t\t$notify\t= isset($post['notify']) ? true : false;\n\t\t\n\t\t// Performance check\n\t\tif (!$notify) return;\n\n\t\t$subscribers = $this->_getSubscribers($item->id);\n\t\t// Don't do anything if there are no subscribers\n\t\tif (count($subscribers) == 0) return;\n\n\t\t// Get Plugin info\n\t\t$plugin\t\t\t=& JPluginHelper::getPlugin('flexicontent', 'flexinotify');\n\t\t$pluginParams\t= new JParameter( $plugin->params );\n\t\t\n\t\tforeach ($subscribers as $sub) {\n\t\t\t$this->_sendEmail($item, $sub, $pluginParams);\n\t\t}\n\t}",
"public function attach(Observer $observer) {\n $this->observers[] = $observer;\n }",
"final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }",
"function attached(&$observer)\n {\n return isset($this->observers[$observer->getHashCode()]);\n }",
"public function registerObserver($observer)\n {\n $this->observers[] = $observer;\n }",
"public function notify($event, $object = null) {\r\n\t\tif ($event == self::EVENT_BEFORECREATE) {\r\n\t\t\tself::$_newest[get_called_class()] = $object;\r\n\t\t} else if ($event == self::EVENT_BEFORESAVE) {\r\n\t\t\tself::$_lastModified[get_called_class()] = $object;\r\n\t\t}\r\n\t\tif (isset($this->_eventObservers[$event])) {\r\n\t\t\tif (is_null($object)) $object = $this;\r\n\t\t\tforeach ($this->_eventObservers[$event] as $observer) {\r\n\t\t\t\t$observer->update($object);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function attach(Observer $observer)\n {\n $this->observers[] = $observer;\n }",
"public function canAppendAValueToObservers()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Comment', array(), array('comment'));\n $this->object->append($object0);\n $this->object->append($object1);\n $collection = $this->object->filterClasses(get_class($object0));\n $collection->append($object0, true);\n $this->assertEquals(2, count($collection));\n $this->assertEquals(3, count($this->object));\n $this->assertSame($object0, $this->object[2]);\n }",
"public function isObserved() {}"
] | [
"0.81921875",
"0.8186039",
"0.8168171",
"0.810597",
"0.80442035",
"0.79946303",
"0.7989916",
"0.7949516",
"0.79406106",
"0.77949536",
"0.7767869",
"0.7707903",
"0.7449027",
"0.7383375",
"0.73534185",
"0.73387027",
"0.72073436",
"0.7058341",
"0.6774289",
"0.6747729",
"0.6677616",
"0.63698065",
"0.63698065",
"0.63698065",
"0.62977535",
"0.62422884",
"0.61954844",
"0.61913794",
"0.6101623",
"0.60827744",
"0.6033952",
"0.6033952",
"0.6033952",
"0.6033801",
"0.6033801",
"0.6033801",
"0.5967299",
"0.5918231",
"0.5858458",
"0.5850734",
"0.5786693",
"0.57031834",
"0.5654329",
"0.5628116",
"0.56211466",
"0.56015795",
"0.55599517",
"0.5559102",
"0.5545897",
"0.5544785",
"0.5537809",
"0.55332696",
"0.5463873",
"0.5450709",
"0.54456645",
"0.5443476",
"0.5439674",
"0.5433624",
"0.5432457",
"0.54239196",
"0.5407759",
"0.5404162",
"0.5404162",
"0.53954834",
"0.53938",
"0.5378283",
"0.53498703",
"0.5342922",
"0.5332842",
"0.5297637",
"0.5294922",
"0.5291398",
"0.5272231",
"0.52621585",
"0.52605647",
"0.5258614",
"0.52474093",
"0.52359176",
"0.5226612",
"0.5220695",
"0.52049184",
"0.51988375",
"0.51844203",
"0.5165732",
"0.51629114",
"0.51624644",
"0.51573753",
"0.51542586",
"0.51536775",
"0.51511157",
"0.5148198",
"0.51463693",
"0.51433456",
"0.511587",
"0.51154673",
"0.51142824",
"0.5113266",
"0.50996023",
"0.5092967",
"0.5092077"
] | 0.5822416 | 40 |
Verify the existence of the key. | private function verifyKey(array $readSpreadSheet): void
{
$keys = [
'sheet_id',
'category_tag',
'read_type',
'use_blade',
'output_directory_path',
'definition_directory_path',
'separation_key',
'attribute_group_column_name',
];
foreach ($keys as $key) {
if (! array_key_exists($key, $readSpreadSheet)) {
throw new LogicException('There is no required setting value:'.$key);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function keyExists(string $key): bool;",
"public static function exist($key) ;",
"public function exist($key);",
"public function exists($key): bool;",
"public function exists(string $key): bool\n {\n }",
"public function exists($key);",
"public function has(string $key): bool {}",
"public function exists(string $key);",
"public function issetKey(string $key) : bool;",
"public function exists($key){\n\n //get exists\n if($this->client->exists($key)){\n return true;\n }\n return false;\n }",
"public function hasKey()\n {\n return isset($this->key);\n }",
"public function hasKey()\n {\n return isset($this->key);\n }",
"public function has($key) : bool;",
"public function has(string $key): bool;",
"public function has(string $key): bool;",
"public function has(string $key): bool;",
"public function has(string $key): bool;",
"public function has(string $key): bool;",
"public function has(string $key): bool;",
"public function has(string $key): bool;",
"public function exists($key) {\n return false;\n }",
"function exists($key);",
"public function has(string $key) : bool;",
"public function hasKey($key) {\n if ($this->client) {\n return $this->client->exists($key);\n }\n return false;\n }",
"public function hasKey()\n\t{\n\t\treturn !empty($this->key);\n\t}",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey(){\n return $this->_has(1);\n }",
"public function hasKey() {\n return $this->_has(1);\n }",
"private function _api_key_exists()\n {\n $apikey = Apikey::where('secret', '=', $this->_key)->first();\n if (!$apikey) {\n return false;\n }\n return true;\n }",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function isKeyExist($key)\n {\n if(isset($this->list[$key]))\n {\n return true;\n }\n\n return false;\n }",
"public function isset($key): bool;",
"abstract public function has(string $key): bool;",
"public function __isset(string $key): bool;",
"public function hasKey(string $filename, string $key): bool;",
"public function keyExists($key)\n {\n return apc_exists($key);\n }",
"protected function checkKeyExists()\n {\n if (empty($this->key)) {\n throw new InvalidArgumentException('Please set the primary key using key() method.');\n }\n }",
"public function itemExists($key);",
"public function has(string $key): bool\n {\n return false;\n }",
"public function exist($keyName);",
"public function exists(string $key): bool\n {\n return $this->factoryFromKey($key)->exists($key);\n }",
"abstract public function has( $key );",
"public function hasKey($key){\n $item = CacheManager::getInstance('files')->getItem($key);\n return !is_null($item->get());\n }",
"public function _key_exists($key)\n {\n return $this->db\n ->where('auth_key', $key)\n ->count_all_results('login_keys') > 0;\n }",
"public function isExist() {\n\t\tif (!empty($this->enCryptKey) && !empty($this->deCryptKey) && !empty($this->certKey)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private static function keyExists($key)\n {\n $apiKeyCount = self::where('key', '=', $key)->limit(1)->count();\n\n if ($apiKeyCount > 0) return true;\n\n return false;\n }",
"public function hasItem(string $key): bool;",
"public function hasItem(string $key): bool;",
"public function exist(string $key): bool\r\n {\r\n return isset($this->$key) === true;\r\n }",
"function KeyExist () { // verifie l'existence des cles pour connexions ssh\n\treturn file_exists('/var/remote_adm/.ssh/id_rsa.pub');\n}",
"public function isExistInCache($key);",
"public function containsKey($key): bool;",
"public function containsKey($key): bool;",
"function has($key);",
"public function __isset($key)\r\n {\r\n return $this->shared_data->exists($key);\r\n }",
"public function HasKey($key)\n {\n $actualKey = null;\n return $this->_key($key, $actualKey);\n }",
"private function keyExists($key)\n {\n $apiKeyCount = $this->findWhere(['key', '=', $key])->count();\n\n if ($apiKeyCount > 0)\n {\n return true;\n }\n\n return false;\n }",
"public function exists(string $key): bool\n {\n return apcu_exists(\n $this->getFinalKey($key)\n );\n }",
"public function has(string $key): bool\n {\n // TODO: Implement has() method.\n }",
"public function __isset($key)\r\n {\r\n return $this->exists($key);\r\n }",
"public function testIsValidKeyWithValidKey() \n {\n $key = 'key1';\n $result = $this->fileCache->isValidKey($key);\n $expected = TRUE;\n\n $this->assertEquals($expected, $result);\n }",
"public function exists($key) {\n\t\treturn $this -> get($key) === FALSE;\n\t}",
"public function is_key($key) {\n try{\n return isset($this->Items[$key]);\n }catch(Exception $e){\n throw $e;\n }\n }",
"public function containsKey($key) {\n return array_key_exists($key, $this->_hash);\n }",
"public function has($key)\n {\n if (!$this->isEnable) {\n return false;\n }\n\n return $this->client->exists($key);\n }",
"public function exists($key) {\n\n // Not in the register\n if(!isset($this->register[$key]))\n return false;\n\n // Not readable file\n $filepath = $this->storage.'/'.$key.'.'.self::FILE_EXTENSION;\n if(!is_readable($filepath))\n return false;\n\n // Over time life\n $meta = $this->register[$key];\n if(!empty($meta['lifetime']) && time() > $meta['creation'] + $meta['lifetime']) {\n @unlink($filepath);\n return false;\n }\n\n // Check data integrity\n return (md5_file($filepath) == $meta['etag']);\n\n }",
"public static function exists($key)\n {\n $exists = parent::exists($key);\n return !!$exists;\n }",
"private function _hasKey() {\n return is_array($this->_keys) && count($this->_keys) > 0;\n }",
"function exists($key) {\n\t\treturn isset($this->args[$key]);\n\t}",
"public function has(string $key): bool\n {\n $filepath = $this->getFilepath($key);\n\n if (!file_exists($filepath)) {\n return false;\n }\n\n $payload = $this->getPayload($filepath);\n\n if (empty($payload)) {\n return false;\n }\n\n return !$this->isExpired($payload);\n }",
"public function has(string $key): bool\n {\n return isset($this->storage[$key]);\n }",
"public function exists ($key)\n {\n return apc_exists($key);\n }",
"public function key_exists($key) {\n return in_array($key, array_keys($this->params));\n }",
"function has ($key);",
"public function exists($key) {\n return apc_exists($key);\n }",
"protected function is_valid_key($key)\n {\n }",
"public function __isset($key)\n {\n return array_key_exists($key, $this->storage);\n }"
] | [
"0.8191065",
"0.78206205",
"0.7818034",
"0.7737714",
"0.7706629",
"0.7637137",
"0.75851434",
"0.7564888",
"0.7493388",
"0.7472187",
"0.7465525",
"0.7465525",
"0.7444413",
"0.74311393",
"0.74311393",
"0.74311393",
"0.74311393",
"0.74311393",
"0.74311393",
"0.74311393",
"0.74218976",
"0.7417614",
"0.73912686",
"0.73467",
"0.7319371",
"0.7310448",
"0.7310448",
"0.7310448",
"0.7310448",
"0.7310448",
"0.7310448",
"0.7310448",
"0.7310448",
"0.7310448",
"0.73012733",
"0.7289866",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.7259228",
"0.72519237",
"0.7246654",
"0.7209635",
"0.7168407",
"0.71638376",
"0.71634114",
"0.71593887",
"0.714142",
"0.7140384",
"0.71249974",
"0.71177393",
"0.71023107",
"0.7100419",
"0.7098798",
"0.70828134",
"0.70711976",
"0.7056549",
"0.7056549",
"0.70460886",
"0.7043249",
"0.70412976",
"0.70387673",
"0.70387673",
"0.7026483",
"0.7018466",
"0.7014247",
"0.70134073",
"0.69960856",
"0.69855756",
"0.69832164",
"0.69691855",
"0.6967031",
"0.69527566",
"0.69424075",
"0.69422036",
"0.6936365",
"0.69198245",
"0.69131935",
"0.68875974",
"0.6884024",
"0.68838745",
"0.6882665",
"0.68568224",
"0.685195",
"0.6851409",
"0.68499446",
"0.68425155"
] | 0.0 | -1 |
Display a listing of the resource. | public function index($id)
{
$layanan = Layanan::where('id_layanan', $id)->get();
return view('public.pemesanan.index', compact('layanan'));
} | {
"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()
{
//
} | {
"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 é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 return view('rests.create');\n }",
"public function create()\n {\n //\n return view('form');\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 {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create(){\n return view('form.create');\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 {\n return view('saldo.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\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 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 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 return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\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 {\n return view(\"familiasPrograma.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 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}",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}"
] | [
"0.7594622",
"0.7594622",
"0.7588457",
"0.7580005",
"0.75723624",
"0.7499764",
"0.7436887",
"0.74322647",
"0.7387517",
"0.735172",
"0.73381543",
"0.73117113",
"0.72958225",
"0.7280436",
"0.7273787",
"0.72433424",
"0.7230227",
"0.7225085",
"0.71851814",
"0.71781176",
"0.7174025",
"0.7149406",
"0.71431303",
"0.7142905",
"0.7136737",
"0.712733",
"0.7122102",
"0.71148264",
"0.71148264",
"0.71148264",
"0.7111841",
"0.7092733",
"0.70843536",
"0.70822084",
"0.7079442",
"0.70571405",
"0.70571405",
"0.7055195",
"0.70391846",
"0.7039114",
"0.7035626",
"0.7033991",
"0.70300245",
"0.7026507",
"0.7026417",
"0.7019451",
"0.7017105",
"0.7004775",
"0.70031846",
"0.6999904",
"0.6995238",
"0.6994825",
"0.699354",
"0.6988824",
"0.6986871",
"0.6965804",
"0.6965542",
"0.69560695",
"0.69515944",
"0.6950682",
"0.6947703",
"0.69433117",
"0.6941539",
"0.6939613",
"0.69377476",
"0.69377476",
"0.693678",
"0.69344354",
"0.69314486",
"0.6927608",
"0.69264024",
"0.6922966",
"0.69181216",
"0.69150716",
"0.6911192",
"0.69095594",
"0.69092506",
"0.6907887",
"0.69018227",
"0.69008595",
"0.69006085",
"0.6900209",
"0.68949944",
"0.6892768",
"0.6891944",
"0.6891552",
"0.6891552",
"0.6891443",
"0.68886423",
"0.6888326",
"0.68856037",
"0.68835604",
"0.68813664",
"0.6878345",
"0.6876079",
"0.6873206",
"0.6873183",
"0.687048",
"0.687014",
"0.686966",
"0.68695843"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
$generate = new generateKode();
$kode = $generate->KodePemesanan();
$nominal = $request->input('total');
$sub = substr($nominal,-3);
$sub2 = substr($nominal,-2);
$sub3 = substr($nominal,-1);
$total = rand(1, 999);
$total2 = rand(1, 99);
$total3 = rand(1, 9);
if($sub==0){
$hasil = $nominal + $total;
}if($sub2 == 0){
$hasil = $nominal + $total2;
}if($sub3 == 0){
$hasil = $nominal + $total3;
}
$request->validate(
[
'nama' => 'required',
'alamat' => 'required',
'tlp' => 'required',
]
);
$pemesanan = Pemesanan::create(
[
'id_pemesanan' => $kode,
'id_konsumen' => $request->input('id_user'),
'id_layanan' => $request->input('id_layanan'),
'nama' => $request->input('nama'),
'alamat_pemesanan' => $request->input('alamat'),
'tlp' => $request->input('tlp'),
'waktu_pemesanan' => $request->input('jam'),
'waktu_kunjungan' => $request->input('tgl'),
'status_pemesanan' => '0',
'total' => $request->input('total'),
'nominal' => $hasil,
]
);
return redirect('/nota-pemesanan/'.$kode.'')->with('success', 'Berhasil Melakukan Pemesanan');
} | {
"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(Pemesanan $pemesanan)
{
//
} | {
"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(Pemesanan $pemesanan)
{
//
} | {
"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, Pemesanan $pemesanan)
{
//
} | {
"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(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(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(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);",
"public function update($request, $id);",
"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 }",
"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 }",
"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);",
"abstract public function put($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 updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\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 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 static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public abstract function update($object);",
"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($id, $input);",
"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(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);",
"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 put($path, $data = null);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\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(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() {\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 $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.7424578",
"0.7062392",
"0.7056844",
"0.6897447",
"0.65815884",
"0.6451359",
"0.634689",
"0.62107086",
"0.6145251",
"0.6121901",
"0.6115076",
"0.61009926",
"0.60885817",
"0.6053816",
"0.6018965",
"0.6007763",
"0.5973282",
"0.59455335",
"0.593951",
"0.59388787",
"0.5892445",
"0.58630455",
"0.58540666",
"0.58540666",
"0.5851948",
"0.5816257",
"0.58070177",
"0.5752376",
"0.5752376",
"0.57359827",
"0.5723941",
"0.57152426",
"0.56958807",
"0.5691061",
"0.56881654",
"0.5669518",
"0.5655434",
"0.5651897",
"0.56480426",
"0.5636727",
"0.56354004",
"0.5633156",
"0.5632135",
"0.5629063",
"0.5621358",
"0.56089175",
"0.5602031",
"0.55927175",
"0.5582773",
"0.558176",
"0.5581365",
"0.5575607",
"0.5571989",
"0.55672973",
"0.5562929",
"0.55623275",
"0.55602384",
"0.55602384",
"0.55602384",
"0.55602384",
"0.55602384",
"0.55598706",
"0.55560726",
"0.55558753",
"0.5554241",
"0.55534166",
"0.5552986",
"0.55440396",
"0.55438566",
"0.5540619",
"0.55394524",
"0.5536144",
"0.5535339",
"0.5534803",
"0.5524157",
"0.55188423",
"0.55163455",
"0.55135876",
"0.5509835",
"0.5507501",
"0.55068344",
"0.55034274",
"0.5501476",
"0.55010915",
"0.5499286",
"0.5497852",
"0.54958415",
"0.54958415",
"0.5494513",
"0.5494261",
"0.54935366",
"0.54931587",
"0.54917634",
"0.54836094",
"0.5479455",
"0.5478885",
"0.5478268",
"0.54654354",
"0.54645413",
"0.5461025",
"0.54568535"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Pemesanan $pemesanan)
{
//
} | {
"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 |
verify decision return properties with default DecideOptions | public function verifyDecisionProperties(): void
{
$decision = $this->userContext->decideForKeys(FLAG_KEYS);
$this->printDecisions($decision, "Check that the following decisions' properties are expected");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }",
"public function testWithVariationsOfDecideOptions(): void\n {\n $options = [\n OptimizelyDecideOption::INCLUDE_REASONS,\n // OptimizelyDecideOption::DISABLE_DECISION_EVENT,\n // OptimizelyDecideOption::ENABLED_FLAGS_ONLY, // ⬅️ Disable some of your flags\n // OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE,\n // OptimizelyDecideOption::EXCLUDE_VARIABLES,\n ];\n\n $decision = $this->userContext->decide(FLAG_KEY, $options);\n\n $this->printDecision($decision, 'Modify the OptimizelyDecideOptions and check the decision variables expected');\n }",
"public function testWithVariationsOfDecideOptions(): void\n {\n $options = [\n OptimizelyDecideOption::INCLUDE_REASONS,\n // OptimizelyDecideOption::DISABLE_DECISION_EVENT,\n // OptimizelyDecideOption::ENABLED_FLAGS_ONLY, // ⬅️ Disable some of your flags\n // OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE,\n // OptimizelyDecideOption::EXCLUDE_VARIABLES,\n ];\n\n $decision = $this->userContext->decideForKeys(FLAG_KEYS, $options);\n\n $this->printDecisions($decision, \"Modify the OptimizelyDecideOptions and check all the decisions' are as expected\");\n }",
"public function testOptionRequirementsMet()\n {\n $option = new Option('f');\n $option->setNeeds('foo');\n $optionSet = array(\n 'foo' => new Option('foo')\n );\n\n $this->assertTrue($option->hasNeeds($optionSet));\n }",
"public function isOptions(): bool {}",
"public function hasOptions();",
"public function getRequiredOptions();",
"abstract public function getOptions();",
"protected function getOptions() {}",
"protected function getOptions() {}",
"protected function getOptions() {}",
"public function isApplicable();",
"protected function verifyAttributes()\n {\n $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']);\n $fixtureOptions = $this->prepareFixtureOptions();\n $errors = $this->verifyData($fixtureOptions, $formOptions, true, false);\n return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:');\n }",
"public function getDefinedOptions();",
"function testOptionsObjects(){\n\t\n\t\t#mdx:OptionsObjects\n\t\t$choice = new SimpleChoice(\"category\");\n\t\n\t\t$option1 = new StdClass();\n\t\t$option1->id = 1;\n\t\t$option1->name = 'Action';\n\t\n\t\t$option2 = new StdClass();\n\t\t$option2->id = 2;\n\t\t$option2->name = 'Drama';\n\n\t\t$choice->options([$option1, $option2])\n\t\t\t->context(['category'=>2]); // selects category 2\n\t\t\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"1 - Action\",\"$choice\");\n\t\t$this->assertContains(\"<b>2 - Drama\",\"$choice\");\n\n\t}",
"public function allowProperties() {}",
"abstract function options();",
"protected static abstract function getOptions();",
"public function setOptionsOnDetermination()\n\t{\n\t\treturn false;\n\t}",
"public function testConfigureOptions()\n {\n $multiLanguagesManager = $this->multiLanguagesManager;\n $resolverMock = Phake::mock('Symfony\\Component\\OptionsResolver\\OptionsResolver');\n\n $this->form->configureOptions($resolverMock);\n\n Phake::verify($resolverMock)->setDefaults(array(\n 'embedded' => true,\n 'class' => $this->statusClass,\n 'choice_label' => function ($choice) use ($multiLanguagesManager) {\n return $multiLanguagesManager->choose($choice->getLabels());\n },\n ));\n }",
"public function configureOptions();",
"function testOptionsFunction(){\n\t\t#mdx:OptionsFunction\n\t\t$choice = new SimpleChoice(\"category\");\n\t\t$choice->options(function(){\n\t\t\t// pretend this was fetched from the db\n\t\t\t$rows = [\n\t\t\t\t['id'=>1,'name'=>'Action'],\n\t\t\t\t['id'=>2,'name'=>'Drama'],\n\t\t\t\t['id'=>3,'name'=>'Sci-fi']\n\t\t\t];\n\n\t\t\treturn $rows;\n\n\t\t})->context(['category'=>3]); // selects category 3\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"<b>3 - Sci-fi\",\"$choice\");\n\n\t}",
"public function testGetStyleWithExhibitDefaults()\n {\n\n // Create a record.\n $exhibit = $this->_createNeatline();\n\n // Set system styling defaults.\n set_option('vector_color', '#5033de');\n set_option('stroke_color', '#1e2ee6');\n set_option('vector_opacity', 20);\n set_option('stroke_opacity', 70);\n set_option('stroke_width', 4);\n set_option('point_radius', 6);\n\n // Set exhibit defaults.\n $exhibit->default_vector_color = '#ffffff';\n $exhibit->default_stroke_color = '#ffffff';\n $exhibit->default_vector_opacity = 5;\n $exhibit->default_stroke_opacity = 5;\n $exhibit->default_stroke_width = 5;\n $exhibit->default_point_radius = 5;\n\n // Check.\n $this->assertEquals($exhibit->getStyle('vector_color'), '#ffffff');\n $this->assertEquals($exhibit->getStyle('vector_opacity'), 5);\n $this->assertEquals($exhibit->getStyle('stroke_color'), '#ffffff');\n $this->assertEquals($exhibit->getStyle('stroke_opacity'), 5);\n $this->assertEquals($exhibit->getStyle('stroke_width'), 5);\n $this->assertEquals($exhibit->getStyle('point_radius'), 5);\n\n }",
"protected function get_options()\n\t{}",
"public function testCustomOption() {\n // Add the boolean field handler to the test view.\n $view = Views::getView('test_view');\n $view->setDisplay();\n\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'age' => [\n 'id' => 'age',\n 'table' => 'views_test_data',\n 'field' => 'age',\n 'relationship' => 'none',\n 'plugin_id' => 'boolean',\n ],\n ]);\n $view->save();\n\n $this->executeView($view);\n\n $custom_true = 'Yay';\n $custom_false = 'Nay';\n\n // Set up some custom value mappings for different types.\n $custom_values = [\n 'plain' => [\n 'true' => $custom_true,\n 'false' => $custom_false,\n 'test' => 'assertStringContainsString',\n ],\n 'allowed tag' => [\n 'true' => '<p>' . $custom_true . '</p>',\n 'false' => '<p>' . $custom_false . '</p>',\n 'test' => 'assertStringContainsString',\n ],\n 'disallowed tag' => [\n 'true' => '<script>' . $custom_true . '</script>',\n 'false' => '<script>' . $custom_false . '</script>',\n 'test' => 'assertStringNotContainsString',\n ],\n ];\n\n // Run the same tests on each type.\n foreach ($custom_values as $type => $values) {\n $options = [\n 'options[type]' => 'custom',\n 'options[type_custom_true]' => $values['true'],\n 'options[type_custom_false]' => $values['false'],\n ];\n $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/field/age');\n $this->submitForm($options, 'Apply');\n\n // Save the view.\n $this->drupalGet('admin/structure/views/view/test_view');\n $this->submitForm([], 'Save');\n\n $view = Views::getView('test_view');\n $output = $view->preview();\n $output = \\Drupal::service('renderer')->renderRoot($output);\n $this->{$values['test']}($values['true'], (string) $output, new FormattableMarkup('Expected custom boolean TRUE value %value in output for %type', ['%value' => $values['true'], '%type' => $type]));\n $this->{$values['test']}($values['false'], (string) $output, new FormattableMarkup('Expected custom boolean FALSE value %value in output for %type', ['%value' => $values['false'], '%type' => $type]));\n }\n }",
"public function getOptions() {}",
"public function getOptions() {}",
"public function getOptions() {}",
"function testOptionsTuples(){\n\t\t#mdx:OptionsTuples\n\t\t$choice = new SimpleChoice(\"category\");\n\t\t$choice->options([[1,'Action'],[2,'Drama'],[3,'Sci-fi']]);\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"1 - Action\",\"$choice\");\n\n\t}",
"function get_question_options(&$question) {\n global $CFG, $DB;\n if (!$question->options->answers = $DB->get_records_sql(\n \"SELECT a.*, c.tolerance, c.tolerancetype, c.correctanswerlength, c.correctanswerformat \" .\n \"FROM {question_answers} a, \" .\n \" {question_calculated} c \" .\n \"WHERE a.question = ? \" .\n \"AND a.id = c.answer \".\n \"ORDER BY a.id ASC\", array($question->id))) {\n notify('Error: Missing question answer for calculated question ' . $question->id . '!');\n return false;\n }\n\n/*\n if(false === parent::get_question_options($question)) {\n return false;\n }\n\n if (!$options = $DB->get_records('question_calculated', array('question' => $question->id))) {\n notify(\"No options were found for calculated question\n #{$question->id}! Proceeding with defaults.\");\n // $options = new Array();\n $options= new stdClass;\n $options->tolerance = 0.01;\n $options->tolerancetype = 1; // relative\n $options->correctanswerlength = 2;\n $options->correctanswerformat = 1; // decimals\n }\n\n // For historic reasons we also need these fields in the answer objects.\n // This should eventually be removed and related code changed to use\n // the values in $question->options instead.\n foreach ($question->options->answers as $key => $answer) {\n $answer = &$question->options->answers[$key]; // for PHP 4.x\n $answer->calcid = $options->id;\n $answer->tolerance = $options->tolerance;\n $answer->tolerancetype = $options->tolerancetype;\n $answer->correctanswerlength = $options->correctanswerlength;\n $answer->correctanswerformat = $options->correctanswerformat;\n }*/\n\n $virtualqtype = $this->get_virtual_qtype();\n $virtualqtype->get_numerical_units($question);\n\n if( isset($question->export_process)&&$question->export_process){\n $question->options->datasets = $this->get_datasets_for_export($question);\n }\n return true;\n }",
"public function canConfigure()\n {\n $options = $this->getOptions();\n return !empty($options) || $this->getTypeInstance(true)->canConfigure($this);\n }",
"public function getSomeOption() {}",
"public function testGetUserOptions()\n\t{\n\t}",
"private function _passed_config_test() {\n\t\tif ( ! is_subclass_of( $this, 'SN_Type_Base' ) )\n\t\t\treturn false;\n\n\t\t$errors = array();\n\t\t$required_properties = array(\n\t\t\t'post_type' => $this->post_type,\n\t\t\t'post_type_title' => $this->post_type_title,\n\t\t\t'post_type_single' => $this->post_type_single,\n\t\t);\n\n\t\tforeach ( $required_properties as $property_name => $property ) {\n\t\t\tif ( is_null( $property ) )\n\t\t\t\t$errors[] = \"Property {$property_name} has not been set in your sub-class.\\n\";\n\t\t} // foreach()\n\n\t\tif ( empty( $errors ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach ( $errors as $error )\n\t\t\t\techo esc_html( $error );\n\t\t} // if/each()\n\n\t\treturn false;\n\t}",
"function testOptionsFunction2(){\n\n\t\t#mdx:OptionsFunction2\n\t\t$choice = new SimpleChoice(\"category\");\n\t\t$choice->options(function(){\n\t\t\t// return a function which returns an associative array:\n\t\t\treturn function(){\n\t\t\t\treturn [1=>'Category A',2=>'Category B',3=>'Category C'];\n\t\t\t};\n\t\t});\n\n\t\t$choice->context(['category'=>2]); // selects category 2\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"<b>2\",\"$choice\");\n\n\t}",
"public function testIsApplicable(): void\n {\n $this->assertTrue($this->createProvider(false)->isApplicable());\n }",
"protected function defineOptions() {\n return parent::defineOptions();\n }",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function testChoicesConfiguration()\n {\n /** @var ChoicesAwareViewData $result */\n $result = $this->getContainer()->get('ongr_filter_manager.foo_filters')\n ->handleRequest(new Request())->getFilters()['single_choice'];\n\n $expectedChoices = [\n 'red',\n 'blue',\n 'green',\n ];\n\n $actualChoices = [];\n\n foreach ($result->getChoices() as $choice) {\n $actualChoices[] = $choice->getLabel();\n }\n\n $this->assertEquals($expectedChoices, $actualChoices);\n }",
"protected function useDefaultValuesForNotConfiguredOptions() {}",
"public function options() {}",
"function testCheckOptionsList() {\n // B: Is not mandatory, must not be null, no validator.\n // V1: Is not mandatory, must not be null, validator.\n\n // C: Is mandatory, may be null, no validator.\n // D: Is mandatory, must not be null, no validator.\n // V2: Is mandatory, must not be null, validator.\n\n // -------------------------------------------------------------------------------------------------------------\n // Test without validator.\n // -------------------------------------------------------------------------------------------------------------\n\n // A, B and V1 are not mandatory.\n $list = ['C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertTrue($this->__set->check($list));\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n // A may be null.\n // B and V1 are not mandatory.\n $list = ['A' => null, 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertTrue($this->__set->check($list));\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n $list = ['A' => 1, 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertTrue($this->__set->check($list));\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n // A may be null.\n // B must not be null.\n $list = ['A' => null, 'B' => 1, 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertTrue($this->__set->check($list)); // V1 is not mandatory.\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n $list = ['A' => null, 'B' => null, 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertFalse($this->__set->check($list)); // B is not valid.\n $this->assertCount(1, $this->__set->getErrorsOnInputsInIsolationFromTheOthers());\n $this->assertTrue($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n\n // A may be null.\n // B must not be null.\n // V1 must be \"A|B|C\".\n $list = ['A' => null, 'B' => 1, 'V1' => 'B', 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertTrue($this->__set->check($list));\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n $list = ['A' => null, 'B' => 1, 'V1' => 'D', 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertFalse($this->__set->check($list)); // V1 is not valid\n $this->assertCount(1, $this->__set->getErrorsOnInputsInIsolationFromTheOthers());\n $this->assertTrue($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n $list = ['A' => null, 'B' => null, 'V1' => 'D', 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertFalse($this->__set->check($list)); // V1 and B are not valid\n $this->assertCount(2, $this->__set->getErrorsOnInputsInIsolationFromTheOthers());\n $this->assertTrue($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n // C is mandatory.\n // D is mandatory.\n // V2 is mandatory.\n $list = ['A' => null, 'B' => 1, 'V1' => 'B'];\n $this->assertFalse($this->__set->check($list));\n $this->assertCount(3, $this->__set->getErrorsOnInputsInIsolationFromTheOthers()); // C, D, V2 are not valid.\n $this->assertTrue($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n // C is mandatory.\n // D must not be null.\n // V2 is mandatory.\n $list = ['A' => null, 'B' => 1, 'V1' => 'B', 'D' => null];\n $this->assertFalse($this->__set->check($list));\n $this->assertCount(3, $this->__set->getErrorsOnInputsInIsolationFromTheOthers()); // C, D, V2 are not valid.\n $this->assertTrue($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n // -------------------------------------------------------------------------------------------------------------\n // Test with validator.\n // -------------------------------------------------------------------------------------------------------------\n\n $validator = function($inInputs) {\n if (array_key_exists('A', $inInputs) && array_key_exists('B', $inInputs)) {\n if (is_int($inInputs['A']) && is_int($inInputs['B'])) {\n return [];\n }\n return [\"A and B must be integers!\"];\n }\n return [];\n };\n\n $this->__set->setValidator($validator);\n\n // A may be null.\n // B must not be null.\n // But, if A and B are simultaneously defined, then they must be integers => check will fail.\n $list = ['A' => null, 'B' => 1, 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertFalse($this->__set->check($list));\n $this->assertCount(0, $this->__set->getErrorsOnInputsInIsolationFromTheOthers()); // No error on parameters.\n $this->assertCount(1, $this->__set->getErrorsOnFinalValidation()); // But the final test fails.\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertTrue($this->__set->hasErrorsOnFinalValidation());\n\n // A may be null.\n // B must not be null.\n // A and B are integers => the check will succeed.\n $list = ['A' => 10, 'B' => 1, 'C' => null, 'D' => 10, 'V2' => 'A'];\n $this->assertTrue($this->__set->check($list));\n $this->assertFalse($this->__set->hasErrorsOnInputsInIsolationFromTheOthers());\n $this->assertFalse($this->__set->hasErrorsOnFinalValidation());\n\n }",
"public function testGetStyleWithoutExhibitDefaults()\n {\n\n // Create a record.\n $exhibit = $this->_createNeatline();\n\n // Set system styling defaults.\n set_option('vector_color', '#5033de');\n set_option('stroke_color', '#1e2ee6');\n set_option('vector_opacity', 20);\n set_option('stroke_opacity', 70);\n set_option('stroke_width', 4);\n set_option('point_radius', 6);\n\n // Check.\n $this->assertEquals($exhibit->getStyle('vector_color'), '#5033de');\n $this->assertEquals($exhibit->getStyle('vector_opacity'), 20);\n $this->assertEquals($exhibit->getStyle('stroke_color'), '#1e2ee6');\n $this->assertEquals($exhibit->getStyle('stroke_opacity'), 70);\n $this->assertEquals($exhibit->getStyle('stroke_width'), 4);\n $this->assertEquals($exhibit->getStyle('point_radius'), 6);\n\n }",
"public function getExpectedDefaults();",
"abstract function fields_options();",
"public function isMenuValidValidMenuWithDefaultsExpectTrue() {}",
"abstract protected function options(): array;",
"public function testConsentRejected()\n {\n $expected = 'do not use';\n $actual = $this->object->getConsentRejected();\n $this->assertEquals($expected, $actual);\n\n //Check if we can read from an altered ini file\n $project = $this->project;\n $expected = 'test';\n $project->consentRejected = $expected;\n $actual = $this->object->getConsentRejected();\n $this->assertEquals($expected, $actual);\n\n //Check for class default when not found in ini\n unset($project->consentRejected);\n $expected = 'do not use';\n $actual = $this->object->getConsentRejected();\n $this->assertEquals($expected, $actual);\n }",
"protected static function allowedOptions()\n\t{\n\t\treturn parent::allowedOptions();\n\t}",
"public function test__GetOptions()\n\t{\n\t\t$this->assertThat(\n\t\t\t$this->object->objects->optionss3,\n\t\t\t$this->isInstanceOf('JAmazons3OperationsObjectsOptionss3')\n\t\t);\n\t}",
"public function checkProperties($conditions);",
"public function testConsentTypes()\n {\n $expected = array(\n 'do not use' => 'do not use',\n 'consent given' => 'consent given'\n );\n $actual = $this->object->getConsentTypes();\n $this->assertEquals($expected, $actual);\n\n //Check if we can read from an altered ini file\n $project = $this->project;\n $project->consentTypes = 'test|test2|test3';\n $expected = array(\n 'test' => 'test',\n 'test2' => 'test2',\n 'test3' => 'test3',\n );\n $actual = $this->object->getConsentTypes();\n $this->assertEquals($expected, $actual);\n\n //Check for class default when not found in ini\n unset($project->consentTypes);\n $expected = array(\n 'do not use' => 'do not use',\n 'consent given' => 'consent given'\n );\n $actual = $this->object->getConsentTypes();\n $this->assertEquals($expected, $actual);\n }",
"function option_definition() {\r\n $options = parent::option_definition();\r\n $options['allow']['contains']['expose_imagestyle'] = array('default' => FALSE);\r\n\r\n return $options;\r\n }",
"function bb_mystique_verify_options() {\r\n\tif( !$current_settings = bb_get_mystique_options() )\r\n\t\tbb_mystique_setup_options();\r\n\t\r\n\tdo_action( 'bb_mystique_verify_options' );\r\n}",
"public function getOptions()\r\n {\r\n }",
"public function get_options()\n {\n }",
"function getOptionsSupported() {\n\t\treturn array(\tgettext('Attempt threshold') => array('key' => 'failed_access_blocker_attempt_threshold', 'type' => OPTION_TYPE_TEXTBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('Admin page requests will be ignored after this many failed tries.')),\n\t\t\t\t\t\t\t\t\tgettext('Minutes to cool off') =>array('key' => 'failed_access_blocker_timeout', 'type' => OPTION_TYPE_TEXTBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('The block will be removed after this waiting period.'))\n\t\t);\n\t}",
"function plugin_validate_options($opts){ \t\r\n\t\treturn $opts;\r\n\t}",
"function testOptionsRows(){\n\t\t#mdx:OptionsRows\n\t\t$choice = new SimpleChoice(\"category\");\n\t\t$choice->options([\n\t\t\t['id'=>1,'name'=>'Action'],\n\t\t\t['id'=>2,'name'=>'Drama'],\n\t\t\t['id'=>3,'name'=>'Sci-fi']\n\t\t])->context(['category'=>2]); // selects category 2\n\t\t\n\t\t#/mdx echo $choice\n\t\t$this->assertContains(\"1 - Action\",\"$choice\");\n\t\t$this->assertContains(\"<b>2 - Drama\",\"$choice\");\n\n\t}",
"public function test_getOptions_returnsArray_ifOptionsDoExist()\n\t{\n\t\t$options = [CURLOPT_AUTOREFERER => true];\n\t\t\n\t\t$request = new Post('http://example.com');\n\t\t$request->setOptions($options);\n\t\t\n\t\t$this->assertEquals($options, $request->getOptions());\n\t\t\n\t\treturn;\n\t}",
"public function view_option()\n{\n\t//option included, excluded\n\treturn \"excluded\";\n}",
"public function view_option()\n{\n\t//option included, excluded\n\treturn \"excluded\";\n}",
"protected function configure()\n {\n parent::configure();\n $this->options->mustHave('class');\n }",
"abstract public function getValidateDesc();",
"public function options();",
"public function options();",
"public function options();",
"public function options();",
"public function options();",
"public function testCustomOptionTemplate() {\n // Install theme to test with template system.\n \\Drupal::service('theme_installer')->install(['views_test_theme']);\n\n // Set the default theme for Views preview.\n $this->config('system.theme')\n ->set('default', 'views_test_theme')\n ->save();\n $this->assertEquals('views_test_theme', $this->config('system.theme')->get('default'));\n\n // Add the boolean field handler to the test view.\n $view = Views::getView('test_view');\n $view->setDisplay();\n\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'age' => [\n 'id' => 'age',\n 'table' => 'views_test_data',\n 'field' => 'age',\n 'relationship' => 'none',\n 'plugin_id' => 'boolean',\n ],\n ]);\n $view->save();\n\n $this->executeView($view);\n\n $custom_true = 'Yay';\n $custom_false = 'Nay';\n\n // Set up some custom value mappings for different types.\n $custom_values = [\n 'plain' => [\n 'true' => $custom_true,\n 'false' => $custom_false,\n 'test' => 'assertStringContainsString',\n ],\n 'allowed tag' => [\n 'true' => '<p>' . $custom_true . '</p>',\n 'false' => '<p>' . $custom_false . '</p>',\n 'test' => 'assertStringContainsString',\n ],\n 'disallowed tag' => [\n 'true' => '<script>' . $custom_true . '</script>',\n 'false' => '<script>' . $custom_false . '</script>',\n 'test' => 'assertStringNotContainsString',\n ],\n ];\n\n // Run the same tests on each type.\n foreach ($custom_values as $type => $values) {\n $options = [\n 'options[type]' => 'custom',\n 'options[type_custom_true]' => $values['true'],\n 'options[type_custom_false]' => $values['false'],\n ];\n $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/field/age');\n $this->submitForm($options, 'Apply');\n\n // Save the view.\n $this->drupalGet('admin/structure/views/view/test_view');\n $this->submitForm([], 'Save');\n\n $view = Views::getView('test_view');\n $output = $view->preview();\n $output = \\Drupal::service('renderer')->renderRoot($output);\n $this->{$values['test']}($values['true'], (string) $output, new FormattableMarkup('Expected custom boolean TRUE value %value in output for %type', ['%value' => $values['true'], '%type' => $type]));\n $this->{$values['test']}($values['false'], (string) $output, new FormattableMarkup('Expected custom boolean FALSE value %value in output for %type', ['%value' => $values['false'], '%type' => $type]));\n\n // Assert that we are using the correct template.\n $this->assertStringContainsString('llama', (string) $output);\n }\n }",
"public function testSetRequired()\n {\n $option = new Option('f');\n $option->setNeeds('foo');\n\n $this->assertTrue(in_array('foo', $option->getNeeds()));\n }",
"public function isOptions()\n\t{\n\t\treturn $this->httpMethod() == self::MethodOptions;\n\t}",
"public function testIsValidSuccessWithoutInvokedSetter()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $this->assertTrue($validator->isValid($this->_object));\n }",
"protected function _getDefaultOptions()\n {\n }",
"public function hasOption(){\n return $this->_has(35);\n }",
"function mfcs_get_reviewer_decision_list_options($option = NULL, $restriction = 0, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n $options_all = array();\n\n if ($hidden) {\n $options_all[MFCS_REVIEW_DECISION_NONE] = 'None';\n $options_all[MFCS_REVIEW_DECISION_CLOSE] = 'Close';\n $options_all[MFCS_REVIEW_DECISION_CANCEL] = 'Cancel';\n $options_all[MFCS_REVIEW_DECISION_UNCANCEL] = 'Uncancel';\n $options_all[MFCS_REVIEW_DECISION_REASSIGN_COORDINATOR] = 'Re-Assign Venue Coordinator';\n $options_all[MFCS_REVIEW_DECISION_OVERRIDE] = 'Override';\n $options_all[MFCS_REVIEW_DECISION_MOVE] = 'Move';\n $options_all[MFCS_REVIEW_DECISION_REASSIGN_REQUESTER] = 'Re-Assign Requester';\n $options_all[MFCS_REVIEW_DECISION_MANAGER_RECHECK] = 'Manager Recheck';\n $options_all[MFCS_REVIEW_DECISION_AMENDMENT] = 'Amendment';\n }\n\n if ($disabled) {\n $options_all[MFCS_REVIEW_DECISION_WAIVE] = 'Waive';\n }\n\n $options_all[MFCS_REVIEW_DECISION_APPROVE] = 'Approve';\n $options_all[MFCS_REVIEW_DECISION_COMMENT] = 'Comment';\n $options_all[MFCS_REVIEW_DECISION_COMMENT_ALL] = 'Comment';\n $options_all[MFCS_REVIEW_DECISION_DENY] = 'Deny';\n $options_all[MFCS_REVIEW_DECISION_REQUIREMENT] = 'Requirement';\n $options_all[MFCS_REVIEW_DECISION_AVAILABLE] = 'Available';\n $options_all[MFCS_REVIEW_DECISION_UNAVAILABLE] = 'Unavailable';\n $options_all[MFCS_REVIEW_DECISION_ISSUES] = 'Issues';\n $options_all[MFCS_REVIEW_DECISION_ISSUES_NONE] = 'No Issues';\n\n if ($option == 'select' || $option == 'review_step') {\n $options[''] = '- Select -';\n }\n\n if (!is_int($restriction)) {\n $restriction = MFCS_RESTRICTION_DECISION_NONE;\n }\n\n if ($restriction == MFCS_RESTRICTION_DECISION_NONE) {\n foreach ($options_all as $option_id => $option_name) {\n $options[$option_id] = $option_name;\n }\n\n // these options are hidden from the users.\n if ($option == 'review_step') {\n unset($options[MFCS_REVIEW_DECISION_AMENDMENT]);\n unset($options[MFCS_REVIEW_DECISION_WAIVE]);\n }\n\n asort($options);\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_REQUESTER) {\n if (array_key_exists(MFCS_REVIEW_DECISION_COMMENT_ALL, $options_all)) {\n $options[MFCS_REVIEW_DECISION_COMMENT_ALL] = $options_all[MFCS_REVIEW_DECISION_COMMENT_ALL];\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_VENUE_COORDINATOR) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_REVIEWER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_APPROVER) {\n foreach (array(MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_MANAGER) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_REQUIREMENT, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_ADMINISTER) {\n foreach (array(MFCS_REVIEW_DECISION_AVAILABLE, MFCS_REVIEW_DECISION_UNAVAILABLE, MFCS_REVIEW_DECISION_APPROVE, MFCS_REVIEW_DECISION_DENY, MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_REQUIREMENT, MFCS_REVIEW_DECISION_COMMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_COMMENT_ONLY) {\n if (array_key_exists(MFCS_REVIEW_DECISION_COMMENT, $options_all)) {\n $options[MFCS_REVIEW_DECISION_COMMENT] = $options_all[MFCS_REVIEW_DECISION_COMMENT];\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_FINANCER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n elseif ($restriction == MFCS_RESTRICTION_DECISION_INSURER) {\n foreach (array(MFCS_REVIEW_DECISION_ISSUES, MFCS_REVIEW_DECISION_ISSUES_NONE, MFCS_REVIEW_DECISION_COMMENT, MFCS_REVIEW_DECISION_REQUIREMENT) as $option_id) {\n if (array_key_exists($option_id, $options_all)) {\n $options[$option_id] = $options_all[$option_id];\n }\n }\n }\n\n\n return $options;\n}",
"#[Pure]\n public function getOptions() {}",
"function assert_options(int $what, $value = null)\n{\n error_clear_last();\n if ($value !== null) {\n $safeResult = \\assert_options($what, $value);\n } else {\n $safeResult = \\assert_options($what);\n }\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n return $safeResult;\n}",
"public static function isApplicable(): bool;",
"public function createApplicableChecker();",
"protected function setUp()\n {\n// $this->validOptions = array(\n// 'checksum' => true,\n// 'delete'\n// );\n }",
"protected function defineCommandOptions(){}",
"public function getCriteria()\n {\n $this->assertEquals(array(), $this->denyValidator->getCriteria());\n }",
"public function testValidateOptions(): void\n {\n $commandLineOptions = [\n CommandLineOptions::FILE_NAME_LONG_OPTION => 'tests/unit/resources/example-input.txt',\n CommandLineOptions::DAY_LONG_OPTION => '11/11/18',\n CommandLineOptions::TIME_LONG_OPTION => '11:00',\n CommandLineOptions::LOCATION_LONG_OPTION => 'NW43QB',\n CommandLineOptions::COVERS_LONG_OPTION => '20'\n ];\n\n $validOptions = $this->mCommandLineOptions->validateOptions($commandLineOptions);\n $this->assertTrue($validOptions);\n }",
"public function testDefinition(){\n\n $message = null;\n $go = new Getopt(null, function($msg)use(&$message){ $message = $msg;}, function(){});\n\n //test default\n $testOpt = array(\n 'arg'=>'test1',\n 'default'=>'this is my default'\n );\n $go->setOption($testOpt);\n $go->parse();\n $this->assertEquals($testOpt['default'], $go->test1);\n\n //test required\n $testOpt = array(\n 'arg'=>'test2',\n 'required'=>true,\n 'requiredMsg'=>'hello required'\n );\n $go->clearOptions();\n $go->setOption($testOpt);\n $go->parse();\n $this->assertEquals($testOpt['requiredMsg'], $message);\n\n //test pattern\n $testOpt = array(\n 'arg'=>'test3',\n 'pattern'=>'/\\d{2}/',\n 'patternMsg'=>'Has to be two digit'\n );\n $go->clearOptions();\n $go->setOption($testOpt);\n $_SERVER['argv'] = array(\n 'script_name.php',\n '--test3',\n 'ok'\n );\n $go->parse();\n $this->assertEquals($testOpt['patternMsg'], $message);\n\n $message = null;\n $_SERVER['argv'] = array(\n 'script_name.php',\n '--test3',\n '21'\n );\n $go->parse();\n $this->assertNull($message);\n\n\n }"
] | [
"0.6884443",
"0.6582804",
"0.6464693",
"0.6014043",
"0.5980335",
"0.59020895",
"0.5901666",
"0.5810843",
"0.5728704",
"0.5728704",
"0.57277966",
"0.57088506",
"0.56850916",
"0.56738955",
"0.56359315",
"0.5608676",
"0.560469",
"0.5578333",
"0.5542859",
"0.55338025",
"0.54793936",
"0.5478155",
"0.54558945",
"0.54444385",
"0.54443794",
"0.54097927",
"0.54097927",
"0.5409291",
"0.54002005",
"0.53889865",
"0.5365751",
"0.5318729",
"0.5318327",
"0.53086567",
"0.5308439",
"0.52819294",
"0.5276858",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.5261936",
"0.52504426",
"0.5244364",
"0.5237347",
"0.5231505",
"0.522618",
"0.5211222",
"0.52061355",
"0.5202027",
"0.520189",
"0.5199691",
"0.51966757",
"0.5196406",
"0.51890373",
"0.5185127",
"0.5170926",
"0.51698065",
"0.51670945",
"0.5166585",
"0.51566607",
"0.515035",
"0.5148264",
"0.514726",
"0.5140994",
"0.5140994",
"0.5140758",
"0.51358336",
"0.51308256",
"0.51308256",
"0.51308256",
"0.51308256",
"0.51308256",
"0.5122904",
"0.5108349",
"0.50982785",
"0.50893897",
"0.50891864",
"0.5086347",
"0.50831485",
"0.50794536",
"0.5062844",
"0.5056873",
"0.504427",
"0.50439966",
"0.5041702",
"0.50373054",
"0.5026657",
"0.50264275"
] | 0.6825259 | 1 |
test decide w all options: DISABLE_DECISION_EVENT, ENABLED_FLAGS_ONLY, IGNORE_USER_PROFILE_SERVICE, INCLUDE_REASONS, EXCLUDE_VARIABLES (will need to add variables) | public function testWithVariationsOfDecideOptions(): void
{
$options = [
OptimizelyDecideOption::INCLUDE_REASONS,
// OptimizelyDecideOption::DISABLE_DECISION_EVENT,
// OptimizelyDecideOption::ENABLED_FLAGS_ONLY, // ⬅️ Disable some of your flags
// OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE,
// OptimizelyDecideOption::EXCLUDE_VARIABLES,
];
$decision = $this->userContext->decideForKeys(FLAG_KEYS, $options);
$this->printDecisions($decision, "Modify the OptimizelyDecideOptions and check all the decisions' are as expected");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testWithVariationsOfDecideOptions(): void\n {\n $options = [\n OptimizelyDecideOption::INCLUDE_REASONS,\n // OptimizelyDecideOption::DISABLE_DECISION_EVENT,\n // OptimizelyDecideOption::ENABLED_FLAGS_ONLY, // ⬅️ Disable some of your flags\n // OptimizelyDecideOption::IGNORE_USER_PROFILE_SERVICE,\n // OptimizelyDecideOption::EXCLUDE_VARIABLES,\n ];\n\n $decision = $this->userContext->decide(FLAG_KEY, $options);\n\n $this->printDecision($decision, 'Modify the OptimizelyDecideOptions and check the decision variables expected');\n }",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function testEnabled(): void\n {\n $agentWithoutEnabling = $this->agentFromConfigArray();\n self::assertFalse($agentWithoutEnabling->enabled());\n\n // but a config that has monitor = true, it is set\n $enabledAgent = $this->agentFromConfigArray([ConfigKey::MONITORING_ENABLED => 'true']);\n self::assertTrue($enabledAgent->enabled());\n }",
"public function simulateEnabledMatchAllConditionsSucceeds() {}",
"public function simulateEnabledMatchAllConditionsSucceeds() {}",
"protected function checkDisableFunctions() {}",
"public function test_filters_automatic_updater_disabled()\n {\n }",
"public function testTroubleshootingModeDisabledNoCookie() {\n\t\t$this->assertFalse( $this->class_instance->is_troubleshooting() );\n\t}",
"function skip() \n{\n\tif ((function_exists(\"zperfmon_enable\") && \n\t\tfunction_exists(\"zperfmon_set_user_param\") &&\n\t\tfunction_exists(\"zperfmon_disable\"))) {\n\t\treturn false; //zperfmon-client has those\n\t} \n\treturn true;\n}",
"public function testDisabled() {\n Data::setOption('safe', 'MarkSafe() > value');\n\n $listener = new PatternLabListener();\n $listener->processSafeData();\n\n $safe = Data::getOption('safe');\n $this->assertSame('MarkSafe() > value', $safe);\n }",
"#[@test]\n public function reasonOnly() {\n $action= $this->parseCommandSetFrom('\n if true { \n vacation \"Out of office\";\n }\n ')->commandAt(0)->commands[0];\n $this->assertClass($action, 'peer.sieve.action.VacationAction');\n $this->assertEquals('Out of office', $action->reason);\n }",
"function before_enable() { }",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decideForKeys(FLAG_KEYS);\n\n $this->printDecisions($decision, \"Check that the following decisions' properties are expected\");\n }",
"public function testBasicFeatures()\n {\n return $this->doTheRealTest(false);\n }",
"function getEnableFieldsToBeIgnored() ;",
"function configurationTestRules(&$deviceInfo, $ruleOverride = false) {\n if (is_string($ruleOverride)) $rules[] = $ruleOverride;\n else $rules = getSettingsValue(SETTING_CATEGORY_CONFIGMGMT, \"rules\",[]);\n\n foreach ($rules as $rule) {\n $rule = strtolower($rule);\n\n $a = explode(\" run \",$rule);\n $rLogic = $a[0];\n $rScript = isset($a[1])?$a[1]:\"not set\";\n //print_r($a);\n\n if ($rScript != \"\") {\n //parse the logic\n $logicPassed = true; //AND comparing this so it must start true\n foreach (explode(\" and \",$rLogic) as $rAnd) {\n $blockPassed = false; //OR comparing this so it must start false\n foreach (explode(\" or \",$rAnd) as $rOr) {\n //test the contains block\n $c = explode(\" contains \", $rOr);\n $c[0] = trim($c[0],' \"\\'');\n $devText = isset($deviceInfo[$c[0]])?strtolower($deviceInfo[$c[0]]):\"\";\n $devSearch = isset($c[1])?trim($c[1],' \"\\''):\"\";\n $test = ($devSearch==\"\")?false:is_numeric(strpos($devText,$devSearch));\n\n //see if we're testing an OR block or an AND block\n if (count($rOr)>0) $blockPassed = $blockPassed || $test; //we have an or statement\n else $blockPassed = $test;\n\n //echo \"[$rOr] = $blockPassed\\ndevText = [$devText]\\ndevSearch = [$devSearch]\";\n }\n $logicPassed = $logicPassed && $blockPassed;\n }\n\n //done testing logic, if we have a winner then lets return it\n if ($logicPassed) return trim($rScript);\n }\n\n }\n\n //no rules were found that matched, return nothing\n return \"\";\n\n}",
"public function testGetUserOptions()\n\t{\n\t}",
"public function testSkipIfTrue(): void\n {\n $this->skipIf(true);\n }",
"public function testconfig_vars()\n\t{\n\t\t$vars = array ('sys_name',\n\t\t\t 'sys_user_reg_restricted',\n\t\t\t 'sys_require_accept_conditions',\n\t\t\t 'sys_project_reg_restricted',\n\t\t\t 'sys_use_private_project',\n\t\t\t 'sys_default_domain',\n\t\t\t 'sys_scm_tarballs_path',\n\t\t\t 'sys_scm_snapshots_path',\n\t\t\t 'sys_theme',\n\t\t\t 'sys_lang',\n\t\t\t 'sys_default_timezone',\n\t\t\t 'sys_default_country_code',\n\t\t\t 'sys_use_scm',\n\t\t\t 'sys_use_tracker',\n\t\t\t 'sys_use_forum',\n\t\t\t 'sys_use_pm',\n\t\t\t 'sys_use_docman',\n\t\t\t 'sys_use_diary',\n\t\t\t 'sys_use_news',\n\t\t\t 'sys_use_mail',\n\t\t\t 'sys_use_survey',\n\t\t\t 'sys_use_frs',\n\t\t\t 'sys_use_project_tags',\n\t\t\t 'sys_use_project_full_list',\n\t\t\t 'sys_use_fti',\n\t\t\t 'sys_use_ftp',\n\t\t\t 'sys_use_trove',\n\t\t\t 'sys_use_snippet',\n\t\t\t 'sys_use_ssl',\n\t\t\t 'sys_use_people',\n\t\t\t 'sys_use_shell',\n\t\t\t 'sys_use_ratings',\n\t\t\t 'sys_use_ftpuploads',\n\t\t\t 'sys_use_manual_uploads',\n\t\t\t 'sys_use_gateways',\n\t\t\t 'sys_use_project_vhost',\n\t\t\t 'sys_use_project_database',\n\t\t\t 'sys_use_project_multimedia',\n\t\t\t 'sys_download_host',\n\t\t\t 'sys_shell_host',\n\t\t\t 'sys_users_host',\n\t\t\t 'sys_lists_host',\n\t\t\t 'sys_scm_host',\n\t\t\t 'sys_forum_return_domain',\n\t\t\t 'sys_chroot',\n\t\t\t 'sys_upload_dir',\n\t\t\t 'sys_ftp_upload_dir',\n\t\t\t 'sys_ftp_upload_host',\n\t\t\t 'sys_apache_user',\n\t\t\t 'sys_apache_group',\n\t\t\t 'sys_require_unique_email',\n\t\t\t 'sys_bcc_all_email_address',\n\t\t\t 'sys_themeroot',\n\t\t\t 'sys_force_login',\n\t\t\t 'sys_custom_path',\n\t\t\t 'sys_plugins_path',\n\t\t\t 'sys_use_jabber',\n\t\t\t 'sys_jabber_user',\n\t\t\t 'sys_jabber_server',\n\t\t\t 'sys_jabber_port',\n\t\t\t 'sys_jabber_pass',\n\t\t\t 'sys_ldap_host',\n\t\t\t 'sys_ldap_port',\n\t\t\t 'sys_ldap_version',\n\t\t\t 'sys_ldap_base_dn',\n\t\t\t 'sys_ldap_bind_dn',\n\t\t\t 'sys_ldap_admin_dn',\n\t\t\t 'sys_ldap_passwd',\n\t\t\t 'sys_news_group',\n\t\t\t 'sys_stats_group',\n\t\t\t 'sys_peer_rating_group',\n\t\t\t 'sys_template_group',\n\t\t\t 'sys_sendmail_path',\n\t\t\t 'sys_path_to_mailman',\n\t\t\t 'sys_path_to_jpgraph',\n\t\t\t 'sys_account_manager_type',\n\t\t\t 'unix_cipher',\n\t\t\t 'homedir_prefix',\n\t\t\t 'groupdir_prefix',\n\t\t\t 'sys_urlroot',\n\t\t\t 'sys_urlprefix',\n\t\t\t 'sys_images_url',\n\t\t\t 'sys_images_secure_url',\n\t\t\t 'sys_admin_email',\n\t\t\t 'sys_session_key',\n\t\t\t 'sys_session_expire',\n\t\t\t 'sys_show_source',\n\t\t\t 'default_trove_cat',\n\t\t\t 'sys_dbhost',\n\t\t\t 'sys_dbport',\n\t\t\t 'sys_dbname',\n\t\t\t 'sys_dbuser',\n\t\t\t 'sys_dbpasswd',\n\t\t\t 'sys_share_path',\n\t\t\t 'sys_var_path',\n\t\t\t 'sys_etc_path',\n\t\t\t) ;\n\n\t\t$pattern = implode ('|', $vars) ;\n\t\t\n\t\t$root = dirname(dirname(dirname(dirname(__FILE__))));\n\t\t$output = `cd $root ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\\$($pattern)\\b(?! *=[^=])' \\\n\t\t\t\t\t | grep -v ^src/common/include/config-vars.php`;\n\t\t$this->assertEquals('', $output, \"Found deprecated \\$var for var in ($pattern):\");\n\n\t\t$output = `cd $root ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\\\\$GLOBALS\\\\[.?($pattern).?\\\\](?! *=[^=])' \\\n\t\t\t\t\t | grep -v ^src/common/include/config-vars.php`;\n\t\t$this->assertEquals('', $output, \"Found deprecated \\$GLOBALS['\\$var'] for var in ($pattern):\");\n\t}",
"public function testListTaskVariables()\n {\n }",
"public function getEnableFieldsToBeIgnored() {}",
"protected function addTestOptions()\n {\n foreach (['test' => 'PHPUnit', 'pest' => 'Pest'] as $option => $name) {\n $this->getDefinition()->addOption(new InputOption(\n $option,\n null,\n InputOption::VALUE_NONE,\n \"Generate an accompanying {$name} test for the {$this->type}\"\n ));\n }\n }",
"public function executeDisabled()\n {\n }",
"public function isTestMode(): bool;",
"public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}",
"public function maybe_add_is_in_visible_test_mode_option() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11', '<' ) ) {\n return;\n }\n\n if ( get_option( 'laterpay_is_in_visible_test_mode' ) === false ) {\n add_option( 'laterpay_is_in_visible_test_mode', 0 );\n }\n }",
"function validate_plugin_accessibility(){\n\n $final_response=new stdClass();\n if( $GLOBALS['glbstg_plugenabled']==0 or $GLOBALS['glbstg_plugenabled']==\"0\" or $GLOBALS['glbstg_plugenabled']==\"\"){\n\n $final_response->response_notice=\"X5GON plugin is not enabled. Check with admin.\";\n }else{\n $final_response->response_notice=1;\n }\n\n return $final_response;\n }",
"public function isApplicable();",
"public function testNotRun(\\unittest\\TestSkipped $ignore) {\n $this->stats['notrun']++;\n }",
"function give_test_mode_frontend_warning() {\n\n\tif ( give_is_test_mode() ) {\n\t\techo '<div class=\"give_error give_warning\" id=\"give_error_test_mode\"><p><strong>' . esc_html__( 'Notice:', 'give' ) . '</strong> ' . esc_html__( 'Test mode is enabled. While in test mode no live donations are processed.', 'give' ) . '</p></div>';\n\t}\n}",
"public function verifyDecisionListenerWasCalled(): void\n {\n // Check that this was called during the...\n $onDecision = function ($type, $userId, $attributes, $decisionInfo) {\n print \">>> [$this->outputTag] OnDecision:\n type: $type,\n userId: $userId,\n attributes: \" . print_r($attributes, true) . \"\n decisionInfo: \" . print_r($decisionInfo, true) . \"\\r\\n\";\n };\n $this->optimizelyClient->notificationCenter->addNotificationListener(\n NotificationType::DECISION,\n $onDecision\n );\n\n // ...decide.\n $this->userContext->decide(FLAG_KEY);\n }",
"public function verifyDecisionListenerWasCalled(): void\n {\n // Check that this was called during the...\n $onDecision = function ($type, $userId, $attributes, $decisionInfo) {\n print \">>> [$this->outputTag] OnDecision:\n type: $type,\n userId: $userId,\n attributes: \" . print_r($attributes, true) . \"\n decisionInfo: \" . print_r($decisionInfo, true) . \"\\r\\n\";\n };\n $this->optimizelyClient->notificationCenter->addNotificationListener(\n NotificationType::DECISION,\n $onDecision\n );\n\n // ...decide.\n $this->userContext->decide(FLAG_KEY);\n }",
"public static function testflag($test_flag) {\n $test_flag = strtoupper($test_flag);\n $test_flags = isset($_ENV['TEST_FLAGS'])\n ? array_map(\"strtoupper\",\n array_map(\"trim\",\n explode(\",\", $_ENV['TEST_FLAGS'])))\n : array();\n \n return in_array($test_flag, $test_flags) || in_array(\"ALL\", $test_flags);\n }",
"public function isTesting() {}",
"function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }",
"public function testOrgApacheSlingFeatureflagsImplConfiguredFeature()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.featureflags.impl.ConfiguredFeature';\n\n $crawler = $client->request('POST', $path);\n }",
"public function opcionesDesplegable();",
"public function processChangeOptinVal()\n {\n }",
"public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}",
"public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {}",
"public function testDoesUserMeetAudienceConditionsSomeAudienceUsedInExperiment()\n {\n $config = new DatafileProjectConfig(DATAFILE, null, null);\n $experiment = $config->getExperimentFromKey('test_experiment');\n\n // Both audience Ids and audience conditions exist. Audience Ids is ignored.\n $experiment->setAudienceIds(['7718080042']);\n $experiment->setAudienceConditions(['11155']);\n\n $this->assertFalse(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n ['device_type' => 'Android', 'location' => 'San Francisco'],\n $this->loggerMock\n )[0]\n );\n\n // Audience Ids exist and audience conditions is null.\n $experiment = $config->getExperimentFromKey('test_experiment');\n $experiment->setAudienceIds(['11155']);\n $experiment->setAudienceConditions(null);\n\n $this->assertFalse(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n ['device_type' => 'iPhone', 'location' => 'San Francisco'],\n $this->loggerMock\n )[0]\n );\n }",
"function spr_section_exclude_lifecycle($event,$step) {\n// $event:\t\"plugin_lifecycle.stm_article_order\"\n// $step:\t\"installed\", \"enabled\", \"disabled\", \"deleted\"\n// TXP 4.5: reinstall/upgrade only triggers \"installed\" event (now have to manually detect whether upgrade required)\nglobal $spr_exclude_debug;\n\nif ($spr_exclude_debug) {\n\techo \"spr_section_exclude_lifecycle start\";\n}\n\n\t$result = '?';\n\tif (($step == 'enabled') or ($step = 'installed')) {\n\t\t\t$result = spr_section_exclude_install();\n\t}\n\telse if ($step == 'deleted') {\n\t\t$result = spr_section_exclude_uninstall();\n\t}\n\tif ($spr_exclude_debug){\n\t\techo \"Event=$event Step=$step Result=$result\";\n\t}\n}",
"public function testVariations()\n {\n \t//$user = TestUser::find(1)->first();\n \t//dump($user);\n \t//echo $user->created_date_time;\n\t\t//dump($user);\n\t\t//exit;\n $change_settings_methods = [\n 'key_mutator',\n 'key_casting',\n 'key_dates',\n ];\n $unique_callback_set = TestUser::unique_sets($change_settings_methods);\n foreach ($unique_callback_set as $set_of_callbacks) {\n // call the callbacks\n $this->current_config_set = $set_of_callbacks;\n\t\t\t// zeroDate\n\t\t\t$this->zeroDate();\n\t\t\t// zeroDateTime\n\t\t\t$this->zeroDateTime();\n // nullable\n $this->nullable();\n }\n }",
"public function testGeTaskVariableData()\n {\n }",
"public function testTroubleshootingModeDisabledWrongCokie() {\n\t\t$_COOKIE['health-check-disable-plugins'] = 'abc124';\n\n\t\t// This test should fail, as the hash values do not match.\n\t\t$this->assertFalse( $this->class_instance->is_troubleshooting() );\n\t}",
"function tquiz_get_extra_capabilities() {\n return array();\n}",
"public function testCustomOption() {\n // Add the boolean field handler to the test view.\n $view = Views::getView('test_view');\n $view->setDisplay();\n\n $view->displayHandlers->get('default')->overrideOption('fields', [\n 'age' => [\n 'id' => 'age',\n 'table' => 'views_test_data',\n 'field' => 'age',\n 'relationship' => 'none',\n 'plugin_id' => 'boolean',\n ],\n ]);\n $view->save();\n\n $this->executeView($view);\n\n $custom_true = 'Yay';\n $custom_false = 'Nay';\n\n // Set up some custom value mappings for different types.\n $custom_values = [\n 'plain' => [\n 'true' => $custom_true,\n 'false' => $custom_false,\n 'test' => 'assertStringContainsString',\n ],\n 'allowed tag' => [\n 'true' => '<p>' . $custom_true . '</p>',\n 'false' => '<p>' . $custom_false . '</p>',\n 'test' => 'assertStringContainsString',\n ],\n 'disallowed tag' => [\n 'true' => '<script>' . $custom_true . '</script>',\n 'false' => '<script>' . $custom_false . '</script>',\n 'test' => 'assertStringNotContainsString',\n ],\n ];\n\n // Run the same tests on each type.\n foreach ($custom_values as $type => $values) {\n $options = [\n 'options[type]' => 'custom',\n 'options[type_custom_true]' => $values['true'],\n 'options[type_custom_false]' => $values['false'],\n ];\n $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/field/age');\n $this->submitForm($options, 'Apply');\n\n // Save the view.\n $this->drupalGet('admin/structure/views/view/test_view');\n $this->submitForm([], 'Save');\n\n $view = Views::getView('test_view');\n $output = $view->preview();\n $output = \\Drupal::service('renderer')->renderRoot($output);\n $this->{$values['test']}($values['true'], (string) $output, new FormattableMarkup('Expected custom boolean TRUE value %value in output for %type', ['%value' => $values['true'], '%type' => $type]));\n $this->{$values['test']}($values['false'], (string) $output, new FormattableMarkup('Expected custom boolean FALSE value %value in output for %type', ['%value' => $values['false'], '%type' => $type]));\n }\n }",
"public function testGetBoolFalse(): void\n {\n // 0\n $_SERVER['MY_KEY'] = 0;\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // false\n $_SERVER['MY_KEY'] = false;\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // '0'\n $_SERVER['MY_KEY'] = '0';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'false'\n $_SERVER['MY_KEY'] = 'false';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'no'\n $_SERVER['MY_KEY'] = 'no';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'off'\n $_SERVER['MY_KEY'] = 'off';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'unknown'\n $_SERVER['MY_KEY'] = 'unknown';\n $this->assertFalse(Env::getBool('MY_KEY'));\n }",
"public function setOptionsOnDetermination()\n\t{\n\t\treturn false;\n\t}",
"function wpvideocoach_hide_introduction_disable_fields()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 1){\r\n\t\techo \"disabled='disabled'\";\r\n\t}\r\n}",
"public static function phpunit_disable() {\n parent::disable();\n }",
"public function initializeTestedVulnerabilities() {\n\n\t\tif($this->XSSReport !== false)\n\t\t\t$this->testedVulnerabilities[] = array ('vulnerability' => 'XSS', 'securityLevel' => $this->XSSReport->getSecurityLevel() );\n\t\tif($this->SQLInjectionReport !== false)\n\t\t\t$this->testedVulnerabilities[] = array ('vulnerability' => 'SQL Injection', 'securityLevel' => $this->SQLInjectionReport->getSecurityLevel() );\n\t}",
"public function testSpecial(): void {\n\t}",
"public static function skipunless($test_flag, $message = NULL) {\n $test_flag = strtoupper($test_flag);\n\n if(!static::testflag($test_flag))\n static::skiptest(isset($message) && strlen($message)\n ? $message\n : sprintf(\"'%s' not set in TEST_FLAGS\", $test_flag));\n }",
"public function postConfigure()\n\t{\n\t\tforeach ($this->restrictions as $type => $restrictions)\n\t\t{\n\t\t\tif (!empty($restrictions))\n\t\t\t{\n\t\t\t\t$this->debug->setFlag($type, $restrictions);\n\t\t\t}\n\t\t}\n\n\t\t$this->config->force_winner = $this->force_winner;\n\n\t\t$factory = new OLPBlackbox_Factory_Legacy_OLPBlackbox();\n\t\t$this->blackbox = $factory->getBlackbox();\n\t}",
"function VM_visit_policies($visit_type,$new_value=Null,$e=Null){\n if (empty($visit_type)){\n b_debug::xxx(\"Empty visit_type arg\");\n b_debug::traceBack(\"Empty visit_type arg\");\n return array();\n }\n \n if ($visit_type == VISIT_TYPE_PROGRAM){\n \n if (!is_object($e)) $e = $new_value;\n if (!is_object($e)) $e = VM::$e;\n if (!($e instanceof bForm_vm_Event)) b_debug::internalError(\"Empty event arg\");\n if (!is_object($new_value) && ($new_value !== Null)) $e->set_e_v_policy($new_value);\n $reply = $e->get_e_v_policy();\n \n }else{\n \n // Update the variable\n $var_id = \"v_policy_$visit_type\";\n if (is_array($new_value)) b_vars::set($var_id,$new_value,VM_MODULE);\n \n // Initialise the variable storage if not yet done\n if (!b_vars::get($var_id,VM_MODULE)){\n b_vars::set($var_id,VM::$description[$visit_type]['p'],VM_MODULE);\n }\n $reply = b_vars::get($var_id,VM_MODULE);\n }\n\n // Check for the de-commissioned policies\n if ($bogus=array_diff($reply,array_keys(VM::$v_policies))){\n $reply = array_diff($reply,$bogus);\n b_debug::xxx(\"DROP BOGUS policy \".join(', ',$bogus));\n }\n\n if (cnf_dev){\n foreach($reply as $p) $reply_P[$p] = VM::$v_policies[$p]['d'];\n // b_debug::xxx($reply_P,array(True,'blueText',2));\n }\n return $reply;\n}",
"public function testDisableTriggersWhenEnabledConfigNotChanged()\n {\n $this->setupPhp5();\n\n $fixtures = [\n 'update_klevuproductsync_for_cpip',\n 'update_klevuproductsync_for_lsa',\n 'update_klevuproductsync_for_cpp',\n ];\n\n /** @var RequestProxy $request */\n $request = $this->getRequest();\n $request->setParam('section', 'klevu_search');\n $request->setMethod('POST');\n $request->setPostValue([\n 'groups' => [\n 'developer' => [\n 'fields' => [\n 'trigger_options_info' => [\n 'value' => 0,\n ],\n ],\n ],\n ],\n ]);\n\n $this->dispatch($this->getAdminFrontName() . '/admin/system_config/save');\n $response = $this->getResponse();\n\n $this->assertTrue($response->isRedirect(), 'Response is redirect');\n\n $existingTriggerNames = $this->getExistingTriggerNames();\n foreach ($fixtures as $fixtureTriggerName) {\n $this->assertFalse(\n in_array($fixtureTriggerName, $existingTriggerNames, true),\n sprintf('Assert trigger \"%s\" exists', $fixtureTriggerName)\n );\n }\n }",
"public function testSkipIfFalse(): void\n {\n $this->skipIf(false);\n $this->assertTrue(true, 'Avoid phpunit warnings');\n }",
"public function testTroubleshootingModeEnabledRightCookie() {\n\t\t$_COOKIE['health-check-disable-plugins'] = 'abc123';\n\n\t\t// This test should pass, as the hash values does now match.\n\t\t$this->assertTrue( $this->class_instance->is_troubleshooting() );\n\t}",
"function getIgnoreEnableFields() ;",
"public function testQuarantineCheckIfProfileIsQuarantined()\n {\n\n }",
"public function testDoesUserMeetAudienceConditionsNoAudienceUsedInExperiment()\n {\n $config = new DatafileProjectConfig(DATAFILE, null, null);\n $experiment = $config->getExperimentFromKey('test_experiment');\n\n // Both audience conditions and audience Ids are empty.\n $experiment->setAudienceIds([]);\n $experiment->setAudienceConditions([]);\n $this->assertTrue(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n [],\n $this->loggerMock\n )[0]\n );\n\n // Audience Ids exist but audience conditions is empty.\n $experiment->setAudienceIds(['7718080042']);\n $experiment->setAudienceConditions([]);\n $this->assertTrue(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n [],\n $this->loggerMock\n )[0]\n );\n\n // Audience Ids is empty and audience conditions is null.\n $experiment->setAudienceIds([]);\n $experiment->setAudienceConditions(null);\n $this->assertTrue(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n [],\n $this->loggerMock\n )[0]\n );\n }",
"public function testStatusFlags()\n {\n $page = SiteTree::create();\n $page->Title = 'stuff';\n DBDatetime::set_mock_now('2016-01-16 00:00:00');\n\n $flags = $page->getStatusFlags(false);\n $this->assertNotContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertNotContains('embargo', array_keys($flags ?? []));\n $this->assertNotContains('expiry', array_keys($flags ?? []));\n\n $page->PublishOnDate = '2016-02-01 00:00:00';\n $page->UnPublishOnDate = null;\n $flags = $page->getStatusFlags(false);\n $this->assertNotContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertContains('embargo', array_keys($flags ?? []));\n $this->assertNotContains('expiry', array_keys($flags ?? []));\n\n $page->PublishOnDate = null;\n $page->UnPublishOnDate = '2016-02-01 00:00:00';\n $flags = $page->getStatusFlags(false);\n $this->assertNotContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertNotContains('embargo', array_keys($flags ?? []));\n $this->assertContains('expiry', array_keys($flags ?? []));\n\n $page->PublishOnDate = '2016-02-01 00:00:00';\n $page->UnPublishOnDate = '2016-02-08 00:00:00';\n $flags = $page->getStatusFlags(false);\n $this->assertContains('embargo_expiry', array_keys($flags ?? []));\n $this->assertNotContains('embargo', array_keys($flags ?? []));\n $this->assertNotContains('expiry', array_keys($flags ?? []));\n }",
"public function getIgnoreEnableFields() {}",
"public function canBeDisabledAndEnabled() {}",
"public function testTsExcellence()\n {\n $testConfig = $this->getTestConfig();\n if ($testConfig->isSubShop()) {\n $this->markTestSkipped('Test is not for subshops');\n }\n\n //setupping ts\n $this->loginAdminTs();\n $this->type(\"aShopID_TrustedShops[0]\", $this->getLoginDataByName('trustedShopsIdForLanguageDe'));\n $this->type(\"aTsUser[0]\", \"testExcellencePartner\");\n $this->type(\"aTsPassword[0]\", \"test12345678\");\n $this->check(\"//input[@name='tsTestMode' and @value='true']\");\n $this->clickAndWait(\"save\");\n $this->assertTextNotPresent(\"Invalid Trusted Shops ID\", \"Invalid Trusted Shops ID for testing\");\n $this->assertEquals($this->getLoginDataByName('trustedShopsIdForLanguageDe'), $this->getValue(\"aShopID_TrustedShops[0]\"));\n $this->assertEquals(\"testExcellencePartner\", $this->getValue(\"aTsUser[0]\"));\n $this->assertEquals(\"test12345678\", $this->getValue(\"aTsPassword[0]\"));\n //$this->assertElementPresent(\"//div[@id='liste']/table/tbody/tr[2]/td[@class='active']\");\n $this->check(\"//input[@name='tsSealActive' and @value='true']\");\n $this->check(\"//input[@name='tsTestMode' and @value='true']\");\n $this->clickAndWait(\"save\");\n $this->assertTextNotPresent(\"Invalid Trusted Shops ID\", \"Invalid Trusted Shops ID for testing\");\n\n $aOrderParams1 = $this->_getNewTestOrderParams1();\n $aOrderParams2 = $this->_getNewTestOrderParams2();\n\n $this->callShopSC(\"oxOrder\", \"save\", null, $aOrderParams1, null, 1);\n $this->callShopSC(\"oxOrder\", \"save\", null, $aOrderParams2, null, 1);\n\n //checking orders in admin\n //$this->loginAdmin(\"Administer Orders\", \"Orders\");\n $this->selectMenu(\"Administer Orders\", \"Orders\");\n $this->openListItem(\"link=12\");\n $this->assertTextPresent(\"0,90\");\n $this->openListItem(\"link=13\");\n $this->assertTextPresent(\"2,72\");\n }",
"function add_test($condition, $result_true, $recommend_true, $result_false, $recommend_false, $recommend_condition = FALSE) \n{\n\tglobal $recommendation, $test_result;\n\t\n\tif ($condition) {\n\t\t$test_result[] = \"<span style='color: green;'>\" . $result_true . \"</span>\";\n\t\tif (!$recommend_condition)\n\t\t\t$recommendation[] = $recommend_true;\n\t}\n\telse {\t\t\n\t\t$test_result[] = \"<span style='color: red;'>\" . $result_false . \"</span>\";\n\t\t$recommendation[] = $recommend_false;\n\t}\n}",
"public function testIsApplicable(): void\n {\n $this->assertTrue($this->createProvider(false)->isApplicable());\n }",
"public function testSpecifiedConfig(): void\n {\n $process = $this->phpbench('run --verbose --config=env/config_valid/phpbench.json');\n $this->assertExitCode(0, $process);\n $this->assertStringContainsString('Subjects', $process->getErrorOutput());\n }",
"public function testOrgApacheSlingFeatureflagsFeature()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.featureflags.Feature';\n\n $crawler = $client->request('POST', $path);\n }",
"private function test()\n {\n return (bool) Mage::getStoreConfig('actions/settings/test');\n }",
"public function testOverrideMode(): void\n {\n $process = $this->phpbench(\n 'run --filter=benchDoNothing --mode=throughput --iterations=10 benchmarks/set1/BenchmarkBench.php'\n );\n\n $this->assertExitCode(0, $process);\n $this->assertStringContainsString('ops/μs', $process->getErrorOutput());\n }",
"public function preTesting() {}",
"function wpsl_bool_check( $atts ) {\n\n foreach ( $atts as $key => $val ) {\n if ( in_array( $val, array( 'true', '1', 'yes', 'on' ) ) ) {\n $atts[$key] = true;\n } else if ( in_array( $val, array( 'false', '0', 'no', 'off' ) ) ) {\n $atts[$key] = false;\n }\n }\n\n return $atts;\n}",
"public function testAuthorizeFrontendDisabled()\n {\n $request = $this->paymentObject->getRequest();\n\n $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');\n $request->basketData($timestamp, 23.12, $this->currency, $this->secret);\n $request->getFrontend()->setResponseUrl('http://technik.heidelpay.de/jonas/responseAdvanced/response.php');\n\n $request->getAccount()->setCountry('AT');\n $request->getFrontend()->setEnabled('FALSE');\n\n $this->paymentObject->authorize();\n\n /* prepare request and send it to payment api */\n $requestArray = $request->toArray();\n /** @var Response $response */\n list($result, $response) = $request->send($this->paymentObject->getPaymentUrl(), $requestArray);\n\n $this->assertTrue($response->isSuccess(), 'Transaction failed : ' . print_r($response, 1));\n $this->assertFalse($response->isError(), 'authorize failed : ' . print_r($response->getError(), 1));\n $this->assertNotEmpty($response->getProcessing()->getRedirect()->url);\n // Unfortunately this can only be tested in live mode\n //$this->assertNotEmpty($response->getProcessing()->getRedirect()->getParameter());\n\n $this->logDataToDebug($result);\n }",
"public function setEmulatePrepare(bool $value): void;",
"private function testCollect() {\n $custom_data = array();\n\n // Collect all custom data provided by hook_insight_custom_data().\n $collections = \\Drupal::moduleHandler()->invokeAll('acquia_connector_spi_test');\n\n foreach ($collections as $test_name => $test_params) {\n $status = new TestStatusController();\n $result = $status->testValidate(array($test_name => $test_params));\n\n if ($result['result']) {\n $custom_data[$test_name] = $test_params;\n }\n }\n\n return $custom_data;\n }",
"public function testGetVendorComplianceSurveyByFilter()\n {\n }",
"public function automated() : bool;",
"public function check_capabilities()\n {\n }",
"public function test()\n {\n $this->taskCodecept(self::CODECEPT_BIN)->run();\n }",
"public function test()\n {\n $this->taskCodecept(self::CODECEPT_BIN)->run();\n }",
"abstract public function testInactiveExpression();",
"function BreakpointDebugging_getExecutionModeFlags()\n{\n /**\n * See \"### Debug mode constant number ###\" of class \"BreakpointDebugging_InAllCase\" in \"BreakpointDebugging.php\".\n */\n // ### Debug mode number ###\n $REMOTE = 1;\n $RELEASE = 2;\n $UNIT_TEST = 4;\n\n // In case of direct command call or local \"php\" page call.\n if (!isset($_SERVER['SERVER_ADDR']) || $_SERVER['SERVER_ADDR'] === '127.0.0.1') { // If local.\n switch (BREAKPOINTDEBUGGING_MODE) {\n case 'RELEASE':\n return $RELEASE; // Local server debug by breakpoint and logging.\n case 'DEBUG':\n return 0; // Local server debug by breakpoint.\n case 'RELEASE_UNIT_TEST':\n return $RELEASE | $UNIT_TEST; // Unit test of release code on local server.\n case 'DEBUG_UNIT_TEST':\n return $UNIT_TEST; // Unit test of debug code on local server.\n }\n } else { // If remote.\n switch (BREAKPOINTDEBUGGING_MODE) {\n case 'RELEASE':\n return $REMOTE | $RELEASE; // Remote server release by logging.\n case 'DEBUG':\n return $REMOTE; // Remote server debug by browser display.\n case 'RELEASE_UNIT_TEST':\n return $REMOTE | $RELEASE | $UNIT_TEST; // Unit test of release code on remote server.\n case 'DEBUG_UNIT_TEST':\n return $REMOTE | $UNIT_TEST; // Unit test of debug code on remote server.\n }\n }\n\n exit('<pre><b>Mistaken \"BREAKPOINTDEBUGGING_MODE\" value.</b></pre>');\n}",
"public function testConsentRejected()\n {\n $expected = 'do not use';\n $actual = $this->object->getConsentRejected();\n $this->assertEquals($expected, $actual);\n\n //Check if we can read from an altered ini file\n $project = $this->project;\n $expected = 'test';\n $project->consentRejected = $expected;\n $actual = $this->object->getConsentRejected();\n $this->assertEquals($expected, $actual);\n\n //Check for class default when not found in ini\n unset($project->consentRejected);\n $expected = 'do not use';\n $actual = $this->object->getConsentRejected();\n $this->assertEquals($expected, $actual);\n }",
"public function testGetChallengeEvent()\n {\n }",
"function get_required_filters($execution_mode) {\n //nothing is required by default, implement in report instance\n return array();\n }",
"public function authorizedTest()\n {\n return $this->accepted && $this->test_mode;\n }",
"public function TestFilterUserByStatusFalse()\n {\n $expected = $this->usersFilter->filterByStatus(\"authorized\",\"decline\");\n $this->assertFalse($expected);\n }",
"function notify_addon_enabled_from_admin_panel() {\n return ( (!!qa_opt('qw_enable_email_notfn')) &&\n (\n (!!qa_opt('qw_notify_cat_followers')) ||\n (!!qa_opt('qw_notify_tag_followers')) ||\n (!!qa_opt('qw_notify_user_followers'))\n )\n );\n }",
"public function notMatchingApplicationContextConditionsDataProvider() {}",
"function attendance_get_automarkoptions() {\n\n $options = array();\n\n $options[ATTENDANCE_AUTOMARK_DISABLED] = get_string('noautomark', 'attendance');\n if (strpos(get_config('tool_log', 'enabled_stores'), 'logstore_standard') !== false) {\n $options[ATTENDANCE_AUTOMARK_ALL] = get_string('automarkall', 'attendance');\n }\n $options[ATTENDANCE_AUTOMARK_CLOSE] = get_string('automarkclose', 'attendance');\n $options[ATTENDANCE_AUTOMARK_ACTIVITYCOMPLETION] = get_string('onactivitycompletion', 'attendance');\n\n return $options;\n}",
"public function testGetChallengeEvents()\n {\n }",
"public function testDynamicAllowedValues() {\n // Verify that validation passes against every value we had.\n foreach ($this->test as $key => $value) {\n $this->entity->test_options->value = $value;\n $violations = $this->entity->test_options->validate();\n $this->assertCount(0, $violations, \"$key is a valid value\");\n }\n\n // Now verify that validation does not pass against anything else.\n foreach ($this->test as $key => $value) {\n $this->entity->test_options->value = is_numeric($value) ? (100 - $value) : ('X' . $value);\n $violations = $this->entity->test_options->validate();\n $this->assertCount(1, $violations, \"$key is not a valid value\");\n }\n }",
"function getDriverRestrictions() ;",
"public static function block_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'no', false );\n\t}",
"protected function _checkStatus() {\n if ($this->analyticsEnabled === null) {\n $this->analyticsEnabled = Zend_Registry::get('config')->analytics->enabled; \n } \n if ($this->analyticsEnabled != 1) { \n throw new Exception(\"We're sorry, Analytics is disabled at the moment\");\n }\n }",
"public function testPhpEnvOptions(): void\n {\n $process = $this->phpbench(\n 'run benchmarks/set4/NothingBench.php --php-binary=php --php-config=\"memory_limit: 10M\" --php-wrapper=\"env\"'\n );\n $this->assertExitCode(0, $process);\n }"
] | [
"0.7441389",
"0.54870343",
"0.53214437",
"0.5320809",
"0.5290275",
"0.52787566",
"0.52784187",
"0.5264936",
"0.52579516",
"0.52253395",
"0.521929",
"0.51509714",
"0.5128793",
"0.5097066",
"0.50656307",
"0.5056115",
"0.50507647",
"0.5033698",
"0.4955682",
"0.4951509",
"0.49355277",
"0.49333283",
"0.49322814",
"0.49259776",
"0.4900193",
"0.48940837",
"0.48821816",
"0.48732993",
"0.48655578",
"0.4861184",
"0.48497045",
"0.48207763",
"0.48148835",
"0.48148835",
"0.48008665",
"0.47994107",
"0.47933772",
"0.47912046",
"0.4787642",
"0.47866312",
"0.47838342",
"0.47826055",
"0.47607556",
"0.475957",
"0.4756225",
"0.47550663",
"0.47540286",
"0.4744596",
"0.4729296",
"0.47119257",
"0.47106475",
"0.47085714",
"0.46992305",
"0.46988013",
"0.4678113",
"0.46742168",
"0.46698368",
"0.46633828",
"0.46609744",
"0.4660126",
"0.4650983",
"0.46465915",
"0.46323353",
"0.4616914",
"0.46158502",
"0.4610121",
"0.46082824",
"0.46080714",
"0.4607446",
"0.46060622",
"0.46059972",
"0.46036565",
"0.46002147",
"0.45986313",
"0.45983753",
"0.45942804",
"0.45795625",
"0.45772803",
"0.45762125",
"0.4571656",
"0.4571478",
"0.45691365",
"0.45625284",
"0.45625284",
"0.455784",
"0.45537877",
"0.45514625",
"0.4547889",
"0.45459017",
"0.4542917",
"0.4541188",
"0.4533348",
"0.4530465",
"0.4525528",
"0.45225552",
"0.45202455",
"0.45200288",
"0.4517954",
"0.45111495",
"0.4510947"
] | 0.70403206 | 1 |
verify in logs that impression event of this decision was dispatched | public function verifyLogsImpressionsEventsDispatched(): void
{
// 💡️ Be sure that your FLAG_KEYS array above includes A/B Test eg "product_version"
$logger = new DefaultLogger(Logger::DEBUG);
$localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);
$localUserContext = $localOptimizelyClient->createUserContext($this->userId);
// review the DEBUG output, ensuring you see an impression log for each experiment type in your FLAG_KEYS
// "Dispatching impression event to URL https://logx.optimizely.com/v1/events with params..."
// ⚠️ Your Rollout type flags should not have impression events
$localUserContext->decideForKeys(FLAG_KEYS);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function verifyLogsImpressionsEventsDispatched(): void\n {\n // 💡️ Create a new flag with an A/B Test eg \"product_version\"\n $featureFlagKey = 'product_version';\n $logger = new DefaultLogger(Logger::DEBUG);\n $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);\n $localUserContext = $localOptimizelyClient->createUserContext($this->userId);\n\n // review the DEBUG output, ensuring you see an impression log\n // \"Dispatching impression event to URL https://logx.optimizely.com/v1/events with params...\"\n $localUserContext->decide($featureFlagKey);\n }",
"public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }",
"public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }",
"public function verifyDecisionListenerWasCalled(): void\n {\n // Check that this was called during the...\n $onDecision = function ($type, $userId, $attributes, $decisionInfo) {\n print \">>> [$this->outputTag] OnDecision:\n type: $type,\n userId: $userId,\n attributes: \" . print_r($attributes, true) . \"\n decisionInfo: \" . print_r($decisionInfo, true) . \"\\r\\n\";\n };\n $this->optimizelyClient->notificationCenter->addNotificationListener(\n NotificationType::DECISION,\n $onDecision\n );\n\n // ...decide.\n $this->userContext->decide(FLAG_KEY);\n }",
"public function verifyDecisionListenerWasCalled(): void\n {\n // Check that this was called during the...\n $onDecision = function ($type, $userId, $attributes, $decisionInfo) {\n print \">>> [$this->outputTag] OnDecision:\n type: $type,\n userId: $userId,\n attributes: \" . print_r($attributes, true) . \"\n decisionInfo: \" . print_r($decisionInfo, true) . \"\\r\\n\";\n };\n $this->optimizelyClient->notificationCenter->addNotificationListener(\n NotificationType::DECISION,\n $onDecision\n );\n\n // ...decide.\n $this->userContext->decide(FLAG_KEY);\n }",
"protected function logActivity(FieldObservation $fieldObservation)\n {\n activity()->performedOn($fieldObservation)\n ->causedBy(auth()->user())\n ->log('approved');\n }",
"function formlift_track_impression( $formID ) {\n\tglobal $FormLiftUser;\n\n// if ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n// return;\n\n\tif ( ! $FormLiftUser->hasImpression( $formID ) ) {\n\t\t$FormLiftUser->addImpression( $formID );\n\t\tformlift_add_impression( $formID );\n\n\t\t$imps = formlift_get_form_impressions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\t\t$subs = formlift_get_form_submissions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\n\t\tformlift_update_form_stats( $formID, $imps, $subs );\n\t}\n}",
"public function requestAnalysis() {\n $this->getTransaction()->tagAsAnalysisSent($this);\n }",
"public function log_view() {\n \\filter_embedquestion\\event\\question_viewed::create(['context' => $this->embedlocation->context,\n 'objectid' => $this->current_question()->id])->trigger();\n }",
"public function checkForFollowUpNotClicked()\n {\n $now = Carbon::now();\n $logs = $this->getNotClickedMessagesToFollow();\n foreach($logs as $log) {\n MailLog::info(sprintf('Trigger sending follow-up not clicked email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }",
"public function take_action()\n {\n }",
"public function take_action()\n {\n }",
"public function checkForFollowUpClicked()\n {\n $now = Carbon::now();\n $logs = $this->getClickedMessagesToFollow();\n\n foreach($logs as $log) {\n if ($now->gte($log->created_at->copy()->modify($this->getDelayInterval()))) {\n MailLog::info(sprintf('Trigger sending follow-up clicked email for automation `%s`, subscriber: %s, event ID: %s, message ID: %s', $this->automation->name, $log->subscriber_id, $this->id, $log->message_id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }\n }",
"function track_clicks_allowed_by_user(){\n if (!$this->get_config('track_visits_of_loggedin_users',true) && serendipity_userLoggedIn()){\n return false;\n }\n return true;\n }",
"public static function maybe_track_usage() {\n\n\t\t/** checking optin state */\n\t\tif ( 'yes' == self::get_optIn_state() ) {\n\t\t\t$data = self::collect_data();\n\n\t\t\t//posting data to api\n\t\t\tXL_API::post_tracking_data( $data );\n\t\t}\n\t}",
"public function canManageTracking();",
"public function should_track_identity()\n {\n }",
"function recordAnalytics() {\n\t\t//Is your user agent any of my business? Not really, but don't worry about it.\n\t\texecuteQuery(\"\n\t\t\tINSERT INTO dwm2r_activitymonitor\n\t\t\t(IPAddress,UserAgent,Flags,Seed,CreatedDTS)\n\t\t\tVALUES (\n\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"',\n\t\t\t\t'\".$_SERVER['HTTP_USER_AGENT'].\"',\n\t\t\t\t'\".trim($_REQUEST[\"Flags\"]).\"',\n\t\t\t\t'\".$this->modder->flags[\"Seed\"].\"',\n\t\t\t\tNOW()\n\t\t\t)\n\t\t\");\n\t}",
"public function requestVerification()\n {\n Event::dispatch(new VerificationRequest($this));\n }",
"private function add_to_log($action) {\n if ($action) {\n $event = \\mod_simplecertificate\\event\\course_module_viewed::create(\n array(\n 'objectid' => $this->get_course_module()->instance,\n 'context' => $this->get_context(),\n 'other' => array('certificatecode' => $this->get_issue()->code)));\n $event->add_record_snapshot('course', $this->get_course());\n }\n\n if (!empty($event)) {\n $event->trigger();\n }\n }",
"protected function assertPayload(): void\n {\n }",
"protected function assertPayload(): void\n {\n }",
"protected function assertPayload(): void\n {\n }",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function testOn()\n\t{\n\t\t$this->assertTrue(Catapult\\Log::isOn());\n\t}",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function testComAdobeGraniteLoggingImplLogAnalyserImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.logging.impl.LogAnalyserImpl';\n\n $crawler = $client->request('POST', $path);\n }",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }",
"public function doApology()\n {\n\n // Check for a token authority.\n // Check for a list authority.\n $this->getApologies();\n\n // Calculate the expiry of the authority.\n\n // Check if the authority has expired. Is in the past.\n\n if ($this->agent_input == null) {\n $array = ['No apology found.'];\n $k = array_rand($array);\n $v = $array[$k];\n\n $response = \"APOLOGY | \" . $v;\n\n $this->message = $response; // mewsage?\n } else {\n $this->message = $this->agent_input;\n }\n }",
"public function logPixelPaymentInfo($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelPaymentInfo(true);\n }",
"protected function manageExecutedAction()\n {\n $action = $this->flowEvaluator->getActionInFlow();\n $this->triggerEvent(__FUNCTION__ . '.executed');\n if ($action->hasFinalResults()) {\n $params = array('results' => $action->spit());\n $this->triggerEvent(__FUNCTION__ . '.hasFinalResults', $params);\n }\n }",
"protected function _checkStatus() {\n if ($this->analyticsEnabled === null) {\n $this->analyticsEnabled = Zend_Registry::get('config')->analytics->enabled; \n } \n if ($this->analyticsEnabled != 1) { \n throw new Exception(\"We're sorry, Analytics is disabled at the moment\");\n }\n }",
"public function testComDayCqWcmFoundationImplPageImpressionsTracker()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.foundation.impl.PageImpressionsTracker';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testAuthorizeOperationSuccess()\n {\n // set up environment variables (current user is not signed in and currently is work time)\n $this->currentUserId = null;\n $this->currentUserRole = null;\n $this->isWorkTime = true;\n $policyEnforcement = $this->createPolicyEnforcementPoint();\n\n // send authorization request\n $authRequest = new Request([\n RequestProperties::REQUEST_OPERATION => Posts::OPERATION_INDEX,\n RequestProperties::REQUEST_RESOURCE_TYPE => Posts::RESOURCE_TYPE,\n ]);\n $this->assertTrue($policyEnforcement->authorize($authRequest));\n\n // what is important for us in this test is how many execution steps were made.\n // due to optimization we expect it to be very few.\n // how we control it? well, we just count number of log entries as it corresponds to number of steps.\n // it's not ideal but solves the problem.\n //\n // so what should you do if the next assert fails (due to changes in logging or logic)?\n // you have to check the log messages and make sure it was executed as switch:\n // 1) First step was checking Post rules and no rules for other resources were checked.\n // 2) Second step was checking `index` and no other Post rules were checked.\n $loggedActions = explode(PHP_EOL, $this->getLogs());\n $this->assertCount(10, $loggedActions);\n }",
"public function log_activity() {\n\t\t$data = array();\n\t\t$data['page'] = current_url();\n\t\t$data['ip_address'] = $this->_ci->input->ip_address();\n\t\t$data['user_agent'] = $this->_ci->agent->agent_string(); \n\t\t$data['request_method'] = $this->_ci->input->server('REQUEST_METHOD');\n\t\t$data['request_params'] = serialize($this->_ci->input->get_post(NULL, TRUE)); \n\t\t$data['uri_string'] = $this->_ci->uri->uri_string();\n\t\t$data['created_at'] = date('Y-m-d h:i:s');\n\n\t\tif($this->verify_activity()) {\n\t\t\t// And write it to the database\n\t\t\t$this->_ci->db->insert('hooks', $data);\n\t\t}\n\t}",
"protected function assertNoLogEntries() {}",
"abstract function is_trial_utilized();",
"public function logPixelPurchase($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelPurchase(true);\n }",
"public function analysis() : void\n {\n $this->strategy->analysis();\n }",
"function hook_campaignion_action_taken($node, Submission $submissionObj, int $when) {\n $myCRM->import($node, $submissionObj);\n}",
"protected function _ensureObservation() {}",
"public function protectedMethod()\n {\n $this->getInitialContext()->getSystemLogger()->info(\n sprintf('%s has successfully been invoked', __METHOD__)\n );\n }",
"public function logPixelAddToCart($observer) {\n //Logging event\n Mage::getModel('core/session')->setPixelAddToCart(true);\n }",
"public function incAssertions()\n {\n $this->assertions += 1;\n }",
"public function logPixelAddToWishlist($observer) {\n //Logging event\n Mage::getModel('core/session')->setPixelAddToWishlist(true);\n }",
"public function testComAdobeCqSocialActivitystreamsListenerImplRatingEventActivityS()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.activitystreams.listener.impl.RatingEventActivitySuppressor';\n\n $crawler = $client->request('POST', $path);\n }",
"private function track(string $action) : void {\n if (filter_input(INPUT_SERVER, 'HTTP_DNT') === '1') {\n return;\n }\n $matomoTracker = new MatomoTracker(4, 'https://stats.codepoints.net/');\n /* make sure this blocks the API as little as possible */\n $matomoTracker->setRequestTimeout(1);\n $matomoTracker->setUrlReferrer($_SERVER['HTTP_REFERER'] ?? '');\n $matomoTracker->setUserAgent($_SERVER['HTTP_USER_AGENT'] ?? '');\n $matomoTracker->disableCookieSupport();\n $matomoTracker->doTrackPageView('API v1: '.$action);\n }",
"public function isCaptured();",
"public function performChecks(){\n\t\t\n\t}",
"public function testAddReplenishmentAudit()\n {\n }",
"public function controllerActionPredispatch($observer)\n {\n // Run the feed\n Mage::getModel('googleplusone/feed')->updateIfAllowed();\n }",
"public function _report_form_submit()\n\t{\n\t\t$incident = Event::$data;\n\n\t\tif ($_POST)\n\t\t{\n\t\t\t$action_item = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident->id)\n\t\t\t\t->find();\n\t\t\t$action_item->incident_id = $incident->id;\n\t\t\t$action_item->actionable = isset($_POST['actionable']) ?\n\t\t\t\t$_POST['actionable'] : \"\";\n\t\t\t$action_item->action_taken = isset($_POST['action_taken']) ?\n\t\t\t\t$_POST['action_taken'] : \"\";\n\t\t\t$action_item->action_summary = $_POST['action_summary'];\n\t\t\t$action_item->save();\n\n\t\t}\n\t}",
"public function Impress() {\n if ($this->native_session_id) {\n $result = mysql_query(\"UPDATE http_session SET last_impression = NOW() WHERE id = \" . $this->native_session_id);\n //var_dump($result);\n if (!$result) {\n die('4 - Invalid query: ' . mysql_error());\n }\n }\n\n }",
"public function reportForDuty()\n {\n //Do stuff ...\n }",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decideForKeys(FLAG_KEYS);\n\n $this->printDecisions($decision, \"Check that the following decisions' properties are expected\");\n }",
"function __isLogDetailsRequired($action){\n return (Configure::read('App.logs.models.rules.'.$action) > 1);\n }",
"protected function assertPostConditions() {\n\t\tprint \"---------------------------------------------------------------- \\n\";\n\t}",
"public function reactToOnBeforeDealDamage($event) { }",
"public function AnomalyPageTest()\n {\n // Test user login\n $user = $this->testAccounts[\"anthro-analyst\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->maximize()\n ->pause(2000)\n\n ->click('@leftSideBar-menu')\n ->pause(2000)\n ->click('@project-report-button')\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n $browser\n ->pause(3000)\n\n ->click('@anomaly_as')\n ->pause(10000)\n ->assertSee('Accession Number')\n ->assertSee('Bone')\n ->assertSee('Provenance 1')\n ->assertSee('Provenance 2')\n ->assertSee('Side')\n ->assertSee('Anomaly')\n\n ->pause(3000)\n\n\n ->logoutUser();\n });\n }",
"public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsConfigStep $openAnalyticsConfigStep)\n {\n $openAnalyticsConfigStep->run();\n\n \\PHPUnit\\Framework\\Assert::assertFalse(\n (bool)$configAnalytics->getAnalyticsForm()->isAnalyticsEnabled(),\n 'Magento Advanced Reporting service is not disabled.'\n );\n \\PHPUnit\\Framework\\Assert::assertEquals(\n $configAnalytics->getAnalyticsForm()->getAnalyticsStatus(),\n 'Subscription status: Disabled',\n 'Magento Advanced Reporting service subscription status is not disabled.'\n );\n }",
"private function logAnswer() {\n\t\t$fileName = $this::filesPath . $this->lesson->getLessonFileName () . $this::statisticsExtension;\n\t\t// lese Statistik ein\n\t\t$stats = $this->getStatsFromFile ( $fileName );\n\t\t// aktualisiere Statistik\n\t\t$stats [1] ++;\n\t\tif ($this->lesson->isCorrectAnswer ())\n\t\t\t$stats [0] ++;\n\t\t// versuche Statistik in Datei zu schreiben\n\t\ttry {\n\t\t\tif (file_exists ( $fileName ) && ! is_writable ( $fileName ) || ! is_writable ( $this::filesPath ))\n\t\t\t\tthrow new RuntimeException ( 'Statistik konnte nicht gespeichert werden. Stelle sicher, dass entsprechende Dateien und Ordner auf dem Webserver mit den nötigen Schreibrechten eingerichtet sind.' );\n\t\t\tfile_put_contents ( $fileName, $stats [0] . \"\\t\" . $stats [1] );\n\t\t} catch ( RuntimeException $e ) {\n\t\t\t$this->errorMessage = $e->getMessage ();\n\t\t}\n\t}",
"public function isObserved() {}",
"public function check_afford_banner()\n {\n $after_deduction = available_points(get_member()) - intval(get_option('banner_setup'));\n\n if (($after_deduction < 0) && (!has_privilege(get_member(), 'give_points_self'))) {\n warn_exit(do_lang_tempcode('CANT_AFFORD'));\n }\n }",
"protected function check_something() {\n\t\t$this->something_happen = true;\n\t}",
"public function testAccessibilityAnalysisResource()\n {\n $mockAdminApi = new MockAdminApi();\n $mockAdminApi->asset(self::$UNIQUE_TEST_ID, ['accessibility_analysis' => true]);\n $lastRequest = $mockAdminApi->getMockHandler()->getLastRequest();\n\n self::assertRequestQueryStringSubset($lastRequest, ['accessibility_analysis' => '1']);\n }",
"public function request(): void\n {\n if ($this->checkAccess()) {\n $this->realSubject->request();\n $this->logAccess();\n }\n }",
"public function logPixelCompleteRegistration($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelCompleteRegistration(true);\n }",
"protected function expectAddEvent()\n {\n $this->eventPublisher->expects($this->once())\n ->method('addEvent')\n ->with(['uuid' => '123']);\n }",
"public function verify()\n {\n $this->setVerifiedFlag()->save();\n\n // :TODO: Fire an event here\n }",
"public function test_addReplenishmentProcessAudit() {\n\n }",
"public function authorize(): void\n {\n $loop = $this->getLoop();\n\n $command = new Identify($this, $loop);\n $command->execute(null);\n\n $this->getLoop()->addPeriodicTimer($this->getInterval(), [\n $this,\n 'heartbeat',\n ]);\n\n $this->status = self::STATUS_AUTHED;\n }",
"public function logger(Varien_Event_Observer $observer)\n {\n $controller = $observer->getEvent()->getControllerAction();\n $request = $controller->getRequest();\n\n //Watchdog if off => RETURN;\n //We don't log this extension actions => RETURN;\n if ((Mage::helper('foggyline_watchdog')->isModuleEnabled() == false)\n || ($request->getControllerModule() == 'Foggyline_Watchdog_Adminhtml')\n ) {\n return;\n }\n\n //We are in admin area, but admin logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'adminhtml')\n && (Mage::helper('foggyline_watchdog')->isLogBackendActions() == false)\n ) {\n return;\n }\n\n //We are in frontend area, but frontend logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'frontend')\n && (Mage::helper('foggyline_watchdog')->isLogFrontendActions() == false)\n ) {\n return;\n }\n\n //If user login detected\n $user = Mage::getSingleton('admin/session')->getUser();\n\n //If customer login detected\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n $log = Mage::getModel('foggyline_watchdog/action');\n\n $log->setWebsiteId(Mage::app()->getWebsite()->getId());\n $log->setStoreId(Mage::app()->getStore()->getId());\n\n $log->setTriggeredAt(Mage::getModel('core/date')->timestamp(time()));\n\n if ($user && $user->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_USER);\n $log->setTriggeredById($user->getId());\n } elseif ($customer && $customer->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_CUSTOMER);\n $log->setTriggeredById($customer->getId());\n } else {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_GUEST);\n $log->setTriggeredById(null);\n }\n\n $log->setControllerModule($request->getControllerModule());\n $log->setFullActionName($request->getControllerModule());\n $log->setClientIp($request->getClientIp());\n $log->setControllerName($request->getControllerName());\n $log->setActionName($request->getActionName());\n $log->setControllerModule($request->getControllerModule());\n $log->setRequestMethod($request->getMethod());\n\n //We are in 'adminhtml' area and \"lbparams\" is ON\n if (Mage::getDesign()->getArea() == 'adminhtml'\n && Mage::helper('foggyline_watchdog')->isLogBackendActions()\n && Mage::helper('foggyline_watchdog')->isLogBackendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //We are in 'frontend' area and \"lfparams\" is ON\n if (Mage::getDesign()->getArea() == 'frontend'\n && Mage::helper('foggyline_watchdog')->isLogFrontendActions()\n && Mage::helper('foggyline_watchdog')->isLogFrontendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //In case of other areas, we don't log request params\n\n try {\n $log->save();\n } catch (Exception $e) {\n //If you cant save, die silently, not a big deal\n Mage::logException($e);\n }\n }",
"public function checkIsVerified(Varien_Event_Observer $observer)\n {\n if (!Mage::getModel('postident/config')->isEnabled()) {\n return;\n }\n\n /* @var $controller Mage_Checkout_CartController */\n $controller = $observer->getControllerAction();\n if (($controller->getRequest()->getControllerName() == 'onepage' && $controller->getRequest()->getActionName() != 'success') && false === Mage::getModel('postident/verification')->userIsVerified()\n ) {\n //Set quote to hasErrors -> this causes a redirect to cart in all cases\n $controller->getOnepage()->getQuote()->setHasError(true);\n\n //Add notice message, that the user has to be verified before he is allowed to enter the checkout\n Mage::getSingleton(\"core/session\")->addNotice(\n Mage::helper(\"postident\")->__(\"An identification by E-POSTIDENT is necessary to enter the checkout.\")\n );\n }\n }",
"abstract function is_trial();",
"function wp_ajax_pmproex_track() \r\n{\t\r\n\tif(!empty($_REQUEST['experiment']))\r\n\t{\r\n\t\tif($_REQUEST['goal'] === 'false')\r\n\t\t\t$_REQUEST['goal'] = false;\r\n\t\tpmproex_track($_REQUEST['experiment'], $_REQUEST['url'], $_REQUEST['goal']);\r\n\t}\r\n\r\n\texit;\r\n}",
"public function NEG_it_checks_create_audits() {\n\n $type = 'Bob';\n\n $taskType = new TaskType();\n $taskType->setType($type);\n $taskType->setDescription('was here');\n $taskType->created_at = Carbon::now();\n $taskType->updated_at = Carbon::now();\n $taskType->client_id = 1;\n\n $result = $taskType->checkTaskTypeCreateAudits($taskType);\n\n $this->assertEquals($result, 0);\n }",
"public function beforeLogMethodAdvice()\n {\n }",
"private function calculateRequiredApprovals() {\r\n\r\n if($this->commitments->requiresApproval() == true) {\r\n require_once('classes/tracking/approvals/Commitments.php');\r\n $this->addApproval(new \\tracking\\approval\\Commitments($this->trackingFormId));\r\n }\r\n\r\n // If the form doesn't have commitments, then we still want the Dean to review it\r\n // so we add this approval.\r\n if(!$this->commitments->requiresApproval()) {\r\n require_once('classes/tracking/approvals/DeanReview.php');\r\n $this->addApproval(new \\tracking\\approval\\DeanReview($this->trackingFormId));\r\n }\r\n\r\n if($this->COIRequiresApproval() == true) {\r\n require_once('classes/tracking/approvals/COI.php');\r\n $this->addApproval(new \\tracking\\approval\\COI($this->trackingFormId));\r\n } else {\r\n // there are no COI, but ORS still needs to review so apply ORSReview\r\n require_once('classes/tracking/approvals/ORSReview.php');\r\n $this->addApproval(new \\tracking\\approval\\ORSReview($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresBehavioural() == true) {\r\n require_once('classes/tracking/approvals/EthicsBehavioural.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsBehavioural($this->trackingFormId));\r\n }\r\n\r\n\r\n/* if($this->compliance->requiresHealth() == true) {\r\n require_once('classes/tracking/approvals/EthicsHealth.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsHealth($this->trackingFormId));\r\n }\r\n\r\n if($this->compliance->requiresAnimal() == true) {\r\n require_once('classes/tracking/approvals/EthicsAnimal.php');\r\n $this->addApproval(new \\tracking\\approval\\EthicsAnimal($this->trackingFormId));\r\n }\r\n\r\n require_once('classes/tracking/approvals/EthicsBiohazard.php');\r\n if($this->compliance->requiresBiohazard() == true) {\r\n $this->addApproval(new \\tracking\\approval\\EthicsBiohazard($this->trackingFormId));\r\n }*/\r\n }",
"public function isApplied();",
"protected abstract function onAuthorizeMissingOwner(): Effect|Response;",
"public function testDoesUserMeetAudienceConditionsSomeAudienceUsedInExperiment()\n {\n $config = new DatafileProjectConfig(DATAFILE, null, null);\n $experiment = $config->getExperimentFromKey('test_experiment');\n\n // Both audience Ids and audience conditions exist. Audience Ids is ignored.\n $experiment->setAudienceIds(['7718080042']);\n $experiment->setAudienceConditions(['11155']);\n\n $this->assertFalse(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n ['device_type' => 'Android', 'location' => 'San Francisco'],\n $this->loggerMock\n )[0]\n );\n\n // Audience Ids exist and audience conditions is null.\n $experiment = $config->getExperimentFromKey('test_experiment');\n $experiment->setAudienceIds(['11155']);\n $experiment->setAudienceConditions(null);\n\n $this->assertFalse(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n ['device_type' => 'iPhone', 'location' => 'San Francisco'],\n $this->loggerMock\n )[0]\n );\n }",
"public function recordAction() {\n\t\t \t\t\t\t\n\t\t\n\t}",
"public function tst_notifyAccess()\n {\n $rows = $this->model->finder()->doStatement(\"select count(*) from $this->table\", array(), SINGLETON);\n $cnt = $this->collection->count();\n $this->assertEquals($rows, $cnt, $message = 'Collection::notifyAccess did not return an expected value');\n }",
"public function beforeEventticketsDisplayed(Varien_Event_Observer $observer) {\n $eventticketsItem = $observer->getEvent()->getEventticketsItem();\n $currentDate = Mage::app()->getLocale()->date();\n $eventticketsCreatedAt = Mage::app()->getLocale()->date(strtotime($eventticketsItem->getCreatedAt()));\n $daysDifference = $currentDate->sub($eventticketsCreatedAt)->getTimestamp() / (60 * 60 * 24);\n /*if ($daysDifference < Mage::helper('wsu_eventtickets')->getDaysDifference()) {\n Mage::getSingleton('core/session')->addSuccess(Mage::helper('wsu_eventtickets')->__('Recently added'));\n }*/\n }",
"public function track_identity()\n {\n }",
"function beforeRender(){\n\t\t$this->recordActivity();\n\t}",
"public function testAssertMethod(): void\n {\n $acl = new Acl\\Acl();\n $roleGuest = new Acl\\Role\\GenericRole('guest');\n $assertMock = static fn($value) => static fn($aclArg, $roleArg, $resourceArg, $privilegeArg) => $value;\n $acl->addRole($roleGuest);\n $acl->allow($roleGuest, null, 'somePrivilege', new CallbackAssertion($assertMock(true)));\n $this->assertTrue($acl->isAllowed($roleGuest, null, 'somePrivilege'));\n $acl->allow($roleGuest, null, 'somePrivilege', new CallbackAssertion($assertMock(false)));\n $this->assertFalse($acl->isAllowed($roleGuest, null, 'somePrivilege'));\n }",
"function __isLogRequired($action){\n return (Configure::read('App.logs.models.rules.'.$action) > 0);\n }",
"public function testReactTakesPrecedenceOverDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountPaid' => 1,\n\t\t\t'getCountDisagreed' => 2,\n\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_REACT,\n\t\t\t$result\n\t\t);\n\t}",
"public static function track_visit_ajax() {\n\t\t// Only do something if snippet use is actually configured.\n\t\tif ( ! self::is_javascript_tracking_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check AJAX referrer.\n\t\tif ( Statify::TRACKING_METHOD_JAVASCRIPT_WITH_NONCE_CHECK === self::$_options['snippet'] ) {\n\t\t\tcheck_ajax_referer( 'statify_track' );\n\t\t}\n\n\t\tself::track_visit( true );\n\t}",
"public function test_course_information_viewed_event() {\n\n // Create a course.\n $data = new stdClass();\n $course = $this->getDataGenerator()->create_course($data);\n\n // Trigger an event: course category viewed.\n $eventparams = array(\n 'objectid' => $course->id,\n 'context' => context_course::instance($course->id),\n );\n\n $event = \\core\\event\\course_information_viewed::create($eventparams);\n // Trigger and capture the event.\n $sink = $this->redirectEvents();\n $event->trigger();\n $events = $sink->get_events();\n $event = reset($events);\n\n // Check that the event data is valid.\n $this->assertInstanceOf('\\core\\event\\course_information_viewed', $event);\n $this->assertEquals($course->id, $event->objectid);\n $this->assertDebuggingNotCalled();\n $sink->close();\n\n }",
"protected function assertConditionsMet(): void\n {\n $this->assertThat(null, new ExpectationsMet());\n }",
"public function isExecuted() {}",
"public function shouldntRaiseAnEvent()\n {\n }",
"protected function collectInformation() {}",
"protected function checkScreenAction() {}",
"protected function reportDispute($args) {\n\n if ($args['ent_date_time'] == '' || $args['ent_report_msg'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $getApptDetQry = \"select a.status,a.appt_lat,a.appt_long,a.address_line1,a.address_line2,a.created_dt,a.arrive_dt,a.appointment_dt,a.amount,a.appointment_id,a.last_modified_dt,a.mas_id from appointment a where a.appointment_dt = '\" . $args['ent_appnt_dt'] . \"' and a.slave_id = '\" . $this->User['entityId'] . \"'\";\n $apptDet = mysql_fetch_assoc(mysql_query($getApptDetQry, $this->db->conn));\n\n if ($apptDet['status'] == '4')\n return $this->_getStatusMessage(41, 3);\n\n $insertIntoReportQry = \"insert into reports(mas_id,slave_id,appointment_id,report_msg,report_dt) values('\" . $apptDet['mas_id'] . \"','\" . $this->User['entityId'] . \"','\" . $apptDet['appointment_id'] . \"','\" . $args['ent_report_msg'] . \"','\" . $this->curr_date_time . \"')\";\n mysql_query($insertIntoReportQry, $this->db->conn);\n\n if (mysql_insert_id() > 0) {\n $updateQryReq = \"update appointment set payment_status = '2' where appointment_id = '\" . $apptDet['appointment_id'] . \"'\";\n mysql_query($updateQryReq, $this->db->conn);\n\n $message = \"Dispute reported for appointment dated \" . date('d-m-Y h:i a', strtotime($apptDet['appointment_dt'])) . \" on \" . $this->appName . \"!\";\n\n $aplPushContent = array('alert' => $message, 'nt' => '13', 'n' => $this->User['firstName'] . ' ' . $this->User['last_name'], 'd' => $args['ent_appnt_dt'], 'e' => $this->User['email'], 'bid' => $apptDet['appointment_id']);\n $andrPushContent = array(\"payload\" => $message, 'action' => '13', 'sname' => $this->User['firstName'] . ' ' . $this->User['last_name'], 'dt' => $args['ent_appnt_dt'], 'smail' => $this->User['email'], 'bid' => $apptDet['appointment_id']);\n\n $this->ios_cert_path = $this->ios_uberx_driver;\n $this->ios_cert_pwd = $this->ios_mas_pwd;\n $this->androidApiKey = $this->masterApiKey;\n $push = $this->_sendPush($this->User['entityId'], array($apptDet['mas_id']), $message, '13', $this->User['email'], $this->curr_date_time, '1', $aplPushContent, $andrPushContent);\n\n $errMsgArr = $this->_getStatusMessage(85, $push);\n } else {\n $errMsgArr = $this->_getStatusMessage(86, 76);\n }\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 't' => $insertIntoReportQry);\n }",
"public function recordHit()\n {\n global $configArray;\n\n if ($configArray['Statistics']['enabled']) {\n // Setup Statistics Index Connection\n $solrStats = ConnectionManager::connectToIndex('SolrStats');\n\n // Save Record View\n $solrStats->saveRecordView($this->recordDriver->getUniqueID());\n unset($solrStats);\n }\n }",
"public function isCaptureAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/capture');\n }",
"final private function log_reputation_change(ReputationChange $change) {\r\n\t\tthrow new PemissionException('You do not have permission as an anonymous user to attempt this action');\r\n\t}"
] | [
"0.7668425",
"0.6778277",
"0.6778277",
"0.6554328",
"0.6554328",
"0.6009658",
"0.55407953",
"0.55402875",
"0.5365371",
"0.5317638",
"0.5304101",
"0.5304101",
"0.5301933",
"0.5125348",
"0.5078407",
"0.5042903",
"0.50420034",
"0.5029171",
"0.5015953",
"0.5008906",
"0.49963698",
"0.49963698",
"0.49963698",
"0.49820292",
"0.49819008",
"0.49811763",
"0.4979281",
"0.49742955",
"0.49498454",
"0.4948319",
"0.49395496",
"0.49313182",
"0.49305344",
"0.49276584",
"0.4921016",
"0.488978",
"0.48844957",
"0.4870349",
"0.4869511",
"0.48633778",
"0.48355114",
"0.48085862",
"0.48083317",
"0.47957912",
"0.47922105",
"0.47856057",
"0.47683585",
"0.47460148",
"0.47417766",
"0.47392106",
"0.4731142",
"0.47171834",
"0.4702438",
"0.4702209",
"0.469636",
"0.469593",
"0.46938935",
"0.468396",
"0.46807367",
"0.46791637",
"0.46730745",
"0.46677396",
"0.46667826",
"0.46588746",
"0.46492225",
"0.46481806",
"0.46458125",
"0.46448234",
"0.4642722",
"0.4624842",
"0.46244743",
"0.46108925",
"0.4605986",
"0.46021506",
"0.4600157",
"0.45924526",
"0.4588229",
"0.45867237",
"0.45834154",
"0.45797348",
"0.45767772",
"0.45737457",
"0.45705482",
"0.4565782",
"0.45603442",
"0.455809",
"0.45562914",
"0.45524195",
"0.45504832",
"0.454862",
"0.45480478",
"0.45443857",
"0.45437685",
"0.4538287",
"0.45348984",
"0.45335397",
"0.45314845",
"0.45301202",
"0.4529789",
"0.4529232"
] | 0.7510679 | 1 |
verify on Results page that impression even was created | public function verifyResultsPageInYourProjectShowsImpressionEvent(): void
{
print "Go to your project's results page and verify decisions events are showing (5 min delay)";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function verifyLogsImpressionsEventsDispatched(): void\n {\n // 💡️ Create a new flag with an A/B Test eg \"product_version\"\n $featureFlagKey = 'product_version';\n $logger = new DefaultLogger(Logger::DEBUG);\n $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);\n $localUserContext = $localOptimizelyClient->createUserContext($this->userId);\n\n // review the DEBUG output, ensuring you see an impression log\n // \"Dispatching impression event to URL https://logx.optimizely.com/v1/events with params...\"\n $localUserContext->decide($featureFlagKey);\n }",
"function formlift_track_impression( $formID ) {\n\tglobal $FormLiftUser;\n\n// if ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n// return;\n\n\tif ( ! $FormLiftUser->hasImpression( $formID ) ) {\n\t\t$FormLiftUser->addImpression( $formID );\n\t\tformlift_add_impression( $formID );\n\n\t\t$imps = formlift_get_form_impressions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\t\t$subs = formlift_get_form_submissions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\n\t\tformlift_update_form_stats( $formID, $imps, $subs );\n\t}\n}",
"public function verifyLogsImpressionsEventsDispatched(): void\n {\n // 💡️ Be sure that your FLAG_KEYS array above includes A/B Test eg \"product_version\"\n $logger = new DefaultLogger(Logger::DEBUG);\n $localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);\n $localUserContext = $localOptimizelyClient->createUserContext($this->userId);\n\n // review the DEBUG output, ensuring you see an impression log for each experiment type in your FLAG_KEYS\n // \"Dispatching impression event to URL https://logx.optimizely.com/v1/events with params...\"\n // ⚠️ Your Rollout type flags should not have impression events\n $localUserContext->decideForKeys(FLAG_KEYS);\n }",
"function nnr_stats_record_impresssion_v1() {\n\n\t$data_id = $_POST['data_id'];\n\t$table_name = $_POST['table_name'];\n\n\t// Return false if no data is given\n\n\tif ( !isset($data_id) ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because no Data ID given.');\n\t}\n\n\t// Return false if crawler\n\n\tif ( nnr_stats_is_bot_v1() ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because a crawler was detected.');\n\t}\n\n\t// Return if user is admin or higher\n\n\tif ( current_user_can('edit_published_posts') ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because current user is an admin.');\n\t}\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . $table_name;\n\t$today = date('Y-m-d');\n\n\t// Check if entry already exsits\n\n\t$impressions = $wpdb->query($wpdb->prepare('SELECT * FROM ' . $table_name . ' WHERE `date` = %s AND `data_id` = %d', $today, $data_id));\n\n\t// Entry aleady exists, just add 1\n\n\tif ( isset($impressions) && $impressions != 0 ) {\n\n\t\t$result = $wpdb->query($wpdb->prepare('UPDATE ' . $table_name . ' SET\n\t\t\t`impressions` = `impressions` + 1\n\t\t\tWHERE `date` = %s AND `data_id` = %d', $today, $data_id\n\t\t));\n\n\t}\n\n\t// Entry does not exist, create a new one and set impressions to 1\n\n\telse {\n\n\t\t$result = $wpdb->query($wpdb->prepare('INSERT INTO ' . $table_name . ' (\n\t\t\t`date`,\n\t\t\t`data_id`,\n\t\t\t`impressions`,\n\t\t\t`conversions`\n\t\t\t) VALUES (%s, %d, 1, 0)',\n\t\t\t$today,\n\t\t\t$data_id\n\t\t));\n\n\t}\n\n\tif ( $result ) {\n\t\tnnr_stats_return_data_v1('Impression was able to be recored.');\n\t} else {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored.');\n\t}\n}",
"public function Impress() {\n if ($this->native_session_id) {\n $result = mysql_query(\"UPDATE http_session SET last_impression = NOW() WHERE id = \" . $this->native_session_id);\n //var_dump($result);\n if (!$result) {\n die('4 - Invalid query: ' . mysql_error());\n }\n }\n\n }",
"public function testComDayCqWcmFoundationImplPageImpressionsTracker()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.foundation.impl.PageImpressionsTracker';\n\n $crawler = $client->request('POST', $path);\n }",
"function test_treatments_report_true()\n {\n $this->seed();\n\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create(['public' => 1]);\n $treatment = Treatment::first();\n $response = $this->json('POST', '/api/report/'.$treatment->id.'?token='.$token);\n $response->assertOk()->assertJsonFragment(['isReported'=>true]);\n }",
"public function cohorte_imprimer_impressions() {\n\t\t\t$Cohortes = $this->Components->load( 'WebrsaCohortesDossierspcgs66Impressions' );\n\t\t\t$Cohortes->impressions(\n\t\t\t\tarray(\n\t\t\t\t\t'modelName' => 'Dossierpcg66',\n\t\t\t\t\t'modelRechercheName' => 'WebrsaCohorteDossierpcg66Imprimer',\n\t\t\t\t\t'configurableQueryFieldsKey' => 'Dossierspcgs66.cohorte_imprimer'\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"public function hasResults();",
"public function isHasResults();",
"public function getSocialImpression()\n\t{\n\t\tif (isset($this->uniqueImpression)) {\n\n\t\t\treturn $this->uniqueImpression;\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function getUniqueImpression()\n\t{\n\t\tif (isset($this->uniqueImpression)) {\n\n\t\t\treturn $this->uniqueImpression;\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function test_resultsAreValidFormat() {\n $types = ['track'];\n\n foreach ($types as $tk => $type) {\n $searchInstance = new SpotifySearch('a', $type, SingletonTokenContainer::get());\n $results = $searchInstance->getNextPage()->get();\n\n foreach ($results as $ik => $item) {\n $this->assertNotEmpty($item->href);\n $this->assertNotEmpty($item->name);\n if ($type != 'track') {\n $this->assertNotEmpty($item->images);\n } else {\n $this->assertNotEmpty($item->album);\n }\n }\n }\n\n }",
"public function has_results()\r\n {\r\n \t$tbl_stats = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);\r\n\t\t$sql = 'SELECT count(exe_id) AS number FROM '.$tbl_stats\r\n\t\t\t\t.\" WHERE exe_cours_id = '\".$this->get_course_code().\"'\"\r\n\t\t\t\t.' AND exe_exo_id = '.$this->get_ref_id();\r\n \t$result = api_sql_query($sql, __FILE__, __LINE__);\r\n\t\t$number=mysql_fetch_row($result);\r\n\t\treturn ($number[0] != 0);\r\n }",
"public function setUniqueImpression($value)\n\t{\n\t\t$this->uniqueImpression = $value;\t\n\t}",
"public function gagnerExperience()\n {\n $this->_experience++;\n }",
"function test_treatments_report_blocked_true()\n {\n $this->seed();\n\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create(['public' => 1]);\n $treatment = Treatment::first();\n $response = $this->json('POST', '/api/report/'.$treatment->id.'?token='.$token);\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $response = $this->json('POST', '/api/report/'.$treatment->id.'?token='.$token);\n $response->assertOk()->assertJsonFragment(['isReported'=>true]);\n }",
"public function AnomalyPageTest()\n {\n // Test user login\n $user = $this->testAccounts[\"anthro-analyst\"];\n $this->browse(function ($browser) use ($user) {\n $browser->visit(new loginPage)\n ->loginUser($user['email'], $user['password'])\n ->pause(3000)\n ->assertSee('Welcome');\n\n $browser->visit(new specimenPage)\n ->pause(5000)\n ->maximize()\n ->pause(2000)\n\n ->click('@leftSideBar-menu')\n ->pause(2000)\n ->click('@project-report-button')\n ->driver->switchTo()->window(collect($browser->driver->getWindowHandles())->last());\n $browser\n ->pause(3000)\n\n ->click('@anomaly_as')\n ->pause(10000)\n ->assertSee('Accession Number')\n ->assertSee('Bone')\n ->assertSee('Provenance 1')\n ->assertSee('Provenance 2')\n ->assertSee('Side')\n ->assertSee('Anomaly')\n\n ->pause(3000)\n\n\n ->logoutUser();\n });\n }",
"public function update_impressions(){\n if( ! $this->is_valid_nonce( 'mpp_ajax_nonce' ) ){\n die();\n }\n if( ! isset( $_POST['popup_id'] ) || ! $this->plugin->is_published_popup( $_POST['popup_id'] ) ){\n die();\n }\n $result = array();\n $result['success'] = false;\n $popup_id = $_POST['popup_id'];\n $restore = isset( $_POST['restore'] ) ? $_POST['restore'] : false;\n\n if( $restore == 'true' || $restore === true ){\n $impressions = 0;\n update_post_meta( $popup_id, 'mpp_impressions', 0 );\n } else{\n $impressions = (int) get_post_meta( $popup_id, 'mpp_impressions', true );\n update_post_meta( $popup_id, 'mpp_impressions', ++$impressions );\n }\n $result['success'] = true;\n $result['impressions'] = $impressions;\n wp_send_json( $result );\n }",
"function qa_check_page_clicks()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_page_error_html;\n\n\tif (qa_is_http_post()) {\n\t\tforeach ($_POST as $field => $value) {\n\t\t\tif (strpos($field, 'vote_') === 0) { // voting...\n\t\t\t\t@list($dummy, $postid, $vote, $anchor) = explode('_', $field);\n\n\t\t\t\tif (isset($postid) && isset($vote)) {\n\t\t\t\t\tif (!qa_check_form_security_code('vote', qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'app/votes.php';\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/selects.php';\n\n\t\t\t\t\t\t$userid = qa_get_logged_in_userid();\n\n\t\t\t\t\t\t$post = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $postid));\n\t\t\t\t\t\t$qa_page_error_html = qa_vote_error_html($post, $vote, $userid, qa_request());\n\n\t\t\t\t\t\tif (!$qa_page_error_html) {\n\t\t\t\t\t\t\tqa_vote_set($post, $userid, qa_get_logged_in_handle(), qa_cookie_get(), $vote);\n\t\t\t\t\t\t\tqa_redirect(qa_request(), $_GET, null, null, $anchor);\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\n\t\t\t} elseif (strpos($field, 'favorite_') === 0) { // favorites...\n\t\t\t\t@list($dummy, $entitytype, $entityid, $favorite) = explode('_', $field);\n\n\t\t\t\tif (isset($entitytype) && isset($entityid) && isset($favorite)) {\n\t\t\t\t\tif (!qa_check_form_security_code('favorite-' . $entitytype . '-' . $entityid, qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'app/favorites.php';\n\n\t\t\t\t\t\tqa_user_favorite_set(qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), $entitytype, $entityid, $favorite);\n\t\t\t\t\t\tqa_redirect(qa_request(), $_GET);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} elseif (strpos($field, 'notice_') === 0) { // notices...\n\t\t\t\t@list($dummy, $noticeid) = explode('_', $field);\n\n\t\t\t\tif (isset($noticeid)) {\n\t\t\t\t\tif (!qa_check_form_security_code('notice-' . $noticeid, qa_post_text('code')))\n\t\t\t\t\t\t$qa_page_error_html = qa_lang_html('misc/form_security_again');\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($noticeid == 'visitor')\n\t\t\t\t\t\t\tsetcookie('qa_noticed', 1, time() + 86400 * 3650, '/', QA_COOKIE_DOMAIN, (bool)ini_get('session.cookie_secure'), true);\n\n\t\t\t\t\t\telseif ($noticeid == 'welcome') {\n\t\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/users.php';\n\t\t\t\t\t\t\tqa_db_user_set_flag(qa_get_logged_in_userid(), QA_USER_FLAGS_WELCOME_NOTICE, false);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trequire_once QA_INCLUDE_DIR . 'db/notices.php';\n\t\t\t\t\t\t\tqa_db_usernotice_delete(qa_get_logged_in_userid(), $noticeid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tqa_redirect(qa_request(), $_GET);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public function testProfilePrototypeCountReviews()\n {\n\n }",
"public function testAccessibilityAnalysisResource()\n {\n $mockAdminApi = new MockAdminApi();\n $mockAdminApi->asset(self::$UNIQUE_TEST_ID, ['accessibility_analysis' => true]);\n $lastRequest = $mockAdminApi->getMockHandler()->getLastRequest();\n\n self::assertRequestQueryStringSubset($lastRequest, ['accessibility_analysis' => '1']);\n }",
"public function testIsResultsCountEnabledException()\n {\n $objectManagerMock = $this->getMockBuilder(\\Magento\\Framework\\ObjectManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $objectManagerMock->expects($this->once())\n ->method('create')\n ->willReturn(null);\n\n $objectManagerHelper = new ObjectManagerHelper($this);\n /* @var $model \\Magento\\AdvancedSearch\\Model\\SuggestedQueries */\n $model = $objectManagerHelper->getObject(\n \\Magento\\AdvancedSearch\\Model\\SuggestedQueries::class,\n [\n 'engineResolver' => $this->engineResolverMock,\n 'objectManager' => $objectManagerMock,\n 'data' => ['my_engine' => 'search_engine']\n ]\n );\n $model->isResultsCountEnabled();\n }",
"public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }",
"function testFindAppearsOn() {\n\t\t$result = $this->Album->find('appearsOn', array('limit' => 1, 'order' => 'release_date ASC'));\n\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals($result[0]['Album']['title'], 'Knifetank (The Albumhole)');\n\t}",
"public function testListPastWebinarPollResults()\n {\n }",
"public function mockupRiskScreening()\n {\n $f = Questionaire::with('questions.choices.subchoices')\n ->find(env('APP_RISK_ID'));\n\n $participants = Participant::all();\n $i = 0;\n $c = count($participants);\n foreach ($participants as $p) {\n $this->createAnswers($f, $p);\n\n // Points doesn't really matter alot in risk form\n $this->createResults($f, $p, 999); \n\n echo \"risk results & answers \".($i+1).\"/\".$c.\" created\\r\";\n\n $i++;\n }\n }",
"public function testReportsReputationHistoryGet()\n {\n }",
"public function getNewsfeedImpression()\n\t{\n\t\tif (isset($this->newsfeed_impression)) {\n\n\t\t\treturn $this->newsfeed_impression;\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function testQuestionViewExistingID() {\n $response = $this->get('question/' . $this->question->id);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }",
"public function testMovieReviewSuccess(): void\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new MovieReview())\n ->type('@review', 'Test to see if reviews still work.')\n ->assertDontSee('Review must be at least 15 characters')\n ->assertDontSee('Review is a required field')\n ->click('@submit-review')\n ->waitFor('@results', 10)\n ->assertSeeIn('@results', 'The review is negative, I\\'m 57.44% sure.');\n });\n }",
"public function testAutoreportDaily()\n {\n echo \"\\n ---- Page : autoreport/daily ---- \\n\";\n $response = $this->visit('autoreport/daily');\n $this->assertResponseStatus($response->response->getStatusCode());\n echo \"Response is \". $response->response->getStatusCode();\n echo \"\\n\";\n }",
"public function hasExperiment(){\n return $this->_has(2);\n }",
"static private function link_naked_arxiv() {\n // if(self::quick()) return null;\n\n // Pick arXiv IDs within the last year which do not have INSPIRE record.\n $stats = self::inspire_regenerate(\"SELECT arxiv FROM records WHERE (inspire = '' OR inspire IS NULL) AND (arxiv != '' AND arxiv IS NOT NULL) AND (published + interval 1 year > now())\");\n\n if (sizeof($stats->found) > 0)\n self::log(sizeof($stats->found) . \" arXiv ids were associated with INSPIRE: \" . implode(\", \", $stats->found) . \".\");\n if (sizeof($stats->lost) > 0)\n self::log(sizeof($stats->lost) . \" arXiv ids were not found on INSPIRE: \" . implode(\", \", $stats->lost) . \".\");\n }",
"public function testWebinarAbsentees()\n {\n }",
"public function check_auth_reviews() {\n\t\tif ( isset( $_GET['wp_confirm_reviews_insurance'] ) ) {\n\n\t\t\t//check auth Code\n\t\t\t$comment_id = Helper::check_auth_comment( $_GET['wp_confirm_reviews_insurance'] );\n\t\t\tif ( $comment_id != false ) {\n\n\t\t\t\t//remove meta Key\n\t\t\t\tdelete_comment_meta( $comment_id, 'auth_key' );\n\n\t\t\t\t//Add Validate User Reviews\n\t\t\t\tupdate_comment_meta( $comment_id, 'comment_approve_user', 'yes' );\n\n\t\t\t\t//Show Alert\n\t\t\t\techo '<div class=\"confirm-review-alert\">' . WP_REVIEWS_INSURANCE::$option['email_thanks_text'] . '</div>';\n\t\t\t\techo '\n\t\t\t\t<script>\n\t\t\t\tjQuery(document).ready(function(){\n\t\t\t\t jQuery(\".confirm-review-alert\").delay(1500).fadeOut(\"normal\"); \n\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t}\n\t\t}\n\t}",
"public function getSocialUniqueImpression()\n\t{\n\t\tif (isset($this->socialUniqueImpression)) {\n\n\t\t\treturn $his->socialUniqueImpression;\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function test_without_login_make_a_review()\n {\n $user = User::factory()->create();\n $film = Film::factory()->create();\n\n $response = $this->get(\"/review/{$film->id}\");\n $response->assertStatus(302);\n }",
"public function setSocialUniqueImpression($value)\n\t{\n\t\t$this->socialUniqueImpression = $value;\n\t}",
"abstract function is_trial_utilized();",
"public function results()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->match((isset($this->request->get['limit']) ? $this->request->get['limit'] : null));\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 testProfilePrototypeCountLikes()\n {\n\n }",
"static function hasAnAnswerPage ()\n {\n return true;\n }",
"public function hasResults() {\n\t\treturn $this->count() >= 1;\n\t}",
"protected function assertFlagWidget(): void {\n $this->assertSession()->pageTextNotContains('Flag other translations as outdated');\n $this->assertSession()->pageTextContains('Translations cannot be flagged as outdated when content is moderated.');\n }",
"public function testWrongSubmission()\n {\n $client = static::createClient();\n $client->followRedirects();\n\n $crawler = $client->request('GET', '/play');\n\n $movieId = $crawler->filter('#quizz_movie')->attr('value');\n $actorId = $crawler->filter('#quizz_actor')->attr('value');\n\n $movieRepo = $client->getContainer()->get('doctrine')->getRepository('AppBundle:Movie');\n $personRepo = $client->getContainer()->get('doctrine')->getRepository('AppBundle:Person');\n\n $movie = $movieRepo->find($movieId);\n $person = $personRepo->find($actorId);\n\n if ($movie->isActor($person)) {\n $form = $crawler->selectButton('quizz_no')->form();\n } else {\n $form = $crawler->selectButton('quizz_yes')->form();\n }\n\n $client->submit($form);\n\n $request = $client->getRequest();\n $this->assertEquals('/gameover', $request->getPathInfo(), 'on a wrong submission, player is redirected on /gameover');\n }",
"function track_clicks_allowed_by_user(){\n if (!$this->get_config('track_visits_of_loggedin_users',true) && serendipity_userLoggedIn()){\n return false;\n }\n return true;\n }",
"function testFindBooksResults() {\n\n /* test title */\n echo '<h2 style=\"color: black;\">testFindBookResults...</h2>';\n\n /* can't page layout because of the indeterminate nature of\n * results (i.e. we can't guarantee there's a book in the \n * production database, and the page layout depends on whether\n * or not there's a result)*/\n\n /* a fix for this could be to possibly display the\n * container (div or whatever) for results, then just\n * not populate it with anything if no results */\n\n $this->assertTrue(1);\n\n }",
"public function testExists()\n {\n $this->assertFalse($this->insight->accounts->exists(12345));\n $this->insight->accounts->addTrial(12345);\n $this->assertTrue($this->insight->accounts->exists(12345));\n }",
"public function gagnerExperience()\n {\n }",
"public function listing_impression() {\n\n global $product, $woocommerce_loop;\n $products = WC_Gokeep_JS::get_instance()->listing_impression( $product, $woocommerce_loop['loop'] );\n }",
"function wct_page_has_scores_on_it($html) {\n\t$teams = $html->find('.linescoreteamlink');\n\tif (count($teams) == 0) {\n\t\treturn false;\n\t}\n\treturn true;\n}",
"public function test_all_item_listed_or_no_listed_items_message_is_displayed()\n {\n $response = $this->get('/');\n if($response->assertSeeText(\"Details\")){\n $response->assertDontSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n } else {\n $response->assertSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n }\n }",
"public function testAutoreport()\n {\n echo \"\\n ---- Page : autoreport ---- \\n\";\n $response = $this->visit('autoreport');\n $this->assertResponseStatus($response->response->getStatusCode());\n echo \"Response is \". $response->response->getStatusCode();\n echo \"\\n\";\n }",
"public function testEventimCanBeReached()\n\t{\n\t\t$response = $this->crawler->getClient()->request('GET', 'http://www.eventim.de/yung-hurn-aachen-tickets.html?affiliate=EYA&doc=artistPages%2Ftickets&fun=artist&action=tickets&key=2078585%2410513338&jumpIn=yTix');\n\t\t$this->assertEquals(\n\t\t\t200,\n\t\t\t$response->getStatusCode()\n\t\t);\n\t}",
"public function setNewsfeedImpression($value)\n\t{\n\t\t$this->newsfeed_impression = $value;\n\t}",
"public static function cmac_get_banner_impressions_cnt($banner_id)\n {\n global $wpdb;\n// $impressions_cnt = $wpdb->get_var('SELECT count(*) FROM ' . self::$historyTable . ' WHERE `event_type`=\"impression\" AND `banner_id`=\"' . $banner_id . '\"');\n $impressions_cnt = 0;\n return $impressions_cnt;\n }",
"public function index()\n {\n return 'List all page impressions here';\n }",
"public function testShowAllIncidences()\n {\n //1. Preparar el test\n //2. Executar el codi que vull provar.\n //3. Comprovo: assert\n\n $incidences = factory(Incidence::class, 50) -> create();\n\n\n $response = $this->get('/incidences');\n $response->assertStatus(200);\n $response->assertSuccessful();\n $response->assertViewIs('list_events');\n\n\n //TODO faltaria contar que hi ha 50 al resultat\n\n// foreach ( $incidences as $incidence) {\n// $response->assertSeeText($incidence->title);\n// $response->assertSeeText($incidence->description);\n// }\n }",
"public function showResults(){\n $this->extractQuestions();\n }",
"function test_treatments_rate_true()\n {\n $this->seed();\n\n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create(['public' => 1]);\n $treatment = Treatment::first();\n $response = $this->json('POST', '/api/rate/'.$treatment->id.'?token='.$token);\n $response->assertOk()->assertJsonFragment(['isStar'=>true]);\n }",
"public function verifiedAt();",
"function idealEnabled() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$sql = 'SELECT COUNT(id) FROM #__osmembership_plugins WHERE name=\"os_ideal\" AND published=1';\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$total = $db->loadResult() ;\r\n\t\tif ($total) {\r\n\t\t\trequire_once JPATH_ROOT.'/components/com_osmembership/plugins/ideal/ideal.class.php';\r\n\t\t\treturn true ;\r\n\t\t} else {\r\n\t\t\treturn false ;\r\n\t\t}\r\n\t}",
"public function testProfilePrototypeFindByIdLikes()\n {\n\n }",
"public function testAssessmentIsCreated()\n {\n $this->withoutExceptionHandling();\n $response = $this->post(route('assessments.store'), $this->getData());\n\n $response->assertStatus(200);\n\n $this->assertCount(1, Assessment::all());\n }",
"function wyz_business_stats_visits() {\n\tif ( ! isset($_POST['id']) || ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'wyz_ajax_custom_nonce' ) )\n\t\treturn;\n\t$id = esc_html( $_POST['id'] );\n\tif( false === get_post_status( $id ) )\n\t\treturn;\n\tWyzHelpers::maybe_increment_business_visits( $id );\n\twp_die();\n}",
"function exam_take_page_advance_confirm($form, &$form_state) {\n \n print '<p>pButtonClicked = ' . $_SESSION['exam']['pButtonClicked'] . '</p>';\n print '<p>pNextButtonClick = ' . $_SESSION['exam']['pNextButtonClick'] . '</p>';\n \n if ($_SESSION['exam']['pButtonClicked'] == $_SESSION['exam']['pNextButtonClick']) {\n print '<p>IF</p>';\n // All is good\n $_SESSION['exam']['pNextButtonClick']++;\n } else {\n print '<p>ELSE</p>';\n // The test taker is not using buttons to advance\n // Presumably that means he or she is using the browser\n // to back up through the exam.\n // Interrupt this navigation and redirect the user to the \n // summary page\n $form_state['redirect'] = array('exam/summary/' . $_SESSION['exam']['pExamTitleURL']);\n }\n \n return null;\n \n}",
"public function testProfilePrototypeFindByIdReviews()\n {\n\n }",
"public function store(PageImpressionFormRequest $request)\n {\n $impression = PageImpression::create([\n 'date' => $request->get('date'),\n 'user_uuid' => $request->get('user_uuid'),\n 'application_uuid' => $request->get('application_uuid'),\n 'device_uuid' => $request->get('device_uuid'),\n 'node_uuid' => $request->get('node_uuid')\n ]);\n\n\n if ($impression)\n return response()->json(['data'=>$impression,'success'=>true,'msg'=>trans('application.record_created')],201);\n else\n return response()->json(['success'=>false,'msg'=>trans('application.record_creation_failed')],404);\n \n }",
"abstract function is_trial();",
"public function hasResult()\n {\n return Claroline::getDatabase()->query( \"\n SELECT\n user_id\n FROM\n `{$this->tbl['examination_score']}`\n WHERE\n user_id = \" . Claroline::getDatabase()->escape( $this->userId )\n )->numRows();\n }",
"final public function record_attempt($context) {\n global $DB, $USER, $OUTPUT;\n /**\n * This should be overridden by each page type to actually check the response\n * against what ever custom criteria they have defined\n */\n $result = $this->check_answer();\n $result->attemptsremaining = 0;\n $result->maxattemptsreached = false;\n $lesson = $this->lesson;\n $modid = $DB->get_field('modules', 'id', array('name'=>'languagelesson'));\n $cmid = $DB->get_field('course_modules', 'id', array('module'=>$modid, 'instance'=>$this->lesson->id));\n\n if ($result->noanswer) {\n $result->newpageid = $this->properties->id; // Display same page again.\n $result->feedback = get_string('noanswer', 'languagelesson');\n } else {\n switch ($result->typeid) {\n \n case LL_ESSAY :\n $isessayquestion = true;\n \n $attempt = new stdClass;\n $attempt->lessonid = $this->lesson->id;\n $attempt->pageid = $this->properties->id;\n $attempt->userid = $USER->id;\n $attempt->type = $result->typeid;\n $attempt->answerid = $result->answerid;\n \n $useranswer = $result->userresponse;\n $useranswer = clean_param($useranswer, PARAM_RAW);\n $attempt->useranswer = $useranswer; \n // If the student had previously submitted an attempt on this question, and it has since been graded,\n\t\t // Mark this new submission as a resubmit.\n if ($prevAttempt = languagelesson_get_most_recent_attempt_on($attempt->pageid, $USER->id)) {\n $attempt->retry = $prevAttempt->retry;\n if (! $oldManAttempt = $DB->get_record('languagelesson_attempts', array('id'=>$prevAttempt->id))) {\n error('Failed to fetch matching manual_attempt record for old attempt on this question!');\n }\n if ($oldManAttempt->graded && !$lesson->autograde) {\n $attempt->resubmit = 1;\n $attempt->viewed = 0;\n $attempt->graded = 0;\n }\n } else {\n $attempt->retry = 0;\n }\n /*if (!$answer = $DB->get_record(\"languagelesson_answers\", array(\"pageid\"=>$page->id))) {\n print_error(\"Continue: No answer found\");\n }*/\n $correctanswer = false;\n\t\t //$newpageid = $this->nextpageid;\n\n // AUTOMATIC GRADING.\n // If this lesson is to be auto-graded...\n if ($lesson->autograde === 1) {\n $correctanswer = true;\n // Flag it as graded\n $attempt->graded = 1;\n $attempt->viewed = 1;\n // Set the grade to the maximum point value for this question.\n $maxscore = $DB->get_field('languagelesson_pages', 'maxscore', array('id'=>$attempt->pageid));\n $score = $maxscore;\n } else {\n \t\t // If it's not, mark these submissions as ungraded.\n $score = 0;\n }\n \n $attempt->iscurrent = 1;\n $attempt->score = $score;\n $attempt->timeseen = time();\n \n // Check for maxattempts, 0 means unlimited attempts are allowed.\n $nattempts = $attempt->retry;\n if ($this->lesson->maxattempts != 0) { // Don't bother with message if unlimited.\n if ($nattempts >= $this->lesson->maxattempts || $this->lesson->maxattempts == 1){\n $result->maxattemptsreached = true;\n $result->newpageid = LL_NEXTPAGE;\n $result->attemptsremaining = 0;\n } else {\n $result->attemptsremaining = $this->lesson->maxattempts - $nattempts;\n }\n }\n \n // Insert/update some records.\n if (!has_capability('mod/languagelesson:manage', $context)) {\n // Pull the retry value for this attempt, and handle deflagging former current attempt \n\t\t\t\n if ($oldAttempt = languagelesson_get_most_recent_attempt_on($attempt->pageid, $USER->id)) {\n $nretakes = $oldAttempt->retry + 1;\n\n // Update the old attempt to no longer be marked as the current one.\n $attempt->id = $oldAttempt->id;\n \n // Set the retake value.\n $attempt->retry = $nretakes;\n \n // Flag this as the current attempt.\n $attempt->correct = $correctanswer;\n \n if (! $DB->update_record('languagelesson_attempts', $attempt)) {\n error('Failed to update previous attempt!');\n }\n \n } else {\n $nretakes = 1;\n \n // Set the retake value.\n $attempt->retry = $nretakes;\n \n // Flag this as the current attempt.\n $attempt->correct = $correctanswer;\n \n // Every try is recorded as a new one (by increasing retry value), so just insert this one.\n if (!$newattemptid = $DB->insert_record(\"languagelesson_attempts\", $attempt)) {\n error(\"Continue: attempt not inserted\");\n }\n }\n } \n break;\n \n default :\n \n // Record student's attempt.\n $attempt = new stdClass;\n $attempt->lessonid = $this->lesson->id;\n $attempt->pageid = $this->properties->id;\n $attempt->userid = $USER->id;\n \n if ($result->answerid != null) {\n $attempt->answerid = $result->answerid;\n } else {\n $attempt->answerid = 0;\n }\n \n $attempt->type = $result->typeid;\n $attempt->correct = $result->correctanswer;\n $attempt->iscurrent = 1;\n \n if ($result->score == null) {\n $attempt->score = 0;\n } else if ($result->correctanswer) {\n $maxscore = $DB->get_field('languagelesson_pages', 'maxscore', array('id'=>$attempt->pageid));\n $attempt->score = $maxscore;\n } else {\n $attempt->score = $result->score;\n }\n \n if ($result->userresponse !== null) {\n $attempt->useranswer = $result->userresponse;\n }\n \n $attempt->timeseen = time();\n \n if ($previousattempt = $DB->get_record('languagelesson_attempts',\n array('lessonid'=> $attempt->lessonid, 'pageid'=>$attempt->pageid,\n 'userid'=>$attempt->userid, 'iscurrent'=>1))) {\n $attempt->id = $previousattempt->id;\n $attempt->retry = $previousattempt->retry + 1;\n if ($oldFile = $DB->get_record('files', array('id'=>$previousattempt->fileid))) {\n // Delete the previous audio file.\n languagelesson_delete_submitted_file($oldFile);\n }\n if ($previousattempt->graded = 1) {\n // Set it as resubmit.\n $attempt->resubmit = 1;\n // Remove old feedback files if they exist\n if ($oldfeedback = $DB->get_records('languagelesson_feedback', array('attemptid'=>$attempt->id), null, 'id, fileid')) {\n if ($oldfeedback->fileid != NULL) {\n foreach ($oldfeedback as $oldrecord) {\n $oldfilerecord = $DB->get_record('files', array('id'=>$oldrecord->fileid));\n languagelesson_delete_submitted_file($oldfilerecord);\n $DB->delete_records('languagelesson_feedback', array('fileid'=>$oldrecord->fileid));\n }\n }\n }\n }\n if (($this->lesson->maxattempts == 0) || ($this->lesson->maxattempts >= $attempt->retry)) {\n $DB->update_record(\"languagelesson_attempts\", $attempt, true);\n }\n } else {\n $attempt->retry = 1;\n $DB->insert_record('languagelesson_attempts', $attempt, true);\n }\n $recordedattemptid = $DB->get_field('languagelesson_attempts', 'id',\n array('lessonid'=>$attempt->lessonid, 'userid'=>$attempt->userid,\n 'pageid'=>$attempt->pageid));\n\n } // End switch.\n \n // And update the languagelesson's grade.\n\t\t// NOTE that this happens no matter the question type.\n\n if ($lesson->type != LL_TYPE_PRACTICE) {\n // Get the lesson's graded information.\n\n if ($gradeinfo = $DB->get_record('languagelesson_grades', array('lessonid'=>$lesson->id, 'userid'=>$USER->id))){\n $gradeinfo->grade = languagelesson_calculate_user_lesson_grade($lesson->id, $USER->id);\n } else {\n $gradeinfo = new stdClass;\n $gradeinfo->grade = languagelesson_calculate_user_lesson_grade($lesson->id, $USER->id);\n }\n \n // Save the grade.\n languagelesson_save_grade($lesson->id, $USER->id, $gradeinfo->grade);\n \n // Finally, update the records in the gradebook.\n languagelesson_grade_item_update($lesson);\n \n $gradeitem = $DB->get_record('grade_items', array('iteminstance'=>$lesson->id, 'itemmodule'=>'languagelesson'));\n $DB->set_field('grade_grades', 'finalgrade', $gradeinfo->grade, array('userid'=>$USER->id, 'itemid'=>$gradeitem->id));\n \n languagelesson_update_grades($lesson, $USER->id);\n \n }\n \n // \"number of attempts remaining\" message if $this->lesson->maxattempts > 1\n // Displaying of message(s) is at the end of page for more ergonomic display.\n \n // IT'S NOT HITTING THIS CONTROL GROUP BELOW FOR SOME REASON.\n if ((!$result->correctanswer && ($result->newpageid == 0)) || $result->typeid == LL_AUDIO) {\n // Wrong answer and student is stuck on this page - check how many attempts.\n // The student has had at this page/question.\n $nattempts = $attempt->retry;\n // $nattempts = $DB->count_records(\"languagelesson_attempts\", array(\"pageid\"=>$this->properties->id,\n // \"userid\"=>$USER->id, \"retry\" => $attempt->retry));\n // Retreive the number of attempts left counter for displaying at bottom of feedback page.\n if ($this->lesson->maxattempts != 0) { // Don't bother with message if unlimited.\n if ($nattempts >= $this->lesson->maxattempts || $this->lesson->maxattempts == 1){\n $result->maxattemptsreached = true;\n $result->newpageid = LL_NEXTPAGE;\n $result->attemptsremaining = 0;\n } else {\n $result->attemptsremaining = $this->lesson->maxattempts - $nattempts;\n }\n }\n }\n \n // TODO: merge this code with the jump code below. Convert jumpto page into a proper page id.\n if ($result->newpageid == 0) {\n $result->newpageid = $this->properties->id;\n } else if ($result->newpageid == LL_NEXTPAGE) {\n $result->newpageid = $this->lesson->get_next_page($this->properties->nextpageid);\n }\n\n // Determine default feedback if necessary.\n if (empty($result->response)) {\n if (!$this->lesson->feedback && !$result->noanswer && !($this->lesson->review & !$result->correctanswer && !$result->isessayquestion)) {\n // These conditions have been met:\n // 1. The lesson manager has not supplied feedback to the student\n // 2. Not displaying default feedback\n // 3. The user did provide an answer\n // 4. We are not reviewing with an incorrect answer (and not reviewing an essay question).\n\n $result->nodefaultresponse = true; // This will cause a redirect below.\n } else if ($result->isessayquestion) {\n $result->response = get_string('defaultessayresponse', 'languagelesson');\n } else if ($result->correctanswer) {\n if ($this->lesson->defaultfeedback == true) {\n $result->response = $this->lesson->defaultcorrect;\n } else {\n $result->response = get_string('thatsthecorrectanswer', 'languagelesson');\n }\n } else {\n if ($this->lesson->defaultfeedback == true) {\n $result->response = $this->lesson->defaultwrong;\n } else {\n $result->response = get_string('thatsthewronganswer', 'languagelesson');\n }\n }\n }\n \n if ($result->typeid == LL_AUDIO) {\n if ($result->audiodata) {\n $uploadData = $result->audiodata;\n $mp3data = json_decode($uploadData, true, 5);\n $recordedattempt = $DB->get_record('languagelesson_attempts', array('id'=>$recordedattemptid));\n \n foreach ($mp3data['mp3Data'] as $newfilename => $newfilebits) {\n // Send the file to the pool and return the file id.\n $recordedattempt->fileid = upload_audio_file($USER->id, $cmid, $recordedattemptid, $newfilename, $newfilebits);\n $DB->update_record('languagelesson_attempts', $recordedattempt);\n }\n }\n } else if ($result->response) {\n if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) {\n $nretakes = $DB->count_records(\"languagelesson_grades\", array(\"lessonid\"=>$this->lesson->id, \"userid\"=>$USER->id));\n $qattempts = $DB->count_records(\"languagelesson_attempts\",\n array(\"userid\"=>$USER->id, \"retry\"=>$nretakes, \"pageid\"=>$this->properties->id));\n if ($qattempts == 1) {\n $result->feedback = $OUTPUT->box(get_string(\"firstwrong\", \"languagelesson\"), 'feedback');\n } else {\n $result->feedback = $OUTPUT->BOX(get_string(\"secondpluswrong\", \"languagelesson\"), 'feedback');\n }\n }\n else\n {\n \t$class = 'response';\n if ($result->correctanswer) {\n $class .= ' correct'; // CSS over-ride this if they exist (!important).\n } else if (!$result->isessayquestion) {\n $class .= ' incorrect'; // CSS over-ride this if they exist (!important).\n }\n $options = new stdClass;\n $options->noclean = true;\n $options->para = true;\n $options->overflowdiv = true;\n \n if ($result->typeid == LL_CLOZE)\n {\n \t// Lets do our own thing for CLOZE - get question_html.\n \t$my_page = $DB->get_record('languagelesson_pages', array('id'=>$attempt->pageid));\n \t$question_html = $my_page->contents;\n \t\n \t// Get user answers from the attempt.\n \t$attempt_answers = $DB->get_record('languagelesson_attempts', array('id'=>$recordedattemptid));\n \t$user_answers_str = $attempt_answers->useranswer;\n \t\t\n \t// Get the lesson page so we can use functions from cloze.php.\n \t$manager = languagelesson_page_type_manager::get($lesson);\n\t\t\t$page = $manager->load_page($attempt->pageid, $lesson);\n\t \t\t\t\t\n\t \t\t// Get our cloze_correct_incorrect_view html.\n\t \t\t$html = $page->get_cloze_correct_incorrect_view($user_answers_str, $question_html);\n\t \t\t$result->feedback = $html;\n }\n else\n {\n \t$result->feedback = $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), 'generalbox boxaligncenter');\n \t$result->feedback .= '<div class=\"correctanswer generalbox\"><em>'.get_string(\"youranswer\", \"languagelesson\").'</em> : '.$result->studentanswer; // Already in clean html\n \t$result->feedback .= $OUTPUT->box($result->response, $class); // Already conerted to HTML\n \t$result->feedback .= '</div>';\n }\n }\n }\n }\n \n // Update completion state\n $course = get_course($lesson->course);\n $cm = get_coursemodule_from_id('languagelesson', $cmid, 0, false, MUST_EXIST);\n $completion=new completion_info($course);\n if ($completion->is_enabled($cm) && $lesson->completionsubmit) {\n $completion->update_state($cm, COMPLETION_COMPLETE, $USER->id);\n }\n \n return $result;\n }",
"public function testQuarantineCount()\n {\n\n }",
"private function checkRating($page_id){\n $keyword=$this->queryKeywordsByPageId($page_id);\n $keyword=$keyword[0][1];\n $result=$this->query(\"SELECT user FROM Pages WHERE id='$page_id'\");\n $author=$result->fetch_row();\n $author=$author[0];\n\n if($this->queryExpertsByKeyword($keyword)==null){\n $this->insertExpert($author, $keyword);\n }\n else{\n $result=$this->query(\"SELECT user FROM Expert WHERE word='$keyword'\");\n $currExpert=$result->fetch_row();\n $currExpert=$currExpert[0];\n \n if ($author!=$currExpert){\n $expertRating=$this->query(\"SELECT AVG(rating) \" \n . \"FROM Pages P, Keywords K, Views V \"\n . \"WHERE P.user='$currExpert' AND P.id=K.page_id AND K.word='$keyword' AND P.id=V.page_id\");\n $expertRating=$expertRating->fetch_row();\n \n $newRating=$this->query(\"SELECT AVG(rating) \" \n . \"FROM Views V, Pages P, Keywords K \"\n . \"WHERE P.user='$author' AND P.id=K.page_id AND K.word='$keyword' AND P.id=V.page_id\");\n $newRating=$newRating->fetch_row();\n \n\n if($newRating[0]>$expertRating[0]){\n $this->deleteExpert($currExpert, $keyword);\n $this->insertExpert($author,$keyword);\n }\n }\n }\n\n }",
"public function isIncludeZeroImpressions()\n {\n return $this->isIncludeZeroImpressions;\n }",
"function itg_loyalty_reward_visit_content_condition($node, $user) { \n $itg_result = 0;\n $pointer_key = itg_loyalty_reward_unique_expiration($user->uid); \n $itg_query = db_select('itg_lrp_loyalty_points', 'p')\n ->fields('p', array('id'))\n ->condition('pointer_key', $pointer_key)\n ->condition('uid', $user->uid)\n ->condition('node_id', $node->nid);\n $itg_result = $itg_query->execute()->fetchField();\n // If visit is first time then earn point else not.\n if ($itg_result == 0) {\n return TRUE;\n }\n else {\n return FALSE;\n } \n}",
"public function test_getDuplicateCartonActivityById() {\n\n }",
"public function testShowAnonymus()\n {\n \t$response = $this->get('/memes');\n \t$response->assertStatus(302)\n $this->assertTrue(true);\n }",
"public function accept_button_is_hidden_when_post_is_already_answered()\n {\n $comment = factory(\\App\\Comment::class)->create();\n $comment->markAsAnswer();\n\n $this->actingAs($comment->post->user);\n\n $this->visit($comment->post->url);\n\n $this->dontSee('Aceptar respuesta');\n\n\n\n }",
"function allow_view_results() {\n\t\treturn $this->attribute_bool('allow view results');\n\t}",
"public function isExistingReview(): bool\n {\n $review = ShopFeedbackEntity::findOne([\n 'created_by' => (!isset(Yii::$app->request->post()['created_by']))\n ? Yii::$app->user->identity->getId() : Yii::$app->request->post()['created_by'],\n 'shop_id' => Yii::$app->request->post()['shop_id']]);\n if (!$review) {\n $this->addError('created_by',\n Yii::t('app', 'Отзыв не найден'));\n return false;\n } else {\n return true;\n }\n }",
"public function setSocialImpression($value)\n\t{\n\t\t$this->socialImpression = $value;\n\t}",
"public function testExpertAccess()\n {\n $this->withSession(['expert' => ['id' => 99, 'type' => 'expert']])\n ->get(route('account.create'))\n ->assertForbidden();\n }",
"public function testDoesUserMeetAudienceConditionsSomeAudienceUsedInExperiment()\n {\n $config = new DatafileProjectConfig(DATAFILE, null, null);\n $experiment = $config->getExperimentFromKey('test_experiment');\n\n // Both audience Ids and audience conditions exist. Audience Ids is ignored.\n $experiment->setAudienceIds(['7718080042']);\n $experiment->setAudienceConditions(['11155']);\n\n $this->assertFalse(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n ['device_type' => 'Android', 'location' => 'San Francisco'],\n $this->loggerMock\n )[0]\n );\n\n // Audience Ids exist and audience conditions is null.\n $experiment = $config->getExperimentFromKey('test_experiment');\n $experiment->setAudienceIds(['11155']);\n $experiment->setAudienceConditions(null);\n\n $this->assertFalse(\n Validator::doesUserMeetAudienceConditions(\n $config,\n $experiment,\n ['device_type' => 'iPhone', 'location' => 'San Francisco'],\n $this->loggerMock\n )[0]\n );\n }",
"function video_preferito()\n {\n if (isset($_POST['preferito'])) {\n global $connection;\n $user_id = $_SESSION['users_id'];\n $preferito = $_POST['preferito'];\n\n if ($preferito !=\"\" && $preferito != null) {\n $query=\"SELECT COUNT(*) AS totalcount FROM prefiriti WHERE preferiti_video='$user_id'\";\n \n $result= mysqli_query($connection, $query);\n \n $rowcount=mysqli_fetch_assoc($result);\n \n if ($rowcount['totalcount'] == 0) {\n $query_insert = \"INSERT INTO prefiriti(preferiti_video,preferiti_userid) VALUES ('$preferito','$user_id')\";\n \n \n $result_insert = mysqli_query($connection, $query_insert);\n }\n }\n return header('Location: video_details.php?id='.$preferito);\n }\n }",
"public function _testMultipleInventories()\n {\n\n }",
"public function print_impressions_js( $options ) {\n\t\tif ( ! monsterinsights_track_user() ) {\n\t\t\treturn $options;\n\t\t}\n\n\t\tif ( empty( $this->queued_js[ 'impression' ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tob_start(); ?>\n<!-- MonsterInsights Enhanced eCommerce Impression JS -->\n<script type=\"text/javascript\">\n<?php \nforeach ( $this->queued_js[ 'impression' ] as $code ) {\n\techo $code . \"\\n\";\n}\n?>\n__gaTracker('send', {\n\t'hitType' : 'event',\n\t'eventCategory' : 'Products',\n\t'eventAction' : 'Impression',\n\t'eventLabel': 'Impression',\n\t'nonInteraction' : true,\n} );\n</script>\n<!-- / MonsterInsights Enhanced eCommerce Impression JS -->\n<?php\n\t\techo ob_get_clean();\n\t}",
"public function testProfilePrototypeUpdateByIdReviews()\n {\n\n }",
"public function saveUserImpressions($objects){\n try {\n foreach ($objects as $obj) {\n $obj = (object)$obj;\n $activityObj = new UserInteractionCollection();\n\n $activityObj->UserId = (int) $obj->UserId;\n\n $activityObj->userActivityIndex = CommonUtility::getUserActivityIndexByActionType($obj->ActionType);\n $activityObj->userActivityContext = CommonUtility::getUserActivityContextIndexByActionType($obj->RecentActivity);\n $activityObj->pageIndex = (int) 0;\n $activityObj->CreatedOn = new MongoDate(strtotime(date('Y-m-d H:i:s', time())));\n $activityObj->CreatedDate = date(\"Y-m-d\");\n $activityObj->ActionType = $obj->ActionType;\n $activityObj->RecentActivity = $obj->RecentActivity;\n\n $activityObj->NetworkId = (int)$obj->NetworkId;\n $activityObj->SegmentId = (int)$obj->SegmentId;\n $activityObj->Language = $obj->Language;\n \n $activityObj->CategoryType = (int)$obj->CategoryType;\n if(isset($obj->PostType)){\n $activityObj->PostId = new MongoId($obj->PostId);\n $activityObj->PostType = (int)$obj->PostType; \n }else if(isset($obj->WebLinkId)){\n $activityObj->WebLinkId = (int)$obj->WebLinkId;\n $activityObj->LinkGroupId = (int)$obj->LinkGroupId;\n $activityObj->WebUrl = $obj->WebUrl; \n }else if(isset($obj->JobId)){\n $activityObj->JobId = (int)$obj->JobId;\n }else if(isset($obj->AdId)){\n $activityObj->AdId = (int)$obj->AdId;\n $activityObj->Position = $obj->Position;\n $activityObj->Page = $obj->Page;\n }else if(isset($obj->GroupId)){\n $activityObj->GroupId = new MongoId($obj->GroupId);\n if(isset($obj->PostId))\n $activityObj->PostId = new MongoId($obj->PostId);\n if($obj->SubGroupId)\n $activityObj->SubGroupId = new MongoId($obj->SubGroupId);\n \n }\n \n $activityObj->save();\n $activityObj->NetworkId =(int) Yii::app()->params['NetWorkId'];\n $val = urlencode(CJSON::encode($activityObj));\n CommonUtility::executecurl(Yii::app()->params['ProphecyURL'], $val);\n }\n } catch (Exception $ex) {\n Yii::log(\"UserInteractionCollection:saveUserImpressions::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n return \"failure\";\n }\n }",
"private function assertPageNotReloaded(): void {\n $this->assertSession()->pageTextContains($this->pageReloadMarker);\n }",
"public function interests()\n {\n $this->markTestSkipped();\n $interests = [\"ac16479d5f\" => true, \"d9e354e0b4\" => true, \"6f029937b7\" => false ];\n $member = (new Member($this->email()))->interests($interests);\n $this->api->addUpdateMember($this->listId, $member);\n $data = $this->api->getMember($this->listId, $member->hash());\n $this->assertEquals(true, $data['interests']['ac16479d5f']);\n $this->assertEquals(true, $data['interests']['d9e354e0b4']);\n $this->assertEquals(false, $data['interests']['6f029937b7']);\n $this->unsub($member);\n }",
"public function testAccessToReadPageWithoutParticipate()\n {\n try {\n $expert = Expert::create([\n 'name_exp' => 'name',\n 'firstname_exp' => 'firstname',\n 'bd_date_exp' => '2000/01/01',\n 'sex_exp' => 'name',\n 'address_exp' => '9 rue de l\\'arc en ciel',\n 'pc_exp' => '74000',\n 'mail_exp' => '[email protected]',\n 'tel_exp' => '0601020304',\n 'city_exp' => 'Annecy',\n 'pwd_exp' => Hash::make('123'),\n 'type_exp' => 'expert',\n ]);\n \n $project = Project::create([\n 'name_prj' => 'phpunit',\n 'desc_prj' => null,\n 'id_mode' => 1,\n 'id_int' => 1,\n 'id_exp' => $expert->id_exp,\n 'limit_prj' => 1,\n 'waiting_time_prj' => 1,\n ]);\n \n $this->withSession(['expert' => ['id' => $expert->id_exp, 'type' => $expert->type_exp]])\n ->get(route('project.read', ['id' => $project->id_prj]))\n ->assertSessionHas('error')\n ->assertRedirect(route('project.list'));\n } catch(Exception $e) {\n echo $e->getMessage();\n } finally {\n $project->delete();\n $expert->delete();\n }\n }",
"public function test_without_permission_user_cannot_create_online_assessment()\n {\n $topic = ELearningTopic::factory()->create();\n $this->actingAs($this->user, 'api')\n ->postJson('api/e-learning/course-content/topics/' . $topic->id . '/online-assessments', [])\n ->assertStatus(403);\n }",
"public function testObjectResult()\n {\n $result = $this->searchResult->objectResult();\n\n $this->assertObjectHasAttribute('results', $result);\n $this->assertObjectHasAttribute('status', $result);\n }",
"public function actionIndex()\n {\n //check if there are expire leads . leads passed 10 minutes\n // count them all\n //\n }",
"function test_treatments_not_found_true()\n {\n $this->seed();\n \n $user = User::where('email', '=', '[email protected]')->first();\n \n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET', '/api/treatments/'.rand(11,50).'?token='.$token);\n $response->assertNotFound();\n }",
"public function testProfilePrototypeGetReviews()\n {\n\n }",
"public function imodAction ()\r\n {\r\n $request = $this->getRequest();\r\n $params = array_diff($request->getParams(), $request->getUserParams());\r\n \r\n $sessional = new Acad_Model_Test_Sessional($params);\r\n $sessional->setTest_info_id($params['id']);\r\n $result = $sessional->save();\r\n if ($result) {\r\n echo 'Successfully saved!! Test Id :'.var_export($result, true);\r\n }\r\n }"
] | [
"0.6249699",
"0.6068109",
"0.60492015",
"0.5945385",
"0.56744397",
"0.56206983",
"0.52456534",
"0.52308804",
"0.51702756",
"0.5156005",
"0.502122",
"0.49999642",
"0.4976467",
"0.497505",
"0.49684155",
"0.496407",
"0.49478167",
"0.49362057",
"0.4935828",
"0.49255764",
"0.49190938",
"0.48856357",
"0.4885617",
"0.4871198",
"0.48535925",
"0.4847144",
"0.4838113",
"0.4826293",
"0.48240122",
"0.48207742",
"0.48134562",
"0.48040184",
"0.47906834",
"0.47793293",
"0.47755954",
"0.47689682",
"0.47630385",
"0.47595835",
"0.47482112",
"0.47477356",
"0.47382066",
"0.47361216",
"0.4735665",
"0.47305933",
"0.47243902",
"0.47175008",
"0.4716993",
"0.47158167",
"0.47153237",
"0.47132564",
"0.47082606",
"0.4707218",
"0.47009397",
"0.46916363",
"0.46868446",
"0.46836928",
"0.4669413",
"0.4664035",
"0.46634567",
"0.4660547",
"0.46527737",
"0.46460116",
"0.46456063",
"0.46308506",
"0.46303236",
"0.46303093",
"0.4625394",
"0.4624248",
"0.46203732",
"0.46162084",
"0.46089423",
"0.46085554",
"0.4607909",
"0.4600313",
"0.4600079",
"0.459461",
"0.4591092",
"0.4589546",
"0.45858118",
"0.45840865",
"0.4583241",
"0.45802218",
"0.45772147",
"0.4573754",
"0.4571056",
"0.4570191",
"0.4569088",
"0.45674598",
"0.45664546",
"0.45612907",
"0.45577192",
"0.4549007",
"0.45484772",
"0.45454976",
"0.45428607",
"0.45330086",
"0.45308384",
"0.4524911",
"0.45212677"
] | 0.70249856 | 1 |
verify that decision listener contains correct information | public function verifyDecisionListenerWasCalled(): void
{
// Check that this was called during the...
$onDecision = function ($type, $userId, $attributes, $decisionInfo) {
print ">>> [$this->outputTag] OnDecision:
type: $type,
userId: $userId,
attributes: " . print_r($attributes, true) . "
decisionInfo: " . print_r($decisionInfo, true) . "\r\n";
};
$this->optimizelyClient->notificationCenter->addNotificationListener(
NotificationType::DECISION,
$onDecision
);
// ...decide.
$this->userContext->decide(FLAG_KEY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decide(FLAG_KEY);\n\n $this->printDecision($decision, \"Check that the following decision properties are expected for user $this->userId\");\n }",
"public function verifyDecisionProperties(): void\n {\n $decision = $this->userContext->decideForKeys(FLAG_KEYS);\n\n $this->printDecisions($decision, \"Check that the following decisions' properties are expected\");\n }",
"public function performChecks(){\n\t\t\n\t}",
"abstract public function check();",
"public function verify()\n {\n $this->setVerifiedFlag()->save();\n\n // :TODO: Fire an event here\n }",
"public function testCheckReturnsTrueIfOneEmployerIsAllowed()\n {\n $target = new CheckJobCreatePermissionListener();\n $e = $this->getTestEvent();\n\n $this->assertTrue($target->checkCreatePermission($e));\n }",
"public function testCheckReturnsFalseIfNoEmployerIsAllowed()\n {\n $target = new CheckJobCreatePermissionListener();\n $e = $this->getTestEvent(false);\n\n $this->assertFalse($target->checkCreatePermission($e));\n }",
"public function testHasConstraintInfo()\n {\n // false\n $this->fixture = new ValidationReport(\n array( // results\n new ValidationResult(\n $this->nodeFactory->createNamedNode('http://focusNode/'),\n $this->nodeFactory->createNamedNode('http://resultPath/'),\n new Severity('sh:Info'),\n $this->nodeFactory->createNamedNode('sh:MinMaxCountConstraintComponent'),\n $this->nodeFactory->createNamedNode('http://value')\n )\n )\n );\n\n $this->assertTrue($this->fixture->hasConstraintInfo());\n }",
"public function _check()\n {\n }",
"public function check() {}",
"abstract function check();",
"protected function isTargetCorrect() {}",
"public function createApplicableChecker();",
"abstract protected function afterSuccessValidation();",
"abstract public function check_hint();",
"public function needsVerificationMessage ();",
"public function check();",
"public function check();",
"public function check();",
"public function check();",
"public function check();",
"function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST))\n\t\t{\n\t\t\t# Approve or reject a school\n\t\t\t$result = $this->_job->verify($_POST);\n\t\t\t\n\t\t\t$actionPart = current(explode(\"_\", $_POST['action']));\n\t\t\t$actions = array('save'=>'saved', 'archive'=>'archived');\n\t\t\t$actionWord = !empty($actions[$actionPart])? $actions[$actionPart]: 'made';\n\t\t\t$this->native_session->set('msg', ($result['boolean']? \"The job has been \".$actionWord: (!empty($result['msg'])? $result['msg']: \"ERROR: The job could not be \".$actionWord) ));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Get list type\n\t\t\t$data['list_type'] = current(explode(\"_\", $data['action']));\n\t\t\t$data['area'] = 'verify_job';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t}",
"public function testCheckReturnsTrueIfNoOrganizationOrOwner()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $org = $this->getMockBuilder('\\Organizations\\Entity\\OrganizationReference')\n ->disableOriginalConstructor()\n ->getMock();\n\n $org->expects($this->exactly(2))\n ->method('hasAssociation')\n ->will($this->onConsecutiveCalls(false, true));\n\n $org->expects($this->once())\n ->method('isOwner')\n ->willReturn(true);\n\n $role = new User();\n $role->setOrganization($org);\n\n $e = new AssertionEvent();\n $e->setRole($role);\n\n $this->assertTrue($target->checkCreatePermission($e));\n $this->assertTrue($target->checkCreatePermission($e));\n }",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function simulateEnabledMatchSpecificConditionsSucceeds() {}",
"public function testWinnerVerifiedStatus()\n\t{\n\t\t$data = new OLPBlackbox_Data();\n\t\t$data->phone_home = '123451234';\n\t\t$data->phone_work = '123451234';\n\t\t$data->paydates = array(time(), strtotime('+1 week'));\n\n\t\t$init = array('target_name' => 'ca', 'name' => 'ca');\n\t\t$state_data = new OLPBlackbox_TargetStateData($init);\n\n\t\t$rule = $this->getMock('OLPBlackbox_Enterprise_Impact_Rule_WinnerVerifiedStatus',\n\t\t\t\t\t\tarray('logEvent')\n\t\t);\n\t\t$rule->expects($this->at(0))\n\t\t\t->method('logEvent')\n\t\t\t->with($this->equalTo('VERIFY_SAME_WH'),\n\t\t\t\t\t$this->equalTo('VERIFY'),\n\t\t\t\t\t$this->equalTo($state_data->name));\n\n\t\t$rule->isValid($data, $state_data);\n\t}",
"protected function AssessLvlAnswers()\n {\n $lvlDecreased = $this->TryToDecreaseLevel();\n \n if ($lvlDecreased == FALSE)\n {\n $lvlIncreased = $this->TryToIncreaseLevel();\n \n if ($lvlIncreased == FALSE)\n {\n $isDone = $this->IsDone();\n \n if ($isDone == TRUE)\n {\n $this->RecordLvlQAs();\n }\n }\n }\n }",
"public function check()\n {\n }",
"public function check()\n {\n }",
"abstract function is_trial_utilized();",
"public static function getApplicableListener(): array;",
"public function isValidationPassed();",
"public function check(): void;",
"public function check(): void;",
"public function checkOperationality()\n {\n }",
"public function requestVerification()\n {\n Event::dispatch(new VerificationRequest($this));\n }",
"public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }",
"public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }",
"public function decision() {\n Log::info($this->runId.': Decision Indicators '.json_encode($this->decisionIndicators));\n\n //if (!$this->fullPositionInfo['open']) {\n Log::info($this->runId.': Decision Completely Open.');\n\n if ($this->decisionIndicators['hma'] == 'long' && $this->decisionIndicators['stochOverboughtCheck'] != 'overBoughtLong') {\n Log::warning($this->runId.': NEW LONG POSITION');\n return 'long';\n }\n elseif ($this->decisionIndicators['hma'] == 'short' && $this->decisionIndicators['stochOverboughtCheck'] != 'overBoughtShort') {\n Log::warning($this->runId.': NEW SHORT POSITION');\n return 'short';\n }\n// }\n }",
"public function testOneDisagreedNoCancelledIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}",
"public function getDataAvisDecision()\n\t{\n\t\treturn $this->_avis_decision;\n\t}",
"public function verify();",
"public function passes();",
"public function verifyRequest()\n {\n }",
"public function testOneDisagreedNoCancelIsNew()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_NEW,\n\t\t\t$result\n\t\t);\n\t}",
"public function decision() {\n Log::info($this->runId.': New Position Decision Indicators: '.PHP_EOL.' '.$this->logIndicators());\n\n\n if ($this->decisionIndicators['slowHmaSlopePass'] == \"long\" && $this->decisionIndicators['slowStochOverboughtCheck'] == 'overBoughtShort' && $this->decisionIndicators['fastHmaCrossover'] == 'crossedAbove') {\n Log::warning($this->runId.': NEW LONG POSITION');\n return \"long\";\n }\n elseif ($this->decisionIndicators['slowHmaSlopePass'] == \"short\" && $this->decisionIndicators['slowStochOverboughtCheck'] == 'overBoughtLong' && $this->decisionIndicators['fastHmaCrossover'] == 'crossedBelow') {\n Log::warning($this->runId.': NEW SHORT POSITION');\n return \"short\";\n }\n else {\n Log::info($this->runId.': Failed Ema Breakthrough');\n return \"none\";\n }\n }",
"protected function check_something() {\n\t\t$this->something_happen = true;\n\t}",
"abstract function is_trial();",
"public function isValidComparisonExpectations() {}",
"private function onAnswer()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $checkAnswer = $this->getService('quest.quest_manager')->checkAnswer(\n $this->getUserId(),\n $payload['chapterId'] ?? null,\n $payload['answer'] ?? null\n );\n\n $this->send(new AnswerEvent($this->clientEvent, $checkAnswer));\n\n if ($checkAnswer) {\n $newData = $this\n ->getService('quest.quest_manager')\n ->getNewData($payload['chapterId'], $this->getUserId(), true);\n\n if ($newData) {\n $this->send(\n new NewContentEvent($newData)\n );\n }\n\n }\n }",
"function verify()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($_POST))\n\t\t{\n\t\t\t# Approve or reject a confirmation\n\t\t\t$result = $this->_confirmation->verify($_POST);\n\t\t\t\n\t\t\t$actionPart = current(explode(\"_\", $_POST['action']));\n\t\t\t$actions = array('reject'=>'rejected', 'post'=>'posted', 'approve'=>'approved', 'verify'=>'verified');\n\t\t\t$actionWord = !empty($actions[$actionPart])? $actions[$actionPart]: 'made';\n\t\t\t\n\t\t\t$item = in_array($_POST['action'], array('approve','reject'))? 'posting': 'confirmation';\n\t\t\t$this->native_session->set('msg', ($result['boolean']? \"The \".$item.\" has been \".$actionWord: (!empty($result['msg'])? $result['msg']: \"ERROR: The \".$item.\" could not be \".$actionWord) ));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Get list type\n\t\t\t$data['list_type'] = current(explode(\"_\", $data['action']));\n\t\t\t$data['area'] = 'verify_confirmation';\n\t\t\t$this->load->view('confirmation/addons', $data);\n\t\t}\n\t}",
"public function checkDataSubmission() {\n\t\t$this->main('', array());\n }",
"public function assertValid()\n {\n }",
"public function check()\n {\n foreach ($this->options as $id => $option) {\n $option->check();\n }\n }",
"abstract public function runValidation();",
"function testDeterminingChanges() {\n // Initial creation.\n $support_ticket = entity_create('support_ticket', array(\n 'uid' => $this->webUser->id(),\n 'support_ticket_type' => 'ticket',\n 'title' => 'test_changes',\n ));\n $support_ticket->save();\n\n // Update the support_ticket without applying changes.\n $support_ticket->save();\n $this->assertEqual($support_ticket->label(), 'test_changes', 'No changes have been determined.');\n\n // Apply changes.\n $support_ticket->title = 'updated';\n $support_ticket->save();\n\n // The hook implementations support_ticket_test_support_ticket_presave() and\n // support_ticket_test_support_ticket_update() determine changes and change the title.\n $this->assertEqual($support_ticket->label(), 'updated_presave_update', 'Changes have been determined.');\n\n // Test the static support_ticket load cache to be cleared.\n $support_ticket = SupportTicket::load($support_ticket->id());\n $this->assertEqual($support_ticket->label(), 'updated_presave', 'Static cache has been cleared.');\n }",
"public function check(StatefulInterface $subject);",
"function testShouldCheckIfListenersExist()\n {\n $this->assertFalse($this->emitter->hasListeners());\n $this->assertFalse($this->emitter->hasListeners('foo'));\n\n // check with \"foo\" listener\n $this->emitter->on('foo', $this->createTestCallback('foo'));\n\n $this->assertTrue($this->emitter->hasListeners());\n $this->assertTrue($this->emitter->hasListeners('foo'));\n\n // check event without any listeners\n $this->assertFalse($this->emitter->hasListeners('bar'));\n\n // check event with a global listener\n $this->emitter->on(EventEmitterInterface::ANY_EVENT, $this->createTestCallback('global'));\n\n $this->assertTrue($this->emitter->hasListeners('bar'));\n }",
"public function testBasicBehavior()\n {\n $validator = new Callback(function ($input) {\n return ($input == 1) ? true : false;\n });\n $this->assertTrue($validator->isValid(1));\n $this->assertFalse($validator->isValid(2));\n }",
"public function checkRequirements()\n {\n }",
"public function isVerified() {\n\t\treturn $this->oehhstat == 'V';\n\t}",
"public static function checkCvInfo(){\n\n }",
"public function checkIsVerified(Varien_Event_Observer $observer)\n {\n if (!Mage::getModel('postident/config')->isEnabled()) {\n return;\n }\n\n /* @var $controller Mage_Checkout_CartController */\n $controller = $observer->getControllerAction();\n if (($controller->getRequest()->getControllerName() == 'onepage' && $controller->getRequest()->getActionName() != 'success') && false === Mage::getModel('postident/verification')->userIsVerified()\n ) {\n //Set quote to hasErrors -> this causes a redirect to cart in all cases\n $controller->getOnepage()->getQuote()->setHasError(true);\n\n //Add notice message, that the user has to be verified before he is allowed to enter the checkout\n Mage::getSingleton(\"core/session\")->addNotice(\n Mage::helper(\"postident\")->__(\"An identification by E-POSTIDENT is necessary to enter the checkout.\")\n );\n }\n }",
"public function testCallbackIsSet(): void\n {\n $callback = static function (): void {\n };\n $assert = new CallbackAssertion($callback);\n $this->assertSame($callback, $assert->peakCallback());\n }",
"public function assertValid() : void\n {\n }",
"public function assertValid() : void\n {\n }",
"public function decision() {\n Log::info($this->runId.': New Position Decision Indicators: '.PHP_EOL.' '.$this->logIndicators());\n\n //Simple MACD Crossover\n if ($this->decisionIndicators['emaCrossover'] == \"crossedAbove\" && $this->decisionIndicators['hmaSlowLinReg']['m'] >= $this->hmaSlopeMin) {\n Log::warning($this->runId.': NEW LONG POSITION');\n return \"long\";\n }\n elseif ($this->decisionIndicators['emaCrossover'] == \"crossedBelow\" && $this->decisionIndicators['hmaSlowLinReg']['m'] <= $this->hmaSlopeMin*-1) {\n Log::warning($this->runId.': NEW SHORT POSITION');\n return \"short\";\n }\n else {\n Log::info($this->runId.': Failed Ema Breakthrough');\n return \"none\";\n }\n }",
"private function verifyControlRule() {\r\n $query = $this->db->select('lp.rule_id')\r\n ->from('landing_page lp')\r\n ->join('landingpage_collection lpc', 'lpc.landingpage_collectionid = lp.landingpage_collectionid', 'INNER')\r\n ->where('lp.landingpage_collectionid', $this->project)\r\n ->where('lp.pagetype', OPT_PAGETYPE_CTRL)\r\n ->get();\r\n\r\n $ruleid = $query->row()->rule_id;\r\n if (!is_numeric($ruleid) || $ruleid <= 0) {\r\n throw new Exception('When personalizationmode is set to COMPLETE, a valid ruleid is mandatory', 400200);\r\n }\r\n }",
"public function initCheckInformations()\n\t{\n\t\t$this->collCheckInformations = array();\n\t}",
"public function check($requestor, Model $model, $object, $action) {\n\t\tif (!$this->Acl->adapter() instanceof VisualisationDbAcl) {\n\t\t\t$this->_setAclAdapter();\n\t\t}\n\n\t\t$event = new CakeEvent('Visualisation.onCheck', $this, array($requestor, $model, $object, $action));\n\t\tlist($event->break, $event->breakOn) = array(true, true);\n\t\t$this->_eventManager->dispatch($event);\n\t\tif ($event->result === true) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"abstract protected function checkInitialization();",
"public function testOneCancelledOneDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountDisagreed' => 1,\n\t\t\t'getCountConfirmedDisagreed' => 1,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}",
"protected function performValidation()\n {\n // no required arguments\n }",
"public function _on_validate()\n {\n return true;\n }",
"public function check_capabilities()\n {\n }",
"public function isApplicable();",
"abstract public function verifyRequest(): void;",
"abstract public function verifyRequest(): void;",
"protected function collectInformation() {}",
"private function onHint()\n {\n if (!$this->checkAuth()) {\n return;\n }\n\n $payload = $this->clientEvent->getPayload();\n\n $hint = $this->getService('quest.quest_manager')->getHint(\n $this->getUserId(),\n $payload['chapterId'] ?? null\n );\n\n if ($hint) {\n $this->send(new HintEvent($this->clientEvent, $hint));\n }\n }",
"function passes() {\n return $this->startValidation();\n }",
"public function testGetListeners0()\n{\n\n $actual = $this->firewallContext->getListeners();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function isVerified();",
"protected function handleDecision(GmthApiDecision $apiDecision, GmthApiDemande $apiDemande)\n\t{\n\t\tif(empty($apiDecision->getId()))\n\t\t\treturn false;\n// \t\t\tthrow new GmthApiException('Empty id for api decision.');\n\t\tif(isset($this->_decisions[$apiDecision->getId()]))\n\t\t\t$decision = $this->_decisions[$apiDecision->getId()];\n\t\telse\n\t\t{\n\t\t\t$decision = new GmthDataDecision();\n\t\t\t$this->_decisions[$apiDecision->getId()] = $decision;\n\t\t}\n\t\t$decision->id = $apiDecision->getId();\n\t\t$decision->demande_id = $apiDemande->getId();\n\t\tif($apiDecision->getAvisDecision() !== null)\n\t\t{\n\t\t\t$this->handleAvisDecision($apiDecision->getAvisDecision());\n\t\t\tif(!empty($apiDecision->getAvisDecision()->getId()))\n\t\t\t\t$decision->avis_decision_id = $apiDecision->getAvisDecision()->getId();\n\t\t}\n\t\tif($apiDecision->getTypeDecision() !== null)\n\t\t{\n\t\t\t$this->handleTypeDecision($apiDecision->getTypeDecision());\n\t\t\tif(!empty($apiDecision->getTypeDecision()->getId()))\n\t\t\t\t$decision->type_decision_id = $apiDecision->getTypeDecision()->getId();\n\t\t}\n\t\tif(!empty($apiDecision->getDateCommission()))\n\t\t\t$decision->date_commission = $apiDecision->getDateCommission();\n\t\tif(!empty($apiDecision->getConfirmationDecisionInitiale()))\n\t\t\t$decision->confirmation = $apiDecision->getConfirmationDecisionInitiale();\n\t\tif(!empty($apiDecision->getMotivationNotification()))\n\t\t\t$decision->motif = $apiDecision->getMotivationNotification();\n\t\tif(!empty($apiDecision->getDateNotification()))\n\t\t\t$decision->date_notification = $apiDecision->getDateNotification();\n\t\tif(!empty($apiDecision->getMotifRefus()))\n\t\t\t$decision->motif_refus = $apiDecision->getMotifRefus();\n\t\t\n\t\t// those are booleans\n\t\t$decision->auditif_obtenu = $apiDecision->getAuditifObtenu();\n\t\t$decision->mental_obtenu = $apiDecision->getMentalObtenu();\n\t\t$decision->moteur_obtenu = $apiDecision->getMoteurObtenu();\n\t\t$decision->visuel_obtenu = $apiDecision->getVisuelObtenu();\n\t\t\n\t\treturn true;\n\t}",
"public function testIsApplicable(): void\n {\n $this->assertTrue($this->provider->isApplicable());\n }",
"public static function isValidDataProvider()\n\t{\n\t\treturn array(\n\t\t\tarray(TRUE, OLPBlackbox_Config::EVENT_RESULT_PASS, TRUE), // matches the list, pass the rule\n\t\t\tarray(FALSE, OLPBlackbox_Config::EVENT_RESULT_FAIL, FALSE) // doesn't match the list, fail the rule\n\t\t);\n\t}",
"function update_decision_status() {\n\t\tif ( check_ajax_referer( 'ht-dms', 'nonce' ) ) {\n\t\t\t$dID = pods_v_sanitized( 'dID', $_REQUEST );\n\t\t\tif ( $dID ) {\n\t\t\t\twp_die( ucwords( ht_dms_decision_class()->status( $dID ) ) );\n\n\t\t\t}\n\n\t\t}\n\t}",
"public function check_response() {\n\n\t\t// To test in live mode ($_post)\n\t\t$post = ( file_get_contents( 'php://input' ) );\n\n\t\tif ( ! empty( $post ) ) {\n\t\t\tdo_action( 'valid-oyst-one-click-request', $post );\n\t\t\texit;\n\t\t}\n\t\tWC_Oyst_One_Click::log( 'Retour One Click vide', 'error' );\n\t\twp_die( 'Erreur de requête One Click', '1-Click', array( 'response' => 500 ) );\n\n\t}",
"function checkCheckbox($attempted, $answer, $activity_id, $activity, $selected, $maxScore){\n\n /**\n *\n * A correct x 50 1\n * B correct 50 0\n * C incorrect x 50 0\n * D incorrect x 50 0\n * E incorrect 50 1\n * F incorrect 50 1\n * F incorrect 50 1\n\n * 300\n *\n */\n\n $pointsForEachSelected = $activity[\"points\"];\n $correct = array();\n $incorrect = array();\n $score = 0;\n $options = $activity[\"content\"][\"options\"];\n $optionsLen = count($options);\n\n\n $points = $optionsLen*$pointsForEachSelected;\n\n foreach ($answer as $ind => $ans) {\n if(in_array($ans, $selected)){\n array_push($correct, $ans);\n }else{\n $points -= $pointsForEachSelected;\n }\n }\n\n foreach ($selected as $ind => $sel) {\n if(!in_array($sel, $answer)){\n array_push($incorrect, $sel);\n $points -=$pointsForEachSelected;\n }\n }\n\n\n $totalPoints = $optionsLen*$pointsForEachSelected;\n\n $score = ($points/($totalPoints))*$maxScore;\n\n\n return array(\"correct\"=>$correct, \"incorrect\"=>$incorrect, \"score\"=>$score, \"possible_score\"=>$maxScore, \"points\"=>$points, \"possible_points\"=>$totalPoints);\n\n }",
"public function testGetChallengeEvent()\n {\n }",
"public function isButtonValidValidSetupExpectTrue() {}",
"public function testListenerRegistered(): void\n {\n $this->assertEventHasListener(QueryExecuted::class, QueryExecutedEventsListener::class);\n }",
"function isVerified(){\n\n}",
"public function isValidThreshold(Result $result): void\n {\n }",
"function playerInfoChanged($playerinfo) {\n\n\t\t// on relay, check for player from master server\n\t\tif ($this->server->isrelay && floor($playerinfo['Flags'] / 10000) % 10 != 0)\n\t\t\treturn;\n\n\t\t// check for valid player\n\t\tif (!$player = $this->server->players->getPlayer($playerinfo['Login']))\n\t\t\treturn;\n\n\t\t// check ladder ranking\n\t\tif ($playerinfo['LadderRanking'] > 0) {\n\t\t\t$player->ladderrank = $playerinfo['LadderRanking'];\n\t\t\t$player->isofficial = true;\n\t\t} else {\n\t\t\t$player->isofficial = false;\n\t\t}\n\n\t\t// check spectator status (ignoring temporary changes)\n\t\t$player->prevstatus = $player->isspectator;\n\t\tif (($playerinfo['SpectatorStatus'] % 10) != 0)\n\t\t\t$player->isspectator = true;\n\t\telse\n\t\t\t$player->isspectator = false;\n\n\t\t$this->releaseEvent('onPlayerInfoChanged', $playerinfo);\n\t}",
"public function testAssertMethod(): void\n {\n $acl = new Acl\\Acl();\n $roleGuest = new Acl\\Role\\GenericRole('guest');\n $assertMock = static fn($value) => static fn($aclArg, $roleArg, $resourceArg, $privilegeArg) => $value;\n $acl->addRole($roleGuest);\n $acl->allow($roleGuest, null, 'somePrivilege', new CallbackAssertion($assertMock(true)));\n $this->assertTrue($acl->isAllowed($roleGuest, null, 'somePrivilege'));\n $acl->allow($roleGuest, null, 'somePrivilege', new CallbackAssertion($assertMock(false)));\n $this->assertFalse($acl->isAllowed($roleGuest, null, 'somePrivilege'));\n }",
"public function testTwoCancelledNoDisagreedIsDisagreed()\n\t{\n\t\t$history = $this->getMockHistory(array(\n\t\t\t'getCountConfirmedDisagreed' => 2,\n\t\t\t));\n\n\t\t$result = $this->decider->getDecision($history);\n\t\t$this->assertEquals(\n\t\t\tOLPBlackbox_Enterprise_Generic_Decider::CUSTOMER_DISAGREED,\n\t\t\t$result\n\t\t);\n\t}",
"public function testSuccess(): void\n {\n $this->assertNotEmpty([newMessage()]);\n\n // Check if the config File exists\n $this->assertFileExists('verification/config.php');\n\n // check if function is not empty\n $this->assertNotNull([regularOptions()]);\n }",
"public function check()\r\n\t{\r\n\t\treturn true;\r\n\t}"
] | [
"0.65480614",
"0.62806135",
"0.5491631",
"0.5322595",
"0.523217",
"0.5229661",
"0.52165985",
"0.51994663",
"0.5197485",
"0.51791364",
"0.51481986",
"0.51348776",
"0.5130494",
"0.51180595",
"0.5099238",
"0.50958705",
"0.50893104",
"0.50893104",
"0.50893104",
"0.50893104",
"0.50893104",
"0.5085035",
"0.5081939",
"0.5077097",
"0.50764585",
"0.50666285",
"0.50530505",
"0.5036405",
"0.5036405",
"0.50284857",
"0.5027633",
"0.502564",
"0.50252086",
"0.50252086",
"0.49941248",
"0.49605167",
"0.49575385",
"0.49575385",
"0.49556696",
"0.49466434",
"0.4937397",
"0.49312332",
"0.49311343",
"0.49241304",
"0.49003738",
"0.48896435",
"0.48895442",
"0.48725364",
"0.48644906",
"0.48343524",
"0.4828316",
"0.47991255",
"0.4763071",
"0.47503728",
"0.47468117",
"0.4742844",
"0.474054",
"0.47399133",
"0.47312084",
"0.47184044",
"0.47162092",
"0.47121975",
"0.47121716",
"0.47074738",
"0.47014502",
"0.47014502",
"0.46984023",
"0.4691719",
"0.46816793",
"0.46815813",
"0.46796802",
"0.46791986",
"0.4675701",
"0.4675324",
"0.46614242",
"0.46559736",
"0.46548957",
"0.46548957",
"0.46508282",
"0.4649747",
"0.46493083",
"0.46454582",
"0.46452847",
"0.4628722",
"0.46214285",
"0.46193138",
"0.46145064",
"0.4611901",
"0.46090445",
"0.46020788",
"0.4591759",
"0.45890105",
"0.45873958",
"0.45872706",
"0.45854336",
"0.4579604",
"0.45790637",
"0.45777112",
"0.4577068"
] | 0.7961968 | 1 |
verify that invalid flag key is handled correctly | public function verifyAnInvalidFlagKeyIsHandledCorrectly(): void
{
$logger = new DefaultLogger(Logger::ERROR);
$localOptimizelyClient = new Optimizely(datafile: null, logger: $logger, sdkKey: SDK_KEY);
$userId = 'user-' . mt_rand(10, 99);
$localUserContext = $localOptimizelyClient->createUserContext($userId);
// ensure you see an error -- Optimizely.ERROR: FeatureFlag Key "a_key_not_in_the_project" is not in datafile.
$localUserContext->decide("a_key_not_in_the_project");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testIsValidKeyWithInvalidKey() \n {\n $result = $this->fileCache->isValidKey('');\n $expected = FALSE;\n\n $this->assertEquals($expected, $result);\n }",
"function check_element_validity($key,$opt){\n\n if (preg_match(STARTCHARRGX, $key) === 1 ) { //check first character\n preg_match(STARTCHARRGX,$key,$matches);\n if ($matches[0] == \"_\") {\n return false;\n }\n return true;\n }\n if ( preg_match(INVALIDCHARSRGX, $key) === 1) { //check other chars validity\n return true;\n }\n return false;\n }",
"private static function setInvalidFlag($flag) {\n self::$_elements[self::$_inputElement]['inValid'] = $flag;\n }",
"private function validate( $flag )\n { \n return in_array( $flag, $this->valid_flags );\n }",
"protected function is_valid_key($key)\n {\n }",
"public function testCacheKeyInvalidTypeBoolean(): void\n {\n $value = '99 bottles of beer on the wall';\n $key = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set($key, $value);\n }",
"public function testIsValidKeyNotFound()\n {\n $this->assertFalse($this->helper->isValid('blabla', 12.93));\n }",
"public function testIsValidKeyWithValidKey() \n {\n $key = 'key1';\n $result = $this->fileCache->isValidKey($key);\n $expected = TRUE;\n\n $this->assertEquals($expected, $result);\n }",
"public function testInvalidConfig()\n {\n $config = array(\n 'invalidArg' => TRUE,\n );\n\n $result = self::processFilter($config, self::$request);\n }",
"function validate_key($key)\n{\n if ($key == 'PhEUT5R251')\n return true;\n else\n return false;\n}",
"public function setInvalid();",
"protected static function validKey($key) {\n return is_string($key) && !is_numeric($key) && strpos($key, ':') === FALSE;\n }",
"public function isValid(string $key) : bool;",
"public function hasError($key) : bool;",
"private function isValidKey($key) {\n\n\t\t// Check key length\n\t\t$len = strlen($key);\n\n\t\tif ($len < 1) {\n\t\t\tthrow new FlintstoneException('No key has been set');\n\t\t}\n\n\t\tif ($len > 50) {\n\t\t\tthrow new FlintstoneException('Maximum key length is 50 characters');\n\t\t}\n\n\t\t// Check valid characters in key\n\t\tif (!preg_match(\"/^[A-Za-z0-9_\\-]+$/\", $key)) {\n\t\t\tthrow new FlintstoneException('Invalid characters in key');\n\t\t}\n\n\t\treturn true;\n\t}",
"function is_valid_meta_key( $key ) {\n\t\t// skip attachment metadata since we'll regenerate it from scratch\n\t\t// skip _edit_lock as not relevant for import\n\t\tif ( in_array( $key, array( '_wp_attached_file', '_wp_attachment_metadata', '_edit_lock' ) ) )\n\t\t\treturn false;\n\t\treturn $key;\n\t}",
"function check($key) {\n\t\tswitch ($key) {\n\t\t\tcase 'name':\n\t\t\tcase 'email':\n\t\t\tcase 'type_demande':\n\t\t\t\t// field(s) is(are) compulsory\n\t\t\t\treturn $this->checkEmpty($key);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// any other field is fine as it is\n\t\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}",
"public function isInvalid(): bool;",
"public static function validatePasskey( $key ) {\n\t\t$pk = self::getPasskey( $key );\n\n\t\tif ( ( $pk == 'false' ) || ( $pk === false ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\tif ( empty( $pk->active ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( empty( $pk->type_def['valid'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $pk->trials <= 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}",
"public function valid() { return isset($this->keys[$this->pos]);\n }",
"public function isValidKey($key) {\n\t\treturn is_int($key);\n\t}",
"function replace_invalid_keys($key,$opt){\n\n if(is_string($key)){\n $key = preg_replace(INVALIDCHARSRGX, $opt->substitute_string, $key);\n $key = preg_replace(STARTCHARRGX, $opt->substitute_string, $key);\n }\n return $key;\n }",
"private function validateReviewerKey(){\n\t\treturn true;\n\t}",
"public function valid()\n {\n return $this->key === 0;\n }",
"protected function validateOrThrow() {}",
"public function testGetKeyUriWithLabelContainsInvalidCharatcer() {\n // throw the label contains invalid characters exception message\n GoogleAuthenticator::getKeyUri('hotp', 'illegal:char1:char2:char3:char4', 'secret');\n }",
"public function testTextInvalidKeySuccess() {\n $config = [\n 'success' => 'A',\n 'data' => 'example'\n ];\n $errors = $this->getValidator()->validate($config);\n\n $this->assertNotEmpty($errors);\n $this->assertCount(1, $errors);\n $this->assertEquals('VALIDATION.INVALID_SUCCESS_IDENTIFIER', $errors[0]['__CODE'] );\n }",
"public static function validate_key( $key ) {\n \treturn self::$instance->validate( $key );\n }",
"function invalid_form_element($key) {\n $errors = Session::getErrors();\n if ($errors != null) {\n if (array_key_exists($key, $errors)) {\n echo 'invalid';\n }\n }\n}",
"public function testInvalidArg ()\n {\n $this->tran->loadDictionary(1.23);\n $this->tran->loadDictionary(array('yo' => 'for sure'));\n $this->tran->loadDictionary(true);\n\n $this->tran->translate(34);\n $this->tran->translate(array('yo' => 'for sure'));\n }",
"public function valid()\n {\n return !is_null($this->key());\n }",
"public function testIsValidFailing()\n {\n $this->assertFalse($this->helper->isValid('s1', 15));\n $this->assertFalse($this->helper->isValid('s2', true));\n $this->assertFalse($this->helper->isValid('i1', 12.1));\n $this->assertFalse($this->helper->isValid('i2', 'eleven'));\n $this->assertFalse($this->helper->isValid('i3', 12.6));\n $this->assertFalse($this->helper->isValid('i4', -2));\n $this->assertFalse($this->helper->isValid('i5', 83));\n $this->assertFalse($this->helper->isValid('i6', false));\n $this->assertFalse($this->helper->isValid('f1', 12));\n $this->assertFalse($this->helper->isValid('f2', [12.67]));\n $this->assertFalse($this->helper->isValid('f3', 13.0));\n $this->assertFalse($this->helper->isValid('b', [true]));\n $this->assertFalse($this->helper->isValid('b', 0));\n $this->assertFalse($this->helper->isValid('a', 'blue'));\n $this->assertFalse($this->helper->isValid('m', 'true'));\n $this->assertFalse($this->helper->isValid('m', false));\n $this->assertFalse($this->helper->isValid('r', 'memb3rType'));\n }",
"public function testInvalid(): void\n {\n $validator = new ControlValidator();\n\n $this->assertFalse($validator->validate('arf12')->isValid());\n }",
"abstract public function getIsValidKey($name);",
"private function validateBinaryValue($value, $key)\n {\n $errorMsg = '';\n if ($value !== '0' && $value !== '1') {\n $errorMsg = '<error>' . 'Command option \\'' . $key . '\\': Invalid value. Possible values (0|1).</error>';\n }\n return $errorMsg;\n }",
"function testFlag($flag)\n {\n return preg_match(\"/$flag/\", $this->flags);\n }",
"public function validateFlagsAreAllowed(array $flags, array $allowed_flags):void\n {\n // Throw exception if we have unknown flags passed\n if (!is_null($flags)) {\n $processed_flags = array_diff($flags, $allowed_flags);\n if (!empty($processed_flags)) {\n throw new Exception(\"Unknown flags passed to command {$this->command}: \" . implode(',', $processed_flags));\n }\n }\n }",
"public function testIsInvalid()\n {\n $this->todo('stub');\n }",
"public function validateKey($data = false)\n {\n $akCustomCountries = $data['akCustomCountries'] ?? [];\n $akHasCustomCountries = $data['akHasCustomCountries'] ?? false;\n if ($akHasCustomCountries != false) {\n $akHasCustomCountries = true;\n }\n\n $e = $this->app->make('error');\n\n if ($akHasCustomCountries && (count($akCustomCountries) == 0)) {\n $e->add(t('You must specify at least one country.'));\n } else {\n if (\n $akHasCustomCountries\n && $data['akDefaultCountry'] != ''\n && (!in_array($data['akDefaultCountry'], $akCustomCountries))\n ) {\n $e->add(t('The default country must be in the list of custom countries.'));\n }\n }\n\n return $e;\n }",
"public function OnInvalidKey()\n {\n $this->response(403, 'Access denied ' . $_SERVER['REMOTE_ADDR'], 'Unauthorized', null);\n }",
"public function tellInvalidPin()\n {\n }",
"public function testIsOperationInvalid()\n {\n $this->assertFalse($this->annotation->isValidOperation('INVALID'));\n }",
"public function MetaIsInvalid() {\n\t\t\treturn false;\n\t\t}",
"public function valid() {\n return ( ! is_null($this->key()));\n }",
"protected function checkOffset($key){\r\n if(isset($this->_registry[$key]))\r\n return true;\r\n\r\n return false;\r\n }",
"public function isButtonValidBrokenSetupInvalidButtonAsSecondParametersGivenExpectFalse() {}",
"function settingsIsValid($key)\n {\n return app('Padosoft\\Laravel\\Settings\\SettingsManager')->isValid($key);\n }",
"public function testSetKeyPairTtlInvalidTypeBoolean(): void\n {\n $ttl = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set('foo', 'bar', $ttl);\n }",
"public function cli_validateArgs() {}",
"public function testGetMultipleInvalidTypeBoolean(): void\n {\n $keyValuePairs = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }",
"public function valid(): bool\n {\n return $this->key() !== null && $this->key() !== false;\n }",
"public function testIsValidException()\n\t{\n\t\t$data = $this->getMock('Blackbox_Data', array());\n\t\t$data->expects($this->never())->method('__set');\n\t\t$data->expects($this->never())->method('__unset');\n\n\t\t$this->target->isValid($data, $this->state_data);\n\t}",
"public function valid()\n {\n echo __METHOD__,PHP_EOL;\n $key = key($this->a);\n return ($key !== NULL && $key !== FALSE);\n }",
"public function testValueMissingArrKeys() {\n $errors = $this->getValidator()->validate([]);\n\n $this->assertNotEmpty($errors);\n $this->assertCount(2, $errors);\n $this->assertEquals('VALIDATION.ARRAY_MISSING_KEY', $errors[0]['__CODE'] );\n $this->assertEquals('VALIDATION.ARRAY_MISSING_KEY', $errors[1]['__CODE'] );\n }",
"abstract public function valid();",
"function monsterinsights_get_license_key_errors() {\n\t$errors = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) && strlen( $license['type'] ) > 3 ) {\n\t\tif ( ( isset( $license['is_expired'] ) && $license['is_expired'] ) \n\t\t || ( isset( $license['is_disabled'] ) && $license['is_disabled'] )\n\t\t || ( isset( $license['is_invalid'] ) && $license['is_invalid'] ) ) {\n\t\t\t$errors = true;\n\t\t}\n\t}\n\treturn $errors;\n}",
"public function valid()\n {\n $key = $this->key();\n return ($key !== false && $key !== null);\n }",
"public function validateAuthKey($authKey){\n }",
"public function testValidationCaseForSettingWrongFormattedStringForPrivateKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $protocol->computeSharedSecret($exchangeInformation->public, 'яяяя');\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret($exchangeInformation->public, 'яяяя');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"public function testGetTagByInvalidTagId() {\n\t\t// Grab a tag by invalid key\n\t\t$tag = Tag::getTagByTagId($this->getPDO(), BrewCrewTest::INVALID_KEY);\n\t\t$this->assertNull($tag);\n\t}",
"public function testIfGettingNonexitingDictValueThrows() : void\n {\n\n $this->expectException(FieldDictValueDonoexException::class);\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setModel(( new Model() )->setName('test'));\n $field->setValues('one', 'two', 'three');\n $field->getDictValue('nonexistingKey', 'main');\n }",
"public function testSetKeyPairInvalidArgumentKeyContainsAtmark(): void\n {\n $key = 'key@key';\n $value = 'Test Value';\n $this->expectException(\\InvalidArgumentException::class);\n $this->testNotStrict->set($key, $value);\n }",
"private function validateKey($key): void\n {\n if (!is_array($key) && !is_string($key)) {\n throw new InvalidKeyException('The provided key was invalid');\n }\n }",
"private function check_key_valid() {\n $license = get_transient('wcis_license');\n\n // if key doesn't exist, abort\n if(!isset($license['key']) ) { return false; }\n\n // if valid, return success\n if(isset($license['valid']) && $license['valid'] === true) {\n $msg = __('API Connected!', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color: #4caf50;\">' . $msg . '</span>';\n }\n else {\n $msg = __('Invalid API Key. Is there empty space before / after it?', 'wcis');\n $this->form_fields['key']['description'] = '<span style=\"color:#f44336;\">' . $msg . '</span>';\n }\n\n return $license['valid'];\n }",
"protected function validateKey(string $key): void\n {\n $keyLength = \\mb_strlen($key);\n // String length must be at least 1 and less then 64\n if ($keyLength <= 0 || 64 < $keyLength) {\n throw new InvalidArgumentException(\"The key '$key' must be length from 1 up to 64 characters\");\n }\n\n // If string contains invalid character throws the exception\n if (!\\preg_match('#^[A-Za-z0-9._]+$#', $key)) {\n throw new InvalidArgumentException(\"The key '$key' contains invalid characters. Supported characters are A-Z a-z 0-9 _ and .\");\n }\n }",
"public function valid()\n\t{\n\t\treturn array_key_exists($this->_idx, $this->_keys);\n\t}",
"public function validateAuthKey($authKey): bool {\n }",
"public function testNonsuppliedBitflagsAreLeftAlone()\n {\n $bit = new Formulaic\\Bitflag('superhero', [\n 'spidey' => 'Spiderman',\n 'hulk' => 'The Hulk',\n 'daredevil' => 'Daredevil',\n ]);\n $bit->setDefaultValue(['superman']);\n $bit->setValue(['hulk']);\n yield assert($bit->getValue()->hulk);\n yield assert(!isset($bit->getValue()->superman));\n }",
"public function valid()\n {\n return $this->key() !== null;\n }",
"public function isButtonValidInvalidButtonGivenExpectFalse() {}",
"public function valid() {\n return isset($this->keys[$this->index]);\n }",
"public function testActivateFailWrongKey()\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/activate/' . $user->email . '/customkeywhosinvalid');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n\n $this->assertNotEmpty($_SESSION['Flash']['flash']['message']);\n $this->assertContains('error', $_SESSION['Flash']['flash']['element']);\n }",
"private function verifyKey(array $readSpreadSheet): void\n {\n $keys = [\n 'sheet_id',\n 'category_tag',\n 'read_type',\n 'use_blade',\n 'output_directory_path',\n 'definition_directory_path',\n 'separation_key',\n 'attribute_group_column_name',\n ];\n\n foreach ($keys as $key) {\n if (! array_key_exists($key, $readSpreadSheet)) {\n throw new LogicException('There is no required setting value:'.$key);\n }\n }\n }",
"function bg_ValidateOptions($input) {\n global $bg_opts_apiKey;\n\t$newInput[$bg_opts_apiKey] = trim($input[$bg_opts_apiKey]);\n\tif(!preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/', $newInput[$bg_opts_apiKey])) {\n\t\t$newInput[$bg_opts_apiKey] = 'Invalid Api Key';\n\t}\n\treturn $newInput;\n}",
"function validateRequest(){\n // if ($_GET['key'] != getenv(\"LAB_NODE_KEY\")){\n // exit;\n // }\n if ($_GET['key'] != ''){\n exit;\n }\n }",
"public function validateAuthKey($authKey)\n {\n }",
"public function validateAuthKey($authKey)\n {\n }",
"public function validateAuthKey($authKey)\n {\n }",
"public function validateAuthKey($authKey)\n {\n }",
"public function validateAuthKey($authKey)\n {\n }",
"public function validateAuthKey($authKey)\n {\n }",
"public function validateAuthKey($authKey) {\n }",
"public function valid()\n\t{\n\t\t$key = key($this->var);\n\t\t$var = ($key !== NULL && $key !== FALSE);\n\t\techo \"valid: $var\\n\";\n\t\treturn $var;\t\n\t}",
"function eve_api_enter_api_form_validate($form, &$form_state) {\n $key_id = (int) $form_state['values']['keyID'];\n $v_code = (string) $form_state['values']['vCode'];\n\n if (empty($key_id) || empty($v_code) || preg_match('/[^a-z0-9]/i', $v_code) || preg_match('/[^0-9]/', $key_id) || strlen($key_id) > 15 || strlen($v_code) > 64 || strlen($v_code) < 20) {\n form_set_error('keyID', t('Invalid input, please try again.'));\n form_set_error('vCode');\n return;\n }\n\n $result = db_query('SELECT apiID FROM {eve_api_keys} WHERE keyID = :keyID AND vCode =:vCode', array(\n ':keyID' => $key_id,\n ':vCode' => $v_code,\n ));\n\n if ($result->rowCount()) {\n form_set_error('keyID', t('API Key already exists!'));\n form_set_error('vCode');\n return;\n }\n\n $query = array(\n 'keyID' => $key_id,\n 'vCode' => $v_code,\n );\n\n $characters = eve_api_get_api_key_info_api($query);\n\n if (isset($characters['error'])) {\n form_set_error('keyID', t('There was an error with the API.'));\n form_set_error('vCode');\n }\n else {\n $whitelist = array();\n\n if (!empty($characters)) {\n foreach ($characters['characters'] as $character) {\n $whitelist[] = (int) $character['characterID'];\n }\n }\n\n $result = db_query('SELECT characterID FROM {eve_api_whitelist} WHERE characterID IN (:characterIDs)', array(\n ':characterIDs' => $whitelist,\n ));\n\n $allow_expires = variable_get('eve_api_require_expires', FALSE) ? FALSE : !empty($characters['expires']);\n $allow_type = variable_get('eve_api_require_type', TRUE) ? $characters['type'] != 'Account' : FALSE;\n\n if ($result->rowCount()) {\n if ($allow_expires || ($characters['accessMask'] & 8388680) != 8388680) {\n form_set_error('keyID', t('Your account has been whitelisted, please ensure that the \"Type\" drop down box is set to \"Character\", and that the \"No Expiry\" checkbox is ticked. Only (Public Information -> (Characterinfo and FacWarStats), (Private Information) -> (CharacterSheet)) are required.'));\n form_set_error('vCode');\n }\n }\n else {\n if ($allow_expires || $allow_type || ($characters['accessMask'] & variable_get('eve_api_access_mask', 268435455)) != variable_get('eve_api_access_mask', 268435455)) {\n form_set_error('keyID', t('Please ensure that all boxes are highlighted and selected for the API, the \"Character\" drop down box is set to \"All\", the \"Type\" drop down box is set to \"Character\", and that the \"No Expiry\" checkbox is ticked.'));\n form_set_error('vCode');\n }\n }\n\n if (!eve_api_verify_blue($characters) && !variable_get('eve_api_require_blue', FALSE)) {\n form_set_error('keyID', t('No characters associated with your key are currently blue to this alliance.'));\n form_set_error('vCode');\n }\n\n if ($chars = eve_api_characters_exist($characters)) {\n form_set_error('keyID', t('Characters on this key have already been registered. Characters registered: @chars', array('@chars' => implode(\", \", $chars))));\n form_set_error('vCode');\n }\n }\n}",
"function flu_undefined_index_error($key)\n{\n if (is_bool($key)) {\n $key = (int)$key;\n }\n flu_error(\"Notice: Undefined offset: $key\", E_USER_NOTICE, 2);\n}",
"public function testNonExistingFieldFlag()\n {\n $configNonExistingFieldReturnFalse = json_decode(sprintf(\n $this->regexpConfigStub,\n '/Beer/',\n 'noHaveLaa',\n 'false'\n ), true);\n\n $configNonExistingFieldReturnTrue = json_decode(sprintf(\n $this->regexpConfigStub,\n '/Beer/',\n 'noHaveLaa',\n 'true'\n ), true);\n\n $nonExistingFieldReturnFalseFilter = new Regexp($configNonExistingFieldReturnFalse);\n $nonExistingFieldReturnTrueFilter = new Regexp($configNonExistingFieldReturnTrue);\n\n $this->assertFalse($nonExistingFieldReturnFalseFilter->accept($this->logEvent));\n $this->assertTrue($nonExistingFieldReturnTrueFilter->accept($this->logEvent));\n }",
"private function checkKeyName($key)\n\t{\n\t\tif (!is_string($key)) {\n\t\t\tthrow new InvalidArgumentException('Illegal key name: '.strval($key));\n\t\t}\n\t\t\n\t\tif ($key == '') {\n\t\t\tthrow new InvalidArgumentException('Illegal key name: '.strval($key));\n\t\t}\n\t\t\n\t\tif (preg_match('/[\\\\{\\\\}\\\\(\\\\)\\\\/\\\\\\\\@:]/', $key) !== 0) {\n\t\t\tthrow new InvalidArgumentException('Illegal key name: '.strval($key));\n\t\t}\n\t}",
"protected function checkKey($key) {\n\t\tif (!preg_match('#^[^{}()/\\\\@:]+$#', $key)) {\n\t\t\tthrow new BrokenKeyException('Invalid cache key given!');\n\t\t}\n\t}",
"static protected function validateKey($key)\r\n {\r\n /*\r\n The variable name must be a string and has to consist of one or more\r\n groups of lowercase alphanumeric characters, separated by a dot.\r\n */\r\n if(!is_string($key) || !preg_match(\"/^([a-z0-9_]+\\.)*[a-z0-9_]+$/\", $key))\r\n {\r\n throw new Exception(\"Invalid configuration key\");\r\n }\r\n }",
"public function getIsValidKey($name)\r\n {\r\n return is_int($name) && $name>=0;\r\n }",
"public function valid()\n {\n return isset($this->keys[$this->pointer]);\n }",
"public function valid()\n {\n return $this->key() < $this->filesize;\n }",
"function cp_do_input_validation($_adata) {\n\t# Initialize array\n\t\t$err_entry = array(\"flag\" => 0);\n\n\t# Check modes and data as required\n\t\tIF ($_adata['op'] == 'edit' || $_adata['op'] == 'add') {\n\t\t# Check required fields (err / action generated later in cade as required)\n\t\t//\tIF (!$_adata['s_id'])\t\t{$err_entry['flag'] = 1; $err_entry['s_id'] = 1;}\n\t\t//\tIF (!$_adata['s_status'])\t{$err_entry['flag'] = 1; $err_entry['s_status'] = 1;}\n\t\t\tIF (!$_adata['s_company'])\t{$err_entry['flag'] = 1; $err_entry['s_company'] = 1;}\n\t\t//\tIF (!$_adata['s_name_first'])\t{$err_entry['flag'] = 1; $err_entry['s_name_first'] = 1;}\n\t\t//\tIF (!$_adata['s_name_last'])\t{$err_entry['flag'] = 1; $err_entry['s_name_last'] = 1;}\n\t\t\tIF (!$_adata['s_addr_01'])\t{$err_entry['flag'] = 1; $err_entry['s_addr_01'] = 1;}\n\t\t//\tIF (!$_adata['s_addr_02'])\t{$err_entry['flag'] = 1; $err_entry['s_addr_02'] = 1;}\n\t\t\tIF (!$_adata['s_city'])\t\t{$err_entry['flag'] = 1; $err_entry['s_city'] = 1;}\n\t\t\tIF (!$_adata['s_state_prov'])\t{$err_entry['flag'] = 1; $err_entry['s_state_prov'] = 1;}\n\t\t\tIF (!$_adata['s_country'])\t{$err_entry['flag'] = 1; $err_entry['s_country'] = 1;}\n\t\t\tIF (!$_adata['s_zip_code'])\t{$err_entry['flag'] = 1; $err_entry['s_zip_code'] = 1;}\n\t\t//\tIF (!$_adata['s_phone'])\t\t{$err_entry['flag'] = 1; $err_entry['s_phone'] = 1;}\n\t\t//\tIF (!$_adata['s_fax'])\t\t{$err_entry['flag'] = 1; $err_entry['s_fax'] = 1;}\n\t\t//\tIF (!$_adata['s_tollfree'])\t{$err_entry['flag'] = 1; $err_entry['s_tollfree'] = 1;}\n\t\t//\tIF (!$_adata['s_email'])\t\t{$err_entry['flag'] = 1; $err_entry['s_email'] = 1;}\n\t\t//\tIF (!$_adata['s_taxid'])\t\t{$err_entry['flag'] = 1; $err_entry['s_taxid'] = 1;}\n\t\t//\tIF (!$_adata['s_account'])\t{$err_entry['flag'] = 1; $err_entry['s_account'] = 1;}\n\t\t\tIF (!$_adata['s_terms'])\t\t{$err_entry['flag'] = 1; $err_entry['s_terms'] = 1;}\n\t\t//\tIF (!$_adata['s_notes'])\t\t{$err_entry['flag'] = 1; $err_entry['s_notes'] = 1;}\n\n\t\t}\n\n\t# Validate some data (submitting data entered)\n\t# Email\n\t\tIF ($_adata['s_email'] && do_validate_email($_adata['s_email'], 0)) {\n\t\t\t$err_entry['flag'] = 1; $err_entry['err_email_invalid'] = 1;\n\t\t}\n\n\t# Email does not match existing email\n\t\t$_ce = array(0,1,1,1,1);\t// Element 0 = Nothing, 1 = clients, 2 = suppliers, 3 = admins, 4 = site addressses\n\t\tIF ($_adata['s_email'] && do_email_exist_check($_adata['s_email'], $_adata['s_id'], $_ce)) {\n\t\t\t$err_entry['flag'] = 1; $err_entry['err_email_matches_another'] = 1;\n\t\t}\n\n\t\treturn $err_entry;\n\n\t}",
"private function validate_input() {\n\t\t$fields = array_merge( array( $this->range_field ), $this->key_fields, $this->checksum_fields );\n\n\t\t$this->validate_fields( $fields );\n\t\t$this->validate_fields_against_table( $fields );\n\t}",
"private function _validate_key($endpoint,$key)\n\t{\n\t\tif($row = $this->db->where('key',strtoupper($key))->get('nct_api_keys')->row())\n\t\t{\n\t\t\tif($row->max_allowed > $row->tot_curr_requests)\n\t\t\t{\n\t\t\t\t$this->key_id = $row->id;\n\t\t\t\tif($row->enabled)\n\t\t\t\t{\n\t\t\t\t\treturn $row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function testGetKeyUriWithOptionHasInvalidDigits() {\n // the customized digits is invalid.\n GoogleAuthenticator::getKeyUri('hotp', '[email protected]', 'secret', 123, ['digits' => 100]);\n }",
"function wg_is_valid_key($key) {\n\tglobal $wgg;\n\n\t$key = escapeshellarg($key);\n\n\t$retval = mwexec(\"echo {$key} | {$wgg['wg']} pubkey\");\n\n\treturn ($retval <> 0 ? false : true);\n\n}",
"public function isValid($_throwExceptionOnInvalidData = false);"
] | [
"0.67659914",
"0.640581",
"0.6379434",
"0.63693994",
"0.6341779",
"0.6326382",
"0.6140762",
"0.6140514",
"0.6055783",
"0.59930325",
"0.5917794",
"0.59130347",
"0.5889435",
"0.5886992",
"0.5781108",
"0.57391214",
"0.5704403",
"0.5701161",
"0.5697768",
"0.5682411",
"0.56671363",
"0.5649084",
"0.56431437",
"0.56374943",
"0.5621247",
"0.5619933",
"0.55993617",
"0.55993307",
"0.55873287",
"0.5576087",
"0.55753744",
"0.5575026",
"0.5570934",
"0.5568636",
"0.5558888",
"0.55581236",
"0.55544955",
"0.5521065",
"0.55181813",
"0.5515858",
"0.5506282",
"0.54970795",
"0.5491381",
"0.54819465",
"0.545634",
"0.54382426",
"0.54315823",
"0.5429903",
"0.542552",
"0.542085",
"0.5415336",
"0.5411846",
"0.5409498",
"0.5405332",
"0.53934175",
"0.5380785",
"0.5377008",
"0.5369368",
"0.536639",
"0.5349031",
"0.5344706",
"0.5343891",
"0.5343439",
"0.5342039",
"0.53335136",
"0.5333092",
"0.5332545",
"0.53242767",
"0.53218675",
"0.5320637",
"0.5309781",
"0.5307467",
"0.53048086",
"0.53032285",
"0.52997386",
"0.52988094",
"0.5298101",
"0.5298101",
"0.5298101",
"0.5298101",
"0.5298101",
"0.5298101",
"0.52938026",
"0.5289641",
"0.5288261",
"0.52873087",
"0.52840924",
"0.5280122",
"0.52790684",
"0.52778417",
"0.52741426",
"0.52723664",
"0.52680904",
"0.5258954",
"0.5258215",
"0.5255458",
"0.5242982",
"0.5238958",
"0.52383804"
] | 0.7583321 | 1 |
Get all categories assigned to an entry | public function get_category_posts($entry_id = NULL, $status = NULL)
{
$where = array(
'entry_id' => ($entry_id ?: ee()->publisher_lib->entry_id),
'publisher_status' => ($status ?: ee()->publisher_lib->status),
'publisher_lang_id' => ee()->publisher_lib->lang_id
);
$qry = ee()->db->where($where)
->get('publisher_category_posts');
if (ee()->publisher_setting->show_fallback() && $qry->num_rows() == 0)
{
$where['publisher_lang_id'] = ee()->publisher_lib->default_lang_id;
$qry = ee()->db->where($where)
->get('publisher_category_posts');
if ($qry->num_rows() == 0)
{
$where['publisher_status'] = PUBLISHER_STATUS_OPEN;
$qry = ee()->db->where($where)
->get('publisher_category_posts');
}
}
if ($qry->num_rows() == 0)
{
return array();
}
else
{
$cat_ids = array();
foreach ($qry->result_array() as $row)
{
$cat_ids[] = $row['cat_id'];
}
return $cat_ids;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }",
"public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}",
"public function getCategories();",
"public function getCategories();",
"public function get_categories () {\n\t\treturn Category::all();\n\t}",
"public function allCategories()\n {\n return Category::all();\n }",
"public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }",
"private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }",
"public function getAllCategories();",
"public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}",
"public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }",
"public function categories() {\n\t\treturn $this->terms('category');\n\t}",
"public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}",
"public function getCategories()\n {\n return Category::all();\n }",
"public static function getAll() {\n self::checkConnection();\n $results = self::$connection->execute(\"SELECT * FROM category;\");\n $categories = array();\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\n }",
"public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}",
"public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }",
"public static function getAllCategories()\n\t{\n\t\t$categories= Category::all();\n\t\treturn $categories;\n\t}",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}",
"public function findAllCategories(): iterable;",
"public function get_categories() {\n\t\treturn $this->terms('category');\n\t}",
"public function getCategories(){\n return Category::get();\n }",
"function faq_build_get_categories() { //retrieve all categories\n\tglobal $wpdb;\n\t$res = $wpdb->get_results(\"SELECT * FROM \".FAQBUILDDBCATEGORY.\" ORDER BY name ASC;\",ARRAY_A);\n\t$categories = array();\n\tif(is_array($res)) {\n\t\tforeach($res as $row) {\n\t\t\t$c = new FAQ_Build_Category();\n\t\t\tif($c->fromArray($row))\n\t\t\t\t$categories[] = $c;\n\t\t\telse\n\t\t\t\tunset($c);\n\t\t}\n\t}\n\treturn $categories;\n}",
"public static function getCategories(){\n $categories = Category::all()->toArray();\n\n return $categories;\n }",
"public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }",
"public function categories()\n {\n return $this->morphedByMany(\n Category::class,\n 'metable'\n );\n }",
"public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}",
"public function getCategories() {\n $sql = sprintf(\"SELECT * FROM category c WHERE EXISTS (SELECT * FROM project_category pc WHERE pc.project_id = %d AND pc.category_id = c.id)\", $this->id);\n $categories = array();\n $results = self::$connection->execute($sql);\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\n }",
"private function fetchAllCategories()\n {\n $sql = '\n SELECT * FROM Rm_Category;\n ';\n\n $res = $this->db->executeSelectQueryAndFetchAll($sql);\n\n $categoriesArray = array();\n foreach ($res as $key => $row) {\n $name = $row->name;\n $categoriesArray[] = $name;\n }\n\n return $categoriesArray;\n }",
"function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}",
"public function get_categories() {\n global $DB;\n $categories = array();\n $results = $DB->get_records('course_categories', array('parent' => '0', 'visible' => '1', 'depth' => '1'));\n if (!empty($results)) {\n foreach ($results as $value) {\n $categories[$value->id] = $value->name;\n }\n }\n return $categories;\n }",
"function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }",
"public static function getCategories()\n {\n $app = App::getInstance();\n\n $manager = BaseManager::build('FelixOnline\\Core\\Category', 'category');\n\n try {\n $values = $manager->filter('hidden = 0')\n ->filter('deleted = 0')\n ->filter('id > 0')\n ->order('order', 'ASC')\n ->values();\n\n return $values;\n } catch (\\Exception $e) {\n return array();\n }\n }",
"function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }",
"public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }",
"public function getCategories() {\n\t\t$db = $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtsms_categories', 'a'));\n\n\t\t$query->where($db->quoteName('a.published').' = 1');\n\n\t\t$query->group($db->quoteName('a.id'));\n\t\t$query->order($db->quoteName('a.name'));\n\n\t\t$db->setQuery($query);\n\n\t\t\n\t\t$categories = array();\n\t\t$categories[0]\t= JText::_('COM_GTSMS_UNCATEGORIZED');\n\n\t\tforeach ($db->loadObjectList('id') as $k => $item) {\n\t\t\t$categories[$k] = $item->name;\n\t\t}\n\n\t\treturn $categories;\n\t}",
"public static function getAllCategories()\n {\n $return = (array) FrontendModel::get('database')->getRecords(\n 'SELECT c.id, c.title AS label, COUNT(c.id) AS total\n FROM menu_categories AS c\n INNER JOIN menu_alacarte AS i ON c.id = i.category_id AND c.language = i.language\n GROUP BY c.id\n ORDER BY c.sequence ASC',\n array(), 'id'\n );\n\n // loop items and unserialize\n foreach ($return as &$row) {\n if (isset($row['meta_data'])) {\n $row['meta_data'] = @unserialize($row['meta_data']);\n }\n }\n\n return $return;\n }",
"public function getAll(): Collection\n {\n return $this->categoryRepository->getAll();\n }",
"function get_all_category_ids()\n {\n }",
"public function getCategories(): array{\r\n $category = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM categories')as $key){ $category[$key['idcategories']] = $key['category_name']; }\r\n return $category;\r\n $this->con->closeConnection();\r\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories(){\n\t\n\t\tglobal $wpdb;\n\t\t\n\t\t$allcategories = array();\n\t\t \n\t\t// geta all categories\t\t\n\t\t$categories = $wpdb->get_results('SELECT * FROM '.$this->categories_table.'');\n\t\t\n\t foreach($categories as $cat)\n\t\t{ \n\t\t $allcategories[$cat->term_id][] = $cat->name;\n\t\t\t$allcategories[$cat->term_id][] = $cat->name_de;\n\t\t\t$allcategories[$cat->term_id][] = $cat->name_it;\t\n\t\t}\n\t\t\n\t\treturn $allcategories;\n\t\t\t\n\t}",
"function getCategories() {\n\t\t$answers = $this->getAnswers();\n\t\t$categories = array();\n\t\t\n\t\tforeach((array) $answers as $answer) {\n\t\t\t$question = $answer->getQuestion();\n\t\t\t$category = $question->getCategory();\n\t\t\t$categories[$category->getUID()] = $category;\n\t\t}\n\t\t\n\t\treturn $categories;\n\t}",
"public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }",
"static function categories()\n {\n $category = \\SOE\\DB\\Category::where('parent_id', '0')\n ->orderBy('category_order')\n ->get();\n $return = array();\n foreach($categories as $cat)\n {\n $return[$cat->id] = $cat->slug;\n }\n return $return;\n }",
"function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}",
"function &getCategories()\r\n\t{\r\n\t\t$query = 'SELECT id AS value, catname AS text'\r\n\t\t\t\t. ' FROM #__eventlist_categories'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY ordering'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery( $query );\r\n\r\n\t\t$this->_categories = $this->_db->loadObjectList();\r\n\r\n\t\treturn $this->_categories;\r\n\t}",
"public function all()\n {\n return $this->category->all();\n }",
"public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }",
"public function categories()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'category';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }",
"function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getCategories() : array;",
"public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }",
"public function getEntryCategory($args)\n {\n\n // Get entries with EntryName\n $catName = $args['category'];\n //$entryName+='%';\n $dbo = DatabaseConnection::getInstance();\n\n $query_select_entry = \"\n SELECT EntryId, EntryName, EntryValue, CategoryId, DisplayName\n FROM Entry\n WHERE CategoryId = :catName\n \";\n\n\n $statement_select_entry = $dbo->prepare($query_select_entry);\n $statement_select_entry->bindParam(':catName', $catName);\n\n\n if (!$statement_select_entry->execute()) {\n http_response_code(StatusCodes::BAD_REQUEST);\n return array(\n \"error\" => \"Query failed.\"\n );\n }\n\n $result = $statement_select_entry->fetchAll(PDO::FETCH_ASSOC);\n\n $entries = [];\n foreach ($result as $entry) {\n// array_push($entries, array(\n// 'EntryId'=>$entry['EntryId'],\n// 'EntryName'=>$entry['EntryName'],\n// 'EntryValue'=>$entry['EntryValue'],\n// 'CategoryId'=>$entry['CategoryId']\n// ));\n array_push($entries, new Entry(\n $entry['EntryId'],\n $entry['EntryName'],\n $entry['EntryValue'],\n $entry['CategoryId'],\n $entry['DisplayName']\n ));\n }\n\n return $entries;\n }",
"public function getCategoriesList() {\n return $this->_get(16);\n }",
"public function getCategories(): Collection\n {\n return $this->model->categories()->get();\n }",
"public function get_categories()\n\t{\n\t\t$sql = \"SELECT ic.*, c.name category_name\n\t\t\tFROM issue_category ic \n\t\t\tLEFT JOIN categories c on ic.category_id = c.category_id\n\t\t\tWHERE ic.issue_id = '{$this->id}'\n\t\t\tORDER BY c.name ASC\";\n\t\t$this->db->execute_query($sql);\n\t\t$arr = array();\n\t\twhile($line = $this->db->fetch_line()) {\n\t\t\t$arr[$line['category_id']] = $line['category_name'];\n\t\t}\n\t\treturn $arr;\n\t}",
"public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(self::tablePrefix().'cms_post_category', ['post_id' => 'id']);\n }",
"public function findCategories();",
"public function categories(): array\n {\n return $this->categories;\n }",
"public function getCategories() {\n return $this->categories;\n }",
"public function getCategories()\n\t{\n\t\treturn $this->categories;\n\t}",
"public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"public function listCategories(){\n\t\t$lab = new lelabDB();\n\t\t$query = \"select * from $this->tableName order by id\";\n\t\t$result = $lab->getArray($query);\n\t\treturn $result;\n\t}",
"function get_all_category(){\n $cat_args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n\n );\n $all_category = get_categories( $cat_args );\n\n return $all_category;\n }",
"function get_all_category(){\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM evs_database.evs_set_form_attitude\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}",
"public static function getCategoriesList()\n {\n\n $db = Db::getConnection();\n\n $categoryList = array();\n\n $result = $db->query('SELECT id, name FROM category '\n . 'ORDER BY sort_order ASC');\n\n $i = 0;\n while ($row = $result->fetch()) {\n $categoryList[$i]['id'] = $row['id'];\n $categoryList[$i]['name'] = $row['name'];\n $i++;\n }\n\n return $categoryList;\n }",
"public static function all() {\n $list = [];\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM categories');\n\n // we create a list of Category objects from the database results\n foreach($req->fetchAll() as $category) {\n $list[] = new Category($category['id'], $category['name']);\n }\n\n return $list;\n }",
"public function getList()\n {\n $categories = array();\n\n $q = $this->_db->query('SELECT * FROM categorie ORDER BY idCategorie');\n\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\n {\n $categories[] = ($donnees);\n \n }\n }",
"public function getAllCategories()\n {\n return $this->AllChildren()->filter('ClassName', PortfolioCategory::class);\n }",
"function getCategories() {\n $this->db->select(\"*\");\n $query = $this->db->get('post_category');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }",
"public static function getCategoryList()\n {\n\n $db = Db::getConnection();\n\n $serviceList = array();\n\n $result = $db->query('SELECT id, name FROM categories '\n . 'ORDER BY id ASC');\n\n $i = 0;\n while ($row = $result->fetch()) {\n $serviceList[$i]['id'] = $row['id'];\n $serviceList[$i]['name'] = $row['name'];\n $i++;\n }\n\n return $serviceList;\n\n }",
"public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }",
"public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }",
"public function get_categories()\n\t{\n\t\treturn $this->_categories;\n\t}",
"public function getCategories()\r\n {\r\n $this->db->query(\"SELECT * FROM categories\");\r\n\r\n $row = $this->db->resultset();\r\n\r\n //Check Rows\r\n return $row;\r\n }",
"public function categories() : array\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n $categories = ClassInfo::subclassesFor('ConsultationCategory');\n return $this->Children()->filter('Classname', $categories);\n }",
"public static function getAll(){\n $result = static::$conn->query(\"SELECT * FROM enews.category\");\n return $result->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function get_all_categories()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('category');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"public function getCategories() {\n\t\t$db = new SelectionDB;\n\n\t\t$categories = $db->getCategories();\n\n\t\t# Get each value, convert to string and push it into categories property\n\t\tfor($i=0; $i<count($categories); $i++) {\n\t\t\t// convert to string\n\t\t\t$category = implode($categories[$i]);\n\t\t\t\n\t\t\t// push into categories property\n\t\t\tarray_push($this->categories, $category);\n\t\t}\n\n\t\t// Removing duplicate values from an array\n\t\t$result = array_unique($this->categories);\n\n\t\treturn $result;\n\t}",
"protected function findAllCategories()\n {\n return resolve([]);\n }",
"public function all() : Collection\n {\n return Category::all();\n }",
"public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }",
"function getCategories(){\n\treturn dbSelect('categories');\n}",
"public static function getAllCategories() {\n\t\t\t$db = Db::getInstance();\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description\n\t\t\t\t\t\t\t\t\t\t\t FROM categories\n\t\t\t\t\t\t\t\t\t\t ORDER BY location\n\t\t\t\t\t\t\t\t\t\t');\n\t\t\t\t$categoryQuery->execute();\n\t\t\t$allCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allCategories;\n\t\t}",
"public function getCategories()\n {\n $categories = new ArrayList;\n foreach(BlogCategory::get() as $category) {\n $data = array(\n 'Title' => $category->Title,\n 'Link' => $category->Parent()->Link('category/'.$category->URLSegment),\n 'ShowCount' => $this->ShowCount,\n 'Count' => $this->totalEntries($category->ID)\n );\n $categories->push(new ArrayData($data));\n }\n return $categories;\n }",
"public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }",
"public function getCategories(){\n $sql = \"SELECT DISTINCT cat.id, cat.name, cat.idnumber FROM {$this->table_prefix}course_categories cat\n INNER JOIN {$this->table_prefix}course c ON cat.id = c.category\";\n $result = $this->conn->query($sql);\n $categories;\n if($result->num_rows > 0){\n while($row = $result->fetch_assoc()){\n $categories[] = $row;\n }\n return array(\"erro\" => false, \"description\" => \"Categories found\", \"categories\" => $categories);\n }else{\n return array(\"erro\" => false, \"description\" => \"No categories with course found\", \"categories\" => $categories);\n }\n }"
] | [
"0.7403302",
"0.72930247",
"0.72022516",
"0.72022516",
"0.7193086",
"0.7186631",
"0.7161313",
"0.71498054",
"0.7139634",
"0.7131217",
"0.71290493",
"0.71271586",
"0.71183014",
"0.71118075",
"0.70756656",
"0.70631963",
"0.70564336",
"0.70491827",
"0.704857",
"0.70473343",
"0.7024323",
"0.70212436",
"0.70057267",
"0.6993909",
"0.69392866",
"0.69238067",
"0.6921171",
"0.6921037",
"0.68962926",
"0.6892497",
"0.68734175",
"0.6851742",
"0.68456924",
"0.68371683",
"0.6835901",
"0.6824113",
"0.6822336",
"0.68222886",
"0.6820221",
"0.6820052",
"0.6811345",
"0.6795365",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.67918444",
"0.6791013",
"0.67890394",
"0.6784296",
"0.6781752",
"0.67809737",
"0.67754453",
"0.67706275",
"0.67626953",
"0.6758948",
"0.6754751",
"0.6746736",
"0.673348",
"0.672836",
"0.6714308",
"0.6706555",
"0.66992396",
"0.6691727",
"0.6687043",
"0.66829026",
"0.6675897",
"0.66754764",
"0.6665435",
"0.6647295",
"0.6646028",
"0.6644461",
"0.6643698",
"0.66434515",
"0.66369116",
"0.6634945",
"0.66344833",
"0.66328293",
"0.66264695",
"0.66263765",
"0.662451",
"0.6622376",
"0.6618265",
"0.661554",
"0.6594945",
"0.65940064",
"0.6590953",
"0.6573718",
"0.6571289",
"0.6564731",
"0.6564415",
"0.65630317",
"0.6562949",
"0.65516114",
"0.654275",
"0.6540456"
] | 0.0 | -1 |
Save assigned categories to an entry | public function save_category_posts($entry_id, $meta, $data)
{
$categories = array();
// Channel:Form/Safecracker
if (isset($data['categories']))
{
$categories = $data['categories'];
}
// Normal Entry Save
elseif (isset($data['revision_post']['category']))
{
$categories = $data['revision_post']['category'];
}
$publisher_save_status = ee()->input->post('publisher_save_status');
// Insert new categories.
$this->_save_category_posts($entry_id, $publisher_save_status, $categories);
// If option is enabled, and saving as open, delete drafts and save new draft rows too.
if(
$publisher_save_status == PUBLISHER_STATUS_OPEN &&
ee()->publisher_setting->sync_drafts()
){
$this->_save_category_posts($entry_id, 'draft', $categories);
}
// Get open records, and re-insert them into category_posts, otherwise
// we get draft category assignments added to the core table.
if(
$publisher_save_status == PUBLISHER_STATUS_DRAFT &&
($categories = $this->get_category_posts($entry_id, PUBLISHER_STATUS_OPEN))
){
// First delete all category assignments for this entry.
ee()->db->where('entry_id', $entry_id)
->delete('category_posts');
foreach ($categories as $category)
{
$data = array(
'cat_id' => $category,
'entry_id' => $entry_id
);
$qry = ee()->db->where($data)->get('category_posts');
if ($qry->num_rows() == 0)
{
ee()->db->insert('category_posts', $data);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}",
"public function actionCategorySave()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $saveAction = new XenForo_Phrase('iversia_faq_category_added');\n\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n if ($category_id) {\n $dw->setExistingData($category_id);\n $saveAction = new XenForo_Phrase('iversia_faq_category_edited');\n }\n $dw->bulkSet(\n array(\n 'title' => $this->_input->filterSingle('title', XenForo_Input::STRING),\n 'display_order' => $this->_input->filterSingle('display_order', XenForo_Input::UINT),\n )\n );\n $dw->save();\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n $saveAction\n );\n }",
"public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}",
"function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}",
"public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }",
"public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }",
"public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }",
"private function _save_category_posts($entry_id, $publisher_save_status, $categories = array())\n {\n ee()->db->where('publisher_status', $publisher_save_status)\n ->where('publisher_lang_id', ee()->publisher_lib->lang_id)\n ->where('entry_id', $entry_id)\n ->delete('publisher_category_posts');\n\n /*\n TODO? - On save, see if the entry has a row for the requested status/lang_id in publisher_titles\n then we don't update the categories for that entry.\n\n if no rows exist, then get the categories for the default language, then insert them for the\n requested status/lang_id so it has records, thus sharing the same cats as the default lang.\n requires new loop over each language with the same insert array.\n */\n\n if ( !empty($categories))\n {\n foreach ($categories as $cat_id)\n {\n $data = array(\n 'cat_id' => $cat_id,\n 'entry_id' => $entry_id,\n 'publisher_status' => $publisher_save_status,\n 'publisher_lang_id' => ee()->publisher_lib->lang_id\n );\n\n ee()->db->insert('publisher_category_posts', $data);\n }\n }\n }",
"public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}",
"public function save($categories) {\n if (!empty($categories)) {\n $query = \"INSERT INTO \" . self::$TABLE . \"(\n id, \n name, \n link) VALUES\";\n \n if (is_array($categories)) {\n //make a bulk insert\n $rowsValues = \"\";\n foreach ($categories as $category) {\n if ($category->isValid()) {\n //check if the category already exists\n $existentCat = $this->getByName($category->getName());\n if (empty($existentCat)) {\n $rowsValues .= self::populateRowValuesFromObject($category) . \", \";\n }\n }\n }\n if (!empty($rowsValues)) {\n $rowsValues = substr($rowsValues, 0, strlen($rowsValues) - 2);\n $query .= $rowsValues . \";\";\n parent::executeQuery($query);\n }\n } else {\n //make a single row insert\n if ($categories->isValid()) {\n //check if the category already exists\n $existentCat = $this->getByName($categories->getName());\n if (empty($existentCat)) {\n $query .= self::populateRowValuesFromObject($categories) . \";\";\n parent::executeQuery($query);\n $categories->setId($this->lastInsertID());\n return $categories;\n }\n return $existentCat;\n }\n }\n }\n //category already exists.\n return null;\n }",
"function saveCat()\n {\n //update stuff\n }",
"public function save() {\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$this->setLast_modified($date);\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql = 'update cart_categories set ';\n\t\t} else {\n\t\t\t$sql = 'insert into cart_categories set ';\n\t\t\t$this->setDate_added($date);\n\t\t}\n\t\tif (!is_null($this->getImage())) {\n\t\t\t$sql .= '`categories_image`=\"' . e($this->getImage()->getId()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getParent_id())) {\n\t\t\t$sql .= '`parent_id`=\"' . e($this->getParent_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getSort_order())) {\n\t\t\t$sql .= '`sort_order`=\"' . e($this->getSort_order()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getDate_added())) {\n\t\t\t$sql .= '`date_added`=\"' . e($this->getDate_added()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getLast_modified())) {\n\t\t\t$sql .= '`last_modified`=\"' . e($this->getLast_modified()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getStatus())) {\n\t\t\t$sql .= '`categories_status`=\"' . e($this->getStatus()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql .= 'categories_id=\"' . e($this->getId()) . '\" where categories_id=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql = trim($sql, ', ');\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t$catId = Database::singleton()->lastInsertedID();\n\t\t$new = false;\n\t\tif (is_null($this->getId())) {\n\t\t\t$this->setId($catId);\n\t\t\t$new = true;\n\t\t\t$sql = 'insert into cart_categories_description set ';\n\t\t} else {\n\t\t\t$sql = 'update cart_categories_description set ';\n\t\t}\n\t\t$sql .= '`language_id`=\"' . 1 . '\", ';\n\t\t$sql .= '`categories_name`=\"' . e($this->getName()) . '\", ';\n\t\t$sql .= '`categories_description`=\"' . e($this->getDescription()) . '\"';\n\t\t\n\t\tif ($new) {\n\t\t\t$sql .= ', `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql .= ' where `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\tself::__construct($this->getId());\n\t}",
"public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }",
"public function save()\n {\n $error = true;\n\n // Save the not language specific part\n $pre_save_category = new self($this->category_id, $this->clang_id);\n\n if (0 === $this->category_id || $pre_save_category !== $this) {\n $query = rex::getTablePrefix() .'d2u_linkbox_categories SET '\n .\"name = '\". addslashes($this->name) .\"' \";\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = !$result->hasError();\n }\n }\n\n return $error;\n }",
"function storeSecondaryCategories( $secondary_categories )\r\n\t{\r\n\t // delete all existing ones\r\n\t $db = $this->getDBO();\r\n\t $db->setQuery( \"DELETE FROM #__calendar_eventcategories WHERE `event_id` = '$this->event_id';\");\r\n\t $db->query();\r\n\t \r\n\t // save new ones\r\n\t JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_publications/tables' );\r\n\t foreach( $secondary_categories as $secondary_category)\r\n\t {\r\n\t $table = JTable::getInstance( 'EventCategories', 'CalendarTable' );\r\n\t $table->event_id = $this->event_id;\r\n\t $table->category_id = $secondary_category;\r\n\t $table->store();\r\n\t }\r\n\t}",
"public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }",
"function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }",
"function save_extra_category_fileds( $term_id ) {\n\tif ( isset( $_POST['term_meta'] ) ) {\n\t\t$tag_id\t\t= $term_id;\n\t\t$term_meta\t= get_option( \"category_$tag_id\" );\n\t\t$cat_keys\t= array_keys( $_POST['term_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset( $_POST['term_meta'][$key] ) ) {\n\t\t\t\t$term_meta[$key] = $_POST['term_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t//save the option array\n\t\tupdate_option( \"category_$tag_id\", $term_meta );\n\t}\n}",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $category = ArticleCategories::findFirstByid($id);\n if (!$category) {\n $this->flash->error(\"category does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $category->id = $this->request->getPost(\"id\");\n $category->name = $this->request->getPost(\"name\");\n $category->description = $this->request->getPost(\"description\");\n \n\n if (!$category->save()) {\n\n foreach ($category->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"edit\",\n \"params\" => array($category->id)\n ));\n }\n\n $this->flash->success(\"category was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n\n }",
"public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}",
"public function saveCategory(Request $request){\n if (Category::where('name', $request->get('category'))->exists()){\n // found\n }\n else{\n $level = $request->get('parent') == ''? 1 : 2;\n if ($level == 1){\n $parent = null;\n }\n else{\n $parent = Category::where('name', $request->get('parent'))->first()->id;\n }\n Category::insert([\n 'name' => $request->get('category'),\n 'level' => $level,\n 'parent_id' => $parent,\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime()\n ]);\n }\n return redirect()->route('all-categories');\n }",
"public function storeCategory(array $data): void\n {\n }",
"public function save_category() {\n\t\t// If no form submission, bail!\n\t\tif ( empty( $_POST ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! isset( $_POST['set_redirection_category'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tcheck_admin_referer( 'rank-math-save-redirections', 'security' );\n\t\tif ( ! Helper::has_cap( 'redirections' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$cmb = cmb2_get_metabox( 'rank-math-redirections' );\n\t\t$values = $cmb->get_sanitized_values( $_POST );\n\n\t\t$values['redirection_category'] = isset( $values['redirection_category'] ) && is_array( $values['redirection_category'] ) ? $values['redirection_category'] : [];\n\t\tunset( $_POST['redirection_category'], $_POST['set_redirection_category'] );\n\n\t\tif ( empty( $values['id'] ) ) {\n\t\t\t$this->save_categories = $values['redirection_category'];\n\t\t\t$this->action( 'rank_math/redirection/saved', 'save_category_after_add' );\n\t\t\treturn true;\n\t\t}\n\n\t\twp_set_object_terms( $values['id'], array_map( 'absint', $values['redirection_category'] ), 'rank_math_redirection_category' );\n\t\treturn true;\n\t}",
"function process_categories() {\n\t\t$this->categories = apply_filters( 'wp_import_categories', $this->categories );\n\n\t\tif ( empty( $this->categories ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->categories as $cat ) {\n\t\t\t// if the category already exists leave it alone\n\t\t\t$term_id = term_exists( $cat['category_nicename'], 'category' );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );\n\t\t\t$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';\n\t\t\t$catarr = array(\n\t\t\t\t'category_nicename' => $cat['category_nicename'],\n\t\t\t\t'category_parent' => $category_parent,\n\t\t\t\t'cat_name' => $cat['cat_name'],\n\t\t\t\t'category_description' => $category_description\n\t\t\t);\n\n\t\t\t$id = wp_insert_category( $catarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = $id;\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import category %s', esc_html($cat['category_nicename']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->categories );\n\t}",
"function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}",
"public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }",
"function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}",
"function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}",
"public function store(CategoryRequest $request)\n { \n $data = $request->all();\n\n $data['slug'] = str_slug($data['name']);\n\n $data['level'] += 1;\n\n $category = Category::insertData($data);\n\n return $category; \n \n }",
"public function store(Request $request)\n {\n// $this->validate($request, [\n// 'name'=>'required|max:120|unique:page_categories'\n// ]);\n\n $category = new PageCategory();\n $category->main_page_category_id = $request->input('main_page_category_id') ? :null;\n $category->save();\n\n foreach (\\Loc::getLocales() as $locale){\n\n if($request->input('name.'.$locale->code) == \"\"){\n continue;\n }\n\n $category->setActiveLocale($locale->code);\n $category->name = $request->input('name.'.$locale->code);\n $category->slug = str_slug($request->input('name.'.$locale->code));\n $category->save();\n }\n\n return redirect()->route(\"backend.page.category.edit\", ['page_category' => $category->id])->withSuccess( __('backend.save_success') );\n }",
"public function SaveGroupCategory() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstGroup) $this->objGroupCategory->GroupId = $this->lstGroup->SelectedValue;\n\t\t\t\tif ($this->calDateRefreshed) $this->objGroupCategory->DateRefreshed = $this->calDateRefreshed->DateTime;\n\t\t\t\tif ($this->txtProcessTimeMs) $this->objGroupCategory->ProcessTimeMs = $this->txtProcessTimeMs->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the GroupCategory object\n\t\t\t\t$this->objGroupCategory->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }",
"function gtags_save_cats( $group ) { \t\n\tif ( isset( $_POST['group-cat'] ) && $group_cat = $_POST['group-cat'] ) {\n\t\t$gtags = explode( ',', gtags_get_group_tags( $group ) );\n\t\tarray_walk( $gtags, create_function( '&$a', '$a = trim($a);' ) ); // trim spaces\n\t\t$group_cat_prev = groups_get_groupmeta( $group->id, 'gtags_group_cat' );\n\n\t\tif ( $group_cat != $group_cat_prev ) { // we have a new value this time\n\t\t\tgroups_update_groupmeta( $group->id, 'gtags_group_cat', $group_cat ); //save the group category in group meta\n\t\t\t$gtags = array_diff( $gtags, (array)$group_cat_prev ); // remove the prev val with array_diff cause unset sucks\n\t\t}\n\n\t\t$gtags[] = $group_cat; // add it\n\t\t$gtags = array_unique( $gtags ); // remove duplications\n\t\tgroups_update_groupmeta( $group->id, 'gtags_group_tags', implode( ', ', $gtags ) );\n\t}\t\n}",
"public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}",
"public function store(Request $request)\n {\n $request->validate([\n 'title'=>'min:3|max:70|required',\n 'content'=>'min:50|required',\n 'categories'=>'required'\n ]);\n\n $user = Auth::user();\n\n $categories = array_values($request->categories);\n\n $article = $user->articles()->create($request->except('categories'));\n\n $article->categories()->attach($categories);\n\n return redirect()->to('/home');\n }",
"public function save()\n {\n $error = false;\n\n // Save the not language specific part\n $pre_save_object = new self($this->category_id, $this->clang_id);\n\n // save priority, but only if new or changed\n if ($this->priority !== $pre_save_object->priority || 0 === $this->category_id) {\n $this->setPriority();\n }\n\n if (0 === $this->category_id || $pre_save_object !== $this) {\n $query = \\rex::getTablePrefix() .'d2u_machinery_categories SET '\n .\"parent_category_id = '\". ($this->parent_category instanceof self ? $this->parent_category->category_id : 0) .\"', \"\n .\"priority = '\". $this->priority .\"', \"\n .\"pic = '\". $this->pic .\"', \"\n .\"pic_usage = '\". $this->pic_usage .\"' \";\n if (rex_plugin::get('d2u_machinery', 'export')->isAvailable()) {\n $query .= \", export_europemachinery_category_id = '\". $this->export_europemachinery_category_id .\"', \"\n .\"export_europemachinery_category_name = '\". $this->export_europemachinery_category_name .\"', \"\n .\"export_machinerypark_category_id = '\". $this->export_machinerypark_category_id .\"', \"\n .\"export_mascus_category_name = '\". $this->export_mascus_category_name .\"' \";\n }\n if (rex_plugin::get('d2u_machinery', 'machine_agitator_extension')->isAvailable()) {\n $query .= \", show_agitators = '\". $this->show_agitators .\"' \";\n }\n\n if (\\rex_addon::get('d2u_videos') instanceof rex_addon && \\rex_addon::get('d2u_videos')->isAvailable() && count($this->videos) > 0) {\n $query .= \", video_ids = '|\". implode('|', array_keys($this->videos)) .\"|' \";\n } else {\n $query .= \", video_ids = '' \";\n }\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = $result->hasError();\n }\n }\n\n $regenerate_urls = false;\n if (false === $error) {\n // Save the language specific part\n $pre_save_object = new self($this->category_id, $this->clang_id);\n if ($pre_save_object !== $this) {\n $query = 'REPLACE INTO '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang SET '\n .\"category_id = '\". $this->category_id .\"', \"\n .\"clang_id = '\". $this->clang_id .\"', \"\n .\"name = '\". addslashes(htmlspecialchars($this->name)) .\"', \"\n .\"description = '\". addslashes(htmlspecialchars($this->description)) .\"', \"\n .\"teaser = '\". addslashes(htmlspecialchars($this->teaser)) .\"', \"\n .\"usage_area = '\". addslashes(htmlspecialchars($this->usage_area)) .\"', \"\n .\"pic_lang = '\". $this->pic_lang .\"', \"\n .\"pdfs = '\". implode(',', $this->pdfs) .\"', \"\n .\"translation_needs_update = '\". $this->translation_needs_update .\"', \"\n .'updatedate = CURRENT_TIMESTAMP, '\n .\"updateuser = '\". (\\rex::getUser() instanceof rex_user ? \\rex::getUser()->getLogin() : '') .\"' \";\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n $error = $result->hasError();\n\n if (!$error && $pre_save_object->name !== $this->name) {\n $regenerate_urls = true;\n }\n }\n }\n\n // Update URLs\n if ($regenerate_urls) {\n \\d2u_addon_backend_helper::generateUrlCache('category_id');\n \\d2u_addon_backend_helper::generateUrlCache('machine_id');\n if (rex_plugin::get('d2u_machinery', 'used_machines')->isAvailable()) {\n \\d2u_addon_backend_helper::generateUrlCache('used_rent_category_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_rent_machine_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_sale_category_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_sale_machine_id');\n }\n }\n\n return !$error;\n }",
"public function save_category_form( $term_id ) {\n\t\tif( $this->save_count < 1 ) :\n\n\t\t\t$id = $this->args['id'];\n\t\t\t$data = Database::get_row( $this->args['table'], 'cat_id', $term_id );\n\n\t\t\tforeach( $this->args['table']['structure'] as $name => $args ) {\n\t\t\t\t$data[$name] = isset( $_POST[$name] ) ? $_POST[$name] : $data[$name];\n\t\t\t}\n\n\t\t\tif( empty( $data['cat_id'] ) ) {\n\t\t\t\t$data['cat_id'] = $term_id;\n\t\t\t\tDatabase::insert_row( $this->args['table'], $data );\n\t\t\t} else {\n\t\t\t\tDatabase::update_row( $this->args['table'], 'cat_id', $term_id, $data );\n\t\t\t}\n\n\t\t\t$this->save_count++;\n\n\t\tendif;\n\n\t}",
"function createCategories()\n {\n $currentCategories = $this->loadCategories();\n\n foreach ($this->categories as $category)\n {\n // Skip adding category if it already exists\n if (in_array($category, $currentCategories))\n {\n continue;\n }\n\n // Create a copy of the template array for category properties\n $data = array_merge($this->categoryTemplate);\n\n // Set the category description from the translation key in en-GB.com_cajobboard.sys.ini\n // remove any spaces from the category title when building the translation key\n $data['title'] = Text::_('COM_CAJOBBOARD_CATEGORY_TITLE_' . strtoupper(str_replace(' ', '', $category)));\n\n $data['description'] = $data['title'];\n\n // Initialize a new category\n $category = Table::getInstance('Category');\n\n // Bind passed category parameters to Category model\n $category->bind($data);\n\n // setLocation(integer $referenceId, string $position = 'after')\n $category->setLocation($category->getRootId(), 'last-child');\n\n // Check to make sure our data is valid. check() will auto generate alias if not set above.\n if (!$category->check())\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Store the category\n if (!$category->store(true))\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Build the path for our category and set it in the database\n $category->rebuildPath($category->id);\n }\n\n Table::getInstance('Category')->rebuild();\n }",
"function njp_categories_save($data)\n\t{\n\t\t$this->db->set('cat_name', $data['cat_name']);\n\t\t$this->db->set('court_type_id', (!empty($data['court_type_id']) ? $data['court_type_id'] : NULL ) );\n\t\t$this->db->set('cat_id', (!empty($data['cat_id']) ? $data['cat_id'] : NULL ) );\n\t\t$this->db->set('sorting', $data['sorting']);\n\t\t\n\t\tif ($data['id'] == 0 )\n\t\t{\n\t\t\t$status = $this->db->insert('categories_njp');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->where('id',$data['id']);\n\t\t\t$status = $this->db->update('categories_njp');\n\t\t}\n\t\t\n\t\t$status = $this->db->affected_rows();\n\t\treturn $status;\n\t}",
"protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }",
"public function saveCategoryRelation($category, $data)\r\n {\r\n if (!is_array($data)) {\r\n $data = array();\r\n }\r\n\r\n $adapter = $this->_getWriteAdapter();\r\n $bind = array(\r\n ':category_id' => (int)$category->getId(),\r\n );\r\n $select = $adapter->select()\r\n ->from($this->getMainTable(), array('rel_id', 'post_id'))\r\n ->where('category_id = :category_id');\r\n\r\n $related = $adapter->fetchPairs($select, $bind);\r\n $deleteIds = array();\r\n foreach ($related as $relId => $postId) {\r\n if (!isset($data[$postId])) {\r\n $deleteIds[] = (int)$relId;\r\n }\r\n }\r\n if (!empty($deleteIds)) {\r\n $adapter->delete(\r\n $this->getMainTable(),\r\n array('rel_id IN (?)' => $deleteIds)\r\n );\r\n }\r\n\r\n foreach ($data as $postId => $info) {\r\n $adapter->insertOnDuplicate(\r\n $this->getMainTable(),\r\n array(\r\n 'category_id' => $category->getId(),\r\n 'post_id' => $postId,\r\n 'position' => @$info['position']\r\n ),\r\n array('position')\r\n );\r\n }\r\n return $this;\r\n }",
"protected function storeCategoryIntoDatabase( &$category, &$languages, $exist_meta_title, &$layout_ids, &$available_store_ids, &$url_alias_ids ) {\n\t\t$category_id = $category['category_id'];\n\t\t$image_name = $this->db->escape($category['image']);\n\t\t$parent_id = $category['parent_id'];\n\t\t$top = $category['top'];\n\t\t$top = ((strtoupper($top)==\"TRUE\") || (strtoupper($top)==\"YES\") || (strtoupper($top)==\"ENABLED\")) ? 1 : 0;\n\t\t$columns = $category['columns'];\n\t\t$sort_order = $category['sort_order'];\n\t\t$date_added = $category['date_added'];\n\t\t$date_modified = $category['date_modified'];\n\t\t$names = $category['names'];\n\t\t$descriptions = $category['descriptions'];\n\t\tif ($exist_meta_title) {\n\t\t\t$meta_titles = $category['meta_titles'];\n\t\t}\n\t\t$meta_descriptions = $category['meta_descriptions'];\n\t\t$meta_keywords = $category['meta_keywords'];\n\t\t$seo_keyword = $category['seo_keyword'];\n\t\t$store_ids = $category['store_ids'];\n\t\t$layout = $category['layout'];\n\t\t$status = $category['status'];\n\t\t$status = ((strtoupper($status)==\"TRUE\") || (strtoupper($status)==\"YES\") || (strtoupper($status)==\"ENABLED\")) ? 1 : 0;\n\n\t\t// generate and execute SQL for inserting the category\n\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category` (`category_id`, `image`, `parent_id`, `top`, `column`, `sort_order`, `date_added`, `date_modified`, `status`) VALUES \";\n\t\t$sql .= \"( $category_id, '$image_name', $parent_id, $top, $columns, $sort_order, \";\n\t\t$sql .= ($date_added=='NOW()') ? \"$date_added,\" : \"'$date_added',\";\n\t\t$sql .= ($date_modified=='NOW()') ? \"$date_modified,\" : \"'$date_modified',\";\n\t\t$sql .= \" $status);\";\n\t\t$this->db->query( $sql );\n\t\tforeach ($languages as $language) {\n\t\t\t$language_code = $language['code'];\n\t\t\t$language_id = $language['language_id'];\n\t\t\t$name = isset($names[$language_code]) ? $this->db->escape($names[$language_code]) : '';\n\t\t\t$description = isset($descriptions[$language_code]) ? $this->db->escape($descriptions[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$meta_title = isset($meta_titles[$language_code]) ? $this->db->escape($meta_titles[$language_code]) : '';\n\t\t\t}\n\t\t\t$meta_description = isset($meta_descriptions[$language_code]) ? $this->db->escape($meta_descriptions[$language_code]) : '';\n\t\t\t$meta_keyword = isset($meta_keywords[$language_code]) ? $this->db->escape($meta_keywords[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_title`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_title', '$meta_description', '$meta_keyword' );\";\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_description', '$meta_keyword' );\";\n\t\t\t}\n\t\t\t$this->db->query( $sql );\n\t\t}\n\t\tif ($seo_keyword) {\n\t\t\tif (isset($url_alias_ids[$category_id])) {\n\t\t\t\t$url_alias_id = $url_alias_ids[$category_id];\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`url_alias_id`,`query`,`keyword`) VALUES ($url_alias_id,'category_id=$category_id','$seo_keyword');\";\n\t\t\t\tunset($url_alias_ids[$category_id]);\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`query`,`keyword`) VALUES ('category_id=$category_id','$seo_keyword');\";\n\t\t\t}\n\t\t\t$this->db->query($sql);\n\t\t}\n\t\tforeach ($store_ids as $store_id) {\n\t\t\tif (in_array((int)$store_id,$available_store_ids)) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_store` (`category_id`,`store_id`) VALUES ($category_id,$store_id);\";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t\t$layouts = array();\n\t\tforeach ($layout as $layout_part) {\n\t\t\t$next_layout = explode(':',$layout_part);\n\t\t\tif ($next_layout===false) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t} else if (count($next_layout)==1) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t}\n\t\t\tif ( (count($next_layout)==2) && (in_array((int)$next_layout[0],$available_store_ids)) && (is_string($next_layout[1])) ) {\n\t\t\t\t$store_id = (int)$next_layout[0];\n\t\t\t\t$layout_name = $next_layout[1];\n\t\t\t\tif (isset($layout_ids[$layout_name])) {\n\t\t\t\t\t$layout_id = (int)$layout_ids[$layout_name];\n\t\t\t\t\tif (!isset($layouts[$store_id])) {\n\t\t\t\t\t\t$layouts[$store_id] = $layout_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($layouts as $store_id => $layout_id) {\n\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_layout` (`category_id`,`store_id`,`layout_id`) VALUES ($category_id,$store_id,$layout_id);\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}",
"public function category_save(){\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_CREATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['name'] = html_escape($this->input->post('name'));\n\n if(html_escape($this->input->post('parent')) == ''){\n $data['parent'] = 0;\n }else{\n $data['parent'] = html_escape($this->input->post('parent'));\n }\n \n\n \n if($data['parent'] != 0 && !$this->category_model->is_parent_category($data['parent'])){\n \n $this->session->set_flashdata('category_save_failed', \"Failed to save sub category!!\");\n }else{\n \n $data['created_at'] = date(\"Y-m-d H:i:s\");\n \n $base_slug = string_to_slug($data['name']);\n $data['slug'] = $base_slug;\n $category_id = $this->category_model->add_category($data);\n \n // debug($data);\n // exit;\n if ($category_id){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_save') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('CREATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' create new category.')\n ->log(); //Add Database Entry\n\n\n\n $this->session->set_flashdata('category_save_success', \"New Category Create Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Failed to save category!!\");\n }\n\n\n }\n\n redirect(base_url('categories')); \n\n \n }",
"public function saved(Category $category)\n {\n // Removing Entries from the Cache\n $this->clearCache($category);\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'ru_title' => 'required|max:255',\n ]);\n\n $category = $this->handbookCategoryRepository->store($request);\n $categoryMeta = $category->createMetaInformation();\n auth()->user()->addHistoryItem('category.create', $categoryMeta);\n if ($request->has('saveQuit'))\n {\n $parent = $category->getParentId();\n if ($parent != null)\n return redirect()->route('admin.categories.show', $parent);\n else\n return redirect()->route('admin.categories.index');\n }\n else\n return redirect()->route('admin.categories.create');\n }",
"public function save()\n {\n $DB = DB::singleton(dsn());\n\n if ( $this->update ) {\n $SQL = SQL::newUpdate('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addUpdate('entry_' . $column, $this->{$column});\n }\n $SQL->addWhereOpr('entry_id', $this->id);\n $SQL->addWhereOpr('entry_blog_id', $this->blog_id);\n $DB->query($SQL->get(dsn()), 'exec');\n } else {\n $SQL = SQL::newInsert('entry');\n foreach ( $this->columns as $column ) {\n $SQL->addInsert('entry_' . $column, $this->{$column});\n }\n $DB->query($SQL->get(dsn()), 'exec');\n }\n\n EntryHelper::saveColumn($this->units, $this->id, $this->blog_id);\n Common::saveField('eid', $this->id, $this->fields);\n Common::saveFulltext('eid', $this->id, Common::loadEntryFulltext($this->id));\n }",
"public function addMultipleCategoriesToGroup();",
"public function updateCategories()\n {\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n }",
"public function store(StoreOrUpdateCategory $request)\n {\n $category = new Categories;\n $category->name = $request->input('name');\n $category->briefing = $request->input('briefing');\n\n $category->save();\n\n return redirect()->route('categories.index');\n }",
"public function save($data)\n\t{\n\t $input = Factory::getApplication()->input;\n\t\tJLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR.\n\t\t\t'/components/com_categories/helpers/categories.php');\n\t\t// validate id\n\t\tif((int)$data['catid']>0)\n\t\t{\n\t\t\t$catid = CategoriesHelper::validateCategoryId\n\t\t\t\t($data['catid'], 'com_dinning_philosophers');\n\t\t\t// If catid and extension don't match, validate will return 0.\n\t\t\t// Let's create a new category to for this component.\n\t\t\tif($catid===0){\n\t\t\t $category = array();\n\t\t\t $category['id'] = $data['catid'];\n\t\t\t \n\t\t\t $categoryTable = Table::getInstance('Category');\n\t\t\t if (!$categoryTable->load($category))\n\t\t\t {\n\t\t\t $catid = 0;\n\t\t\t } else {\n\t\t\t $properties = $categoryTable->getProperties();\n\t\t\t unset($properties['id']);\n\t\t\t unset($properties['alias']);\n\t\t\t array_values($properties);\n\t\t\t // categories uses extension as an alias to identify\n\t\t\t // duplicates. Use unique extension.\n\t\t\t $properties['extension'] = 'com_dinning_philosophers';\n\t\t\t $catid = CategoriesHelper::createCategory($properties);\n\t\t\t }\n\t\t\t}\n\t\t\t$data['catid'] = $catid;\n\t\t}\n\t\t// Alter the alias for save as copy.\n\t\tif($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this-getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\t\t\tif($data['alias']==$origTable->alias)\n\t\t\t{\n\t\t\t\t$data['alias']='';\n\t\t\t}\n\t\t\t$data['published']=0;\n\t\t}\n\t\treturn parent::save($data);\n\t}",
"public function save_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = new Category();\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}",
"public function store(CreateCategoryRequest $request)\n {\n $input = $request->all();\n $input['slug'] = \\Illuminate\\Support\\Str::slug($input['name']);\n\n $category = $this->categoryRepository->create($input);\n if (!$request->has('sub_categories_id')) {\n $category->subcategories()->detach();\n }\n if ($request->has('sub_categories_id'))\n {\n $allSubCategory = array();\n\n foreach ($request->sub_categories_id as $subcategoryid) {\n if (substr($subcategoryid, 0, 4) == 'new:') {\n $data['name'] = substr($subcategoryid, 4);\n $data['slug'] = \\Illuminate\\Support\\Str::slug($data['name']);\n $newsubcategory = SubCategory::create($data);\n $allSubCategory[] = $newsubcategory->id;\n continue;\n }\n $allSubCategory[] = $subcategoryid;\n }\n\n $category->subcategories()->sync($allSubCategory);\n }\n\n\n Flash::success('Category saved successfully.');\n\n return redirect(route('categories.index'));\n }",
"protected function save_all_categories( $categories = '', $content = '', $post = false ) {\n\t\t$this->set_object_terms( get_post( $post ), $categories, 'category' );\n\t}",
"public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }",
"public function run()\n {\n $categories = config('categories');\n foreach ($categories as $category) {\n $newCategory = new Category();\n $newCategory->name = $category['name'];\n $newCategory->icon = $category['icon'];\n $newCategory->slug = $this->generateSlug($category['name']);\n $newCategory->save();\n }\n }",
"public function createCategory();",
"function wlms_book_categories_save()\n{\n global $wpdb;\n $name = \"\";\n \n $name = trim( $_POST['wlms_book_categories_name'] );\n $errors = array();\n\n if (strlen($name) == 0)\n {\n array_push( $errors, \"book_cat\" );\n }\n\n\n if( count($errors) == 0 )\n {\n $nonce = $_REQUEST['_wpnonce'];\n if ( ! wp_verify_nonce( $nonce, 'submit_books_categories' ) ) \n {\n exit; \n }\n\n // books categories save\n $id = 0;\n if(isset ($_POST['wlms_save_book_categories']))\n {\n $wpdb->query( $wpdb->prepare( \n \"\n INSERT INTO {$wpdb->prefix}wlms_book_categories\n ( name, status )\n VALUES ( %s, %d )\n \", \n array(\n $_POST['wlms_book_categories_name'], \n $_POST['wlms_book_cat_status']\n ) \n ) );\n \n $id = $wpdb->insert_id;\n set_message_key('item_saved', 'saved');\n }\n \n \n //update books categories\n if(isset ($_POST['wlms_update_book_categories']))\n {\n $request_id = 0;\n if ( is_numeric( $_GET['update_id'] ) ) {\n $request_id = absint( $_GET['update_id'] );\n $id = $request_id;\n }\n \n $wpdb->query(\n $wpdb->prepare(\n \"UPDATE {$wpdb->prefix}wlms_book_categories SET name = %s, status = %d WHERE id= %d\",\n $_POST['wlms_book_categories_name'], $_POST['wlms_book_cat_status'], $request_id\n )\n );\n \n set_message_key('item_updated', 'updated');\n }\n \n \n wp_redirect( esc_url_raw( add_query_arg( array( 'update_id' => $id ), admin_url( 'admin.php?page=wlms-pages&wlms-tab=wlms-book-categories&manage=add-book-categories' ) ) ) ); exit;\n }\n \n}",
"function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}",
"public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }",
"public function store(CatelogsRequest $request)\n {\n $request->merge(['slug' => str_slug($request->name,'-')]);\n Categorylist::create($request->all());\n return redirect()->route('category.index');\n }",
"function InsertCategory_board()\n {\n $this->model->InsertCategory();\n }",
"public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}",
"function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }",
"public function save()\n {\n\t\t\tforeach($this->items as $index=>$data)\n\t\t\t{\n\t \t//if exists, update\n\t\t\t\tif($data[\"object\"])\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]->update(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$data[\"producttype\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]=MyModel::create(\"Product\",array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$data[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$this->main->producttypedata->items[$data[\"producttypename\"]][\"object\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\n\t\t\t}\n }",
"public function store($categoria)\n {\n $this->db->insert('categorias', $categoria);\n }",
"function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}",
"private function SaveData()\n {\n // loop tanks and save data\n foreach ($this->tanks AS $tank_id => $data) {\n // get category id from tank id\n $category_id_tank = $this->CreateCategoryByIdentifier($this->InstanceID, $tank_id, $data['Name']);\n\n // loop tank data and add variables to tank category\n $position = 0;\n foreach ($data AS $key => $value) {\n $this->CreateVariableByIdentifier($category_id_tank, $key, $value, $position);\n $position++;\n }\n }\n }",
"function add_cat() {\n $item = mysql_real_escape_string($_POST['cat']);\n $sql = \"INSERT INTO Categories (name) \n VALUES ('$item')\";\n\tmysql_query($sql);\n}",
"public function setCategory(?SubmissionCategory $value): void {\n $this->getBackingStore()->set('category', $value);\n }",
"public function run()\n {\n $categories = [\"html\",\"css\",\"js\",\"php\",\"laravel\",\"vuejs\",\"sql\",\"nosql\",\"git\"];\n \n foreach($categories as $category){\n $newCategory = new Category();\n $newCategory->name = $category;\n $newCategory->slug = Str::of(\"$category\")->slug(\"-\");\n $newCategory->save();\n }\n \n\n }",
"public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}",
"function publisher_saveCategoryPermissions($groups, $categoryid, $perm_name)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n\r\n $result = true;\r\n\r\n $module_id = $publisher->getModule()->getVar('mid');\r\n $gperm_handler = xoops_gethandler('groupperm');\r\n // First, if the permissions are already there, delete them\r\n $gperm_handler->deleteByModule($module_id, $perm_name, $categoryid);\r\n\r\n // Save the new permissions\r\n if (count($groups) > 0) {\r\n foreach ($groups as $group_id) {\r\n $gperm_handler->addRight($perm_name, $categoryid, $group_id, $module_id);\r\n }\r\n }\r\n return $result;\r\n}",
"function save_listing_category_custom_meta( $term_id ) {\n\n\tif ( isset( $_POST['listing_cat_meta'] ) ) {\n\t\t$t_id = $term_id;\n\t\t$listing_cat_meta = get_option( \"taxonomy_listing_category_$t_id\" );\n\t\t$cat_keys = array_keys( $_POST['listing_cat_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset ( $_POST['listing_cat_meta'][$key] ) ) {\n\t\t\t\t$listing_cat_meta[$key] = $_POST['listing_cat_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t// Save the option array.\n\t\tupdate_option( \"taxonomy_listing_category_$t_id\", $listing_cat_meta );\n\t}\n}",
"public function testSaveCategory()\n {\n $category = new Category();\n\n Yii::$app->db->createCommand('set foreign_key_checks=0')->execute();\n $category->setAttributes(['name' => 'name','class' => 'active','featured_campaign_id' => 1]);\n $category->save(false);\n $this->tester->canSeeRecord('backend\\models\\Category',array('name' => 'name','class' => 'active','featured_campaign_id' => 1));\n Yii::$app->db->createCommand('set foreign_key_checks=1')->execute();\n }",
"protected function afterSave()\n {\n $arrayIngresients = array();\n $ingredientsKey = $_POST['Ing'];\n $ingredientsValue = $_POST['IngV'];\n $amountIngredients = sizeof($ingredientsKey);\n\n for($i = 0; $i < $amountIngredients; $i++){\n $arrayIngresients[] = array(\n 'ingredient_id' => $ingredientsKey[$i],\n 'total' => $ingredientsValue[$i],\n );\n }\n $arr = serialize($arrayIngresients);\n $category = Categories::model()->findByAttributes(array('section_id' => $this->id));\n if($category == null){\n $category = new Categories;\n $category->section_id = $this->id;\n $category->values = $arr;\n $category->save();\n }\n /**\n * If old records to save in DB\n */\n $arrayOldIngresients = array();\n $ingredientsOld = $_POST['IngOld'];\n if($ingredientsOld != null){\n foreach($ingredientsOld as $key => $value){\n $arrayOldIngresients[] = array(\n 'ingredient_id' => $key,\n 'total' => $value,\n );\n }\n $arrOld = serialize($arrayOldIngresients);\n $categoryOld = Categories::model()->findByAttributes(array('section_id' => $this->id));\n $categoryOld->values = $arrOld;\n $categoryOld->update(array('values'));\n }\n }",
"public function run()\n {\n $data = ['HTML', 'CSS', 'JavaScript', 'PHP'];\n foreach ($data as $value) {\n $new_cat = new Category();\n $new_cat->name = $value;\n $new_cat->slug = Str::slug($value, '-');\n $new_cat->save();\n }\n }",
"public function run()\n {\n //\n $categories = [\n ['name' => 'Spoon'],\n ['name' => 'Fork'],\n ['name' => 'Cups'],\n ['name' => 'Plates'],\n ['name' => 'Knife'],\n ];\n UtensilCategory::insert($categories);\n }",
"public function updatecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n // copy all entries from $args to $obj that are found in the categories table\n // this prevents possible SQL errors if non existing keys are passed to this function\n $ztables = DBUtil::getTables();\n $obj = array();\n foreach ($args as $key => $arg) {\n if (array_key_exists($key, $ztables['dizkus_categories_column'])) {\n $obj[$key] = $arg;\n }\n }\n \n if (isset($obj['cat_id'])) {\n $obj = DBUtil::updateObject($obj, 'dizkus_categories', null, 'cat_id');\n return true;\n }\n \n return false;\n }",
"function bvt_sfa_feed_admin_screen() {\n\n // TODO: Break this function down into smaller bits?\n\n global $wpdb;\n\n $submit_flag = \"bvt_sfa_feed_admin_form\";\n\n $categories = bvt_sfa_feed_admin_get_categories();\n\n if (isset($_POST[$submit_flag]) && $_POST[$submit_flag] == 'Y') {\n\n $errors = false;\n\n // Postback; save feed settings...\n\n foreach ($categories as $category) {\n\n if ($_POST['bvt_sfa_catfeed'][$category->cat_ID]) {\n\n // ...only for categories actually submitted\n\n $new_values = $_POST['bvt_sfa_catfeed'][$category->cat_ID];\n\n $sql = $wpdb->prepare(\"\n INSERT INTO \" . BVT_SFA_DB_FEED_TABLE . \" (\n category_id,\n feed_url,\n postrank_url,\n cache_time\n )\n VALUES (\n %d,\n %s,\n %s,\n %d\n )\n ON DUPLICATE KEY UPDATE\n feed_url = %s,\n postrank_url = %s,\n cache_time = %d\",\n $category->cat_ID,\n $new_values['feed_url'],\n $new_values['postrank_url'],\n $new_values['cache_time'],\n $new_values['feed_url'],\n $new_values['postrank_url'],\n $new_values['cache_time']\n );\n }\n\n if ($wpdb->query($sql) === FALSE) {\n\n echo '\n <div class=\"error\">\n <p>\n <strong>Error saving settings!</strong>\n It was not possible to save feed settings for feed ID\n ' . htmlspecialchars($category->cat_ID) . '. Error: ';\n $wpdb->print_error();\n echo '</p></div>';\n\n $errors = true;\n }\n }\n\n // Save static content\n\n update_option(\n \"BVT_SFA_FEED_INTRO_HEADING\",\n $_POST[\"bvt_sfa_feed_intro_heading\"]\n );\n\n update_option(\n \"BVT_SFA_FEED_INTRO_BODY\",\n $_POST[\"bvt_sfa_feed_intro_body\"]\n );\n\n update_option(\n \"BVT_SFA_FEED_INTRO_BODY_HOMEPAGE\",\n $_POST[\"bvt_sfa_feed_intro_body_homepage\"]\n );\n\n // Save advanced settings\n\n update_option(\n \"BVT_SFA_TOPICS_CATEGORY_ID\",\n $_POST[\"bvt_sfa_topics_category_id\"]\n );\n\n update_option(\n \"BVT_SFA_METRICS_ITEMS\",\n str_replace(\" \", \"\", strtolower($_POST[\"bvt_sfa_metrics_items\"]))\n // remove spaces, set to lowercase\n );\n\n if (!$errors) {\n echo '<div class=\"updated\"><p><strong>Success.</strong>\n New settings saved.</p></div>';\n }\n\n // Re-get categories, since the parent category might have changed\n\n $categories = bvt_sfa_feed_admin_get_categories();\n }\n\n // Read config from DB\n\n foreach ($categories as $category) {\n\n $sql = $wpdb->prepare(\"\n SELECT\n category_id,\n feed_url,\n postrank_url,\n last_update,\n cache_time\n FROM\n \" . BVT_SFA_DB_FEED_TABLE . \"\n WHERE\n category_id = %d\",\n $category->cat_ID\n );\n\n // Merge config with list of categories\n\n if ($result = $wpdb->get_row($sql)) {\n\n $category->feed_url = $result->feed_url;\n $category->postrank_url = $result->postrank_url;\n $category->cache_time = $result->cache_time;\n $category->last_update =\n ($result->last_update == \"0000-00-00 00:00:00\") ?\n \"Never\" :\n $result->last_update;\n }\n else {\n\n $category->feed_url = \"\";\n $category->postrank_url = \"\";\n $category->cache_time = BVT_SFA_FEED_CACHE_TIME;\n $category->last_update = \"Never\";\n }\n }\n\n // Output form\n\n ?>\n\n <div class=\"wrap\">\n <form method=\"post\" action=\"\">\n\n <input type=\"hidden\" name=\"<?php echo $submit_flag; ?>\" value=\"Y\" />\n\n <h2>PostRank Feed Seetings</h2>\n\n <h3>Subject feeds</h3>\n\n <table class=\"widefat\">\n <thead>\n <tr>\n <th>Subject title</th>\n <th>Feed URL</th>\n <th>PostRank URL</th>\n <th>Cache time (seconds)</th>\n <th>Last updated</th>\n </tr>\n </thead>\n\n <tbody>\n\n <?php foreach ($categories as $category) { ?>\n\n <tr>\n\n <td><?php echo htmlspecialchars($category->name) ?></td>\n <td>\n <input\n type=\"text\"\n style=\"width: 100%;\"\n value=\"<?php echo htmlspecialchars($category->feed_url) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][feed_url]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][feed_url]\" />\n </td>\n <td>\n <input\n type=\"text\"\n style=\"width: 100%;\"\n value=\"<?php echo htmlspecialchars($category->postrank_url) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][postrank_url]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][postrank_url]\" />\n </td>\n <td>\n <input\n type=\"text\"\n value=\"<?php echo htmlspecialchars($category->cache_time) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][cache_time]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][cache_time]\" />\n </td>\n <td>\n <?php echo htmlspecialchars($category->last_update) ?>\n </td>\n\n </tr>\n\n <?php } ?>\n\n </tbody>\n </table>\n\n\n <h3>Static content</h3>\n\n <p>Please note that HTML is not allowed in these fields.</p>\n\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_heading\">Intro heading</label>\n </th>\n <td>\n <input\n style=\"width: 47.5%;\"\n type=\"text\"\n value=\"<?php echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_HEADING\")); ?>\"\n name=\"bvt_sfa_feed_intro_heading\"\n id=\"bvt_sfa_feed_intro_heading\" />\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_body_homepage\">\n Intro text (home page)\n </label>\n </th>\n <td>\n <textarea\n style=\"width: 95%; height: 7em;\"\n name=\"bvt_sfa_feed_intro_body_homepage\"\n id=\"bvt_sfa_feed_intro_body_homepage\"><?php\n echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_BODY_HOMEPAGE\"));\n ?></textarea>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_body\">\n Intro text (category pages)\n </label>\n <p><em>Note</em>: The text \"<strong>[category]</strong>\" will be\n replaced with the current category name.</p>\n </th>\n <td>\n <textarea\n style=\"width: 95%; height: 7em;\"\n name=\"bvt_sfa_feed_intro_body\"\n id=\"bvt_sfa_feed_intro_body\"><?php\n echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_BODY\"));\n ?></textarea>\n </td>\n </tr>\n </tbody>\n </table>\n\n <h3>Advanced settings</h3>\n\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_topics_category_id\">\n Parent category for subjects\n </label>\n </th>\n <td>\n <?php\n wp_dropdown_categories(array(\n \"exclude\" => 1, /* 1 is \"Uncategorized\" */\n \"hide_empty\" => false,\n \"hierarchical\" => 1,\n \"name\" => \"bvt_sfa_topics_category_id\",\n \"selected\" => get_option('bvt_sfa_topics_category_id')\n ));\n ?>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_metrics_items\">\n PostRank metrics to display\n </label>\n </th>\n <td>\n <input\n style=\"width: 47.5%;\"\n type=\"text\"\n value=\"<?php echo htmlspecialchars(get_option(\"BVT_SFA_METRICS_ITEMS\")); ?>\"\n name=\"bvt_sfa_metrics_items\"\n id=\"bvt_sfa_metrics_items\" />\n <p>Comma-separated list of data IDs. Available IDs include:\n delicious, brightkite, reddit_comments, reddit_votes, views,\n identica, google, diigo, clicks, blip, digg, bookmarks,\n twitter, jaiku, tumblr, ff_likes, ff_comments, comments. These are\n <a href=\"http://www.postrank.com/postrank#sources\">described by\n PostRank</a>.</p>\n </td>\n </tr>\n </tbody>\n </table>\n\n <p class=\"submit\">\n <input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n </p>\n\n </form>\n </div>\n\n <?php\n}",
"public function store(CategoryRequest $request)\n {\n $inputs = $request->all();\n $inputs['active'] = $request->has('active')?1:0;\n Category::create($inputs);\n return redirect('admin/category');\n }",
"public function store(PostRequest $request)\n {\n // dd($request->all());\n\n $validData = $request->validated();\n $post = new Post;\n $post->title = $validData['title'];\n $post->body = $validData['body'];\n $post->user_id = auth()->user()->id;\n $post->save();\n\n $categoryIds = $validData['check_list'];\n $categories = Category::find($categoryIds);\n $post->categories()->sync($categories);\n\n\n return redirect('/')->with('success','New Post created successfully');\n\n }",
"public function store(CreateArticlecatsRequest $request)\n {\n $input = $request->all();\n\n //如果用户没有输入别名,则自动生成\n if (!array_key_exists('slug', $input) || $input['slug'] == '') {\n $pinyin = new Pinyin();\n $input['slug'] = $pinyin->permalink($input['name']);\n }\n\n //清除空字符串\n $input = array_filter( $input, function($v, $k) {\n return $v != '';\n }, ARRAY_FILTER_USE_BOTH );\n $input = attachAccoutInput($input);\n $category = $this->categoryRepository->create($input);\n\n Flash::success('保存成功');\n\n return redirect(route('articlecats.index'));\n }",
"function createCategory($category)\r\n{\r\n $results = false;\r\n \r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"INSERT INTO categories SET category = :category\");\r\n \r\n $binds = array(\r\n // Used to place new array information under a new ID in Categories table\r\n \":category\" => $category,\r\n );\r\n \r\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) \r\n {\r\n $results = true;\r\n }\r\n \r\n return $results; \r\n}",
"public function store(Request $request)\n {\n $post = new Post;\n $post->title = Input::get('title');\n $post->slug = str_slug(Input::get('title'), \"-\");\n $post->content = Input::get('content');\n $post->save();\n foreach(Input::get('category') as $value) {\n $category_post = new CategoryPost;\n $category_post->post_id = $post->id;\n $category_post->category_id = $value;\n $category_post->save();\n }\n\n Session::flash('message', 'Menambah posting sukses!');\n return Redirect::to('dashboard/post');\n\n }",
"function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n\r\n if ( !isset( $this->ID ) )\r\n {\r\n $db->lock( \"eZImageCatalogue_Category\" );\r\n\r\n $this->ID = $db->nextID( \"eZImageCatalogue_Category\", \"ID\" );\r\n\r\n $db->query( \"INSERT INTO eZImageCatalogue_Category\r\n ( ID, Name, Description, UserID, ParentID, SectionID ) VALUES\r\n ( '$this->ID', '$name', '$description', '$this->UserID', '$this->ParentID', '$this->SectionID' )\" );\r\n $db->unlock();\r\n }\r\n else\r\n {\r\n $db->query( \"UPDATE eZImageCatalogue_Category SET\r\n Name='$name',\r\n Description='$description',\r\n UserID='$this->UserID',\r\n ParentID='$this->ParentID',\r\n SectionID='$this->SectionID' WHERE ID='$this->ID'\" );\r\n }\r\n\r\n\r\n if ( $dbError == true )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n\r\n return true;\r\n }",
"public function saving(Model $category): void\n {\n $category->slug = $this->generateSlug($category);\n }",
"public function set__categories($categories)\n\t{\n\t\t// Currently cannot get multiple category groups through relationships\n\t\t$cat_groups = array();\n\n\t\tif ($this->Channel->cat_group)\n\t\t{\n\t\t\t$cat_groups = explode('|', $this->Channel->cat_group);\n\t\t}\n\n\t\tif ($this->isNew() OR empty($categories))\n\t\t{\n\t\t\t$this->Categories = NULL;\n\t\t}\n\n\t\tif (empty($categories))\n\t\t{\n\t\t\tforeach ($cat_groups as $cat_group)\n\t\t\t{\n\t\t\t\t$this->setRawProperty('cat_group_id_'.$cat_group, '');\n\t\t\t\t$this->getCustomField('categories[cat_group_id_'.$cat_group.']')->setData('');\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t$set_cats = array();\n\n\t\t// Set the data on the fields in case we come back from a validation error\n\t\tforeach ($cat_groups as $cat_group)\n\t\t{\n\t\t\tif (array_key_exists('cat_group_id_'.$cat_group, $categories))\n\t\t\t{\n\t\t\t\t$group_cats = $categories['cat_group_id_'.$cat_group];\n\n\t\t\t\t$cats = implode('|', $group_cats);\n\n\t\t\t\t$this->setRawProperty('cat_group_id_'.$cat_group, $cats);\n\t\t\t\t$this->getCustomField('categories[cat_group_id_'.$cat_group.']')->setData($cats);\n\n\t\t\t\t$group_cat_objects = $this->getModelFacade()\n\t\t\t\t\t->get('Category')\n\t\t\t\t\t->filter('site_id', ee()->config->item('site_id'))\n\t\t\t\t\t->filter('cat_id', 'IN', $group_cats)\n\t\t\t\t\t->all();\n\n\t\t\t\tforeach ($group_cat_objects as $cat)\n\t\t\t\t{\n\t\t\t\t\t$set_cats[] = $cat;\n\t\t\t\t}\n\n\t\t\t\t$cat_ids = $group_cat_objects->pluck('cat_id');\n\t\t\t\tif (ee()->config->item('auto_assign_cat_parents') == 'y')\n\t\t\t\t{\n\t\t\t\t\tforeach ($set_cats as $cat)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ($cat->Parent !== NULL)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cat = $cat->Parent;\n\t\t\t\t\t\t\tif ( ! in_array($cat->getId(), $cat_ids))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$set_cats[] = $cat;\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\t\t$this->Categories = $set_cats;\n\t}",
"public function run()\n {\n $categories = array(\n array('name' => 'Learning'),\n array('name' => 'Reminder'),\n array('name' => 'Personal')\n );\n Category::insert($categories); \n }",
"public function run()\n {\n $categories=[\n \"Gossip\",\n \"Cronaca\",\n \"Politica\",\n \"Sport\",\n \"Cucina\"\n ];\n\n foreach($categories as $category){\n $newCategory = new Category();\n $newCategory->name = $category;\n $newCategory->slug = Str::slug($newCategory->name, '-');\n\n $newCategory->save();\n }\n }",
"public function store(StoreCategoriaRequest $request)\r\n {\r\n try {\r\n $categoria = new Categoria();\r\n $categoria->nombre = $request->input('nombre');\r\n $categoria->save();\r\n } catch (\\Exception $error) {\r\n // manejar\r\n }\r\n }",
"public function store(Request $request)\n {\n $category = new Categories();\n $category->name = $request->name;\n $category->slug = $request->slug;\n $category->parent = Categories::whereIn('slug',($request->parent == null ? [] : $request->parent))->get()->toArray();\n $category->save();\n\n return redirect()->route('category.index')->with('toastr', 'category');\n }",
"public function store(CategoryRequest $request)\n {\n //\n $cates = new Category();\n $cates->name = $request->input('name');\n $cates->role = $request->input('role');\n $cates->status = 1;\n $cates->slug = Str::slug($request->name,\"-\");\n $datetime = Carbon::now('Asia/Ho_Chi_Minh');\n $cates->created_at = $datetime;\n $cates->updated_at = null;\n $cates->save();\n return redirect('admin/danh-muc');\n }",
"function categoriesSaveOrder( &$cid ) {\n global $mainframe;\n\t$database = &JFactory::getDBO();\n $total = count( $cid ); \n \n $order = JRequest::getVar('order', array(), 'post', 'array' );\n\n for( $i=0; $i < $total; $i++ ) {\n $query = \"UPDATE #__jdownloads_cats\"\n . \"\\n SET ordering = \" . (int) $order[$i]\n . \"\\n WHERE cat_id = \" . (int) $cid[$i];\n $database->setQuery( $query );\n if (!$database->query()) {\n echo \"<script> alert('\".$database->getErrorMsg().\"'); window.history.go(-1); </script>\\n\";\n exit();\n }\n // update ordering\n $row = new jlist_cats( $database );\n $row->load( (int)$cid[$i] );\n }\n // clean any existing cache files\n $cache =& JFactory::getCache('com_jdownloads');\n $cache->clean('com_jdownloads');\n \n $msg = JText::_('COM_JDOWNLOADS_BACKEND_CATS_SAVEORDER');\n $mainframe->redirect( 'index.php?option=com_jdownloads&task=categories.list', $msg );\n}",
"public function addCategoryToGroupById($gorup_id, $category_id);",
"public function store(Request $request)\n {\n $data = $request->input();\n if(empty($data['slug'])) {\n $data['slug'] = \\Str::slug($data['title']);\n }\n\n/* Создаст объект но не добавит в БД\n $item = new BlogCategory($data);\n $item->save(); // - Добавление в БД, вернет true или false; */\n\n // Создаст объект и добавит в БД\n $item = (new BlogCategory())->create($data); // Сохранит и вернет объект\n\n if ($item) {\n return redirect()->route('blog.admin.categories.edit', [$item->id])\n ->with(['success' => 'Успешно сохранено']);\n } else {\n return back()\n ->withErrors(['msg' => \"Ошибка сохранения\"])\n ->withInput();\n }\n }",
"public function store(Request $request)\n {\n $this->validate($request,[\n 'head_category' => 'required',\n 'category' => 'required',\n ]);\n\n $category = new Category;\n\n $category->cat_name = $request->category;\n $category->cat_slug = str_slug($request->category, '-');\n $category->level = 1;\n $category->parent_id = $request->head_category;\n \n $category->save();\n\n Session::flash('success','Your data is save.');\n \n return redirect()->route('subcategory.index');\n }",
"public function postCategoryMultiUpdate(){\n\t\t$selected_items_id = Input::get('id');\n\t\t$selected_item_color_id = Input::get('shift_category_color_id');\n\t\t$messages = new MessageBag();\n\t\t\n\t\tforeach($selected_items_id as $key => $value){\n\t\t\tif(isset($selected_item_color_id[$key])){\n\t\t\t\ttry{\n\t\t\t\t\t$category = ShiftCategory::find($value);\n\t\t\t\t\t$category->shift_category_color_id = $selected_item_color_id[$key];\n\t\t\t\t\t$this->shift->saveCategory($category);\n\t\t\t\t}catch(\\Exception $e){\n\t\t\t\t\t$messages->add('error', $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif($messages->count())\n\t\t\treturn Redirect::back()->withErrors($messages);\n\t\telse\n\t\t\treturn Redirect::to($this->_adminPrefix. '/shifts/category-list')->with('success', 'Selected categories updated successfully');\t\n\t}",
"function insertEntry(&$request, $newRowId) {\n\n\t\t$application =& PKPApplication::getApplication();\n\t\t$request =& $application->getRequest();\n\n\t\t$categoryId = $newRowId['name'];\n\t\t$categoryDao =& DAORegistry::getDAO('CategoryDAO');\n\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t$press =& $request->getPress();\n\t\t$monograph =& $this->getMonograph();\n\n\t\t$category =& $categoryDao->getById($categoryId, $press->getId());\n\t\tif (!$category) return true;\n\n\t\t// Associate the category with the monograph\n\t\t$monographDao->addCategory(\n\t\t\t$monograph->getId(),\n\t\t\t$categoryId\n\t\t);\n\t}",
"public function run()\n {\n $categorie = config('database.categories');\n\n foreach ($categorie as $value) {\n $nuova_categoria = new Category();\n $nuova_categoria->name = $value['name'];\n $nuova_categoria->slug = Str::slug($value['slug']);\n //$nuovo_libro->fill($value);\n $nuova_categoria->save();\n }\n }",
"public function store(Request $request)\n {\n if (Auth::user()->cant('create', Category::class)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $rules = [\n 'name' => 'required',\n 'url' => 'required|unique:categories'\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect()->route('categories.create')->withErrors($validator)->withInput();\n }\n\n $category = new Category();\n $category->name = $request->get('name');\n $category->url = $request->get('url');\n $category->enabled = $request->filled('enabled');\n $category->meta_title = $request->get('meta_title');\n $category->meta_keywords = $request->get('meta_keywords');\n $category->meta_description = $request->get('meta_description');\n $category->short_text = $request->get('short_text');\n $category->full_text = $request->get('full_text');\n $category->save();\n return redirect()->route('categories.edit', ['id'=>$category->id]);\n }"
] | [
"0.7105386",
"0.657624",
"0.65236574",
"0.64653856",
"0.6462581",
"0.6461511",
"0.6438404",
"0.62992126",
"0.61338675",
"0.596923",
"0.59471154",
"0.59307206",
"0.5913978",
"0.58563083",
"0.5843725",
"0.5817443",
"0.58066255",
"0.57915413",
"0.57899785",
"0.5787178",
"0.5764153",
"0.5760341",
"0.5742855",
"0.5730925",
"0.570513",
"0.56828326",
"0.56747466",
"0.56747466",
"0.5673752",
"0.56436414",
"0.5607924",
"0.5597513",
"0.55965626",
"0.55927247",
"0.55917656",
"0.5583017",
"0.55779594",
"0.55757207",
"0.55731153",
"0.5572834",
"0.55448055",
"0.5541444",
"0.5531257",
"0.5520191",
"0.55171216",
"0.5499162",
"0.5498932",
"0.5497524",
"0.54934776",
"0.54680794",
"0.54661256",
"0.5443105",
"0.5441747",
"0.5440441",
"0.54347676",
"0.5429799",
"0.5427",
"0.5425898",
"0.5424003",
"0.5411729",
"0.54110485",
"0.54052985",
"0.54043436",
"0.53911895",
"0.53847414",
"0.5375858",
"0.5375145",
"0.5368804",
"0.5367063",
"0.53612983",
"0.5354725",
"0.5352832",
"0.53506786",
"0.5350164",
"0.5349774",
"0.5343684",
"0.5340705",
"0.53330207",
"0.5327669",
"0.5324807",
"0.53185785",
"0.5313986",
"0.5311543",
"0.53103316",
"0.5305511",
"0.5305483",
"0.5303174",
"0.5302151",
"0.53015393",
"0.5299396",
"0.529935",
"0.5291623",
"0.5291203",
"0.52889365",
"0.52812576",
"0.5279404",
"0.5278028",
"0.5273869",
"0.5269128",
"0.5268332"
] | 0.6716348 | 1 |
First delete all category assignments for this entry. | private function _save_category_posts($entry_id, $publisher_save_status, $categories = array())
{
ee()->db->where('publisher_status', $publisher_save_status)
->where('publisher_lang_id', ee()->publisher_lib->lang_id)
->where('entry_id', $entry_id)
->delete('publisher_category_posts');
/*
TODO? - On save, see if the entry has a row for the requested status/lang_id in publisher_titles
then we don't update the categories for that entry.
if no rows exist, then get the categories for the default language, then insert them for the
requested status/lang_id so it has records, thus sharing the same cats as the default lang.
requires new loop over each language with the same insert array.
*/
if ( !empty($categories))
{
foreach ($categories as $cat_id)
{
$data = array(
'cat_id' => $cat_id,
'entry_id' => $entry_id,
'publisher_status' => $publisher_save_status,
'publisher_lang_id' => ee()->publisher_lib->lang_id
);
ee()->db->insert('publisher_category_posts', $data);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function clearCategories() {\n $sql = \"DELETE FROM project_category WHERE project_id = %d\";\n $sql = sprintf($sql, $this->id);\n self::$connection->execute($sql);\n }",
"public function clearCategories() {\n\t\t$this->quizCategoriesTable->deleteWhere('quizId', $this->id);\n\t}",
"public function clearExpertCategorys()\n\t{\n\t\t$this->collExpertCategorys = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clearCategories()\n {\n $scenario = Scenarios::getOrCreateUserScenario();\n $scenario->categories()->detach();\n }",
"public function delete() {\n\t\t$this->assignment->delete();\n\t}",
"public function delete() {\n $sql = sprintf(\"DELETE FROM category WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }",
"public function clearGoogleCategoriesAction()\n {\n Mage::getSingleton('adminhtml/session')->setLatestSelectedGoogleCategoryId(NULL);\n Mage::getSingleton('adminhtml/session')->setLatestSelectedStoreCategoryId(NULL);\n Mage::getModel('googlemerchants/googlecategory')->truncateCategoriesTable();\n $this->_redirect('adminhtml/googlemerchants/downloadtxt');\n }",
"public function clearContributionss()\n {\n $this->collContributionss = null; // important to set this to NULL since that means it is uninitialized\n }",
"function clean_assignments_cache() {\n cache_remove_by_pattern('object_assignments_*');\n cache_remove_by_pattern('object_assignments_*_rendered');\n cache_remove_by_pattern('user_assignments_*');\n }",
"public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }",
"function removeFromForums()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete category assignments\r\n $db->query( \"DELETE FROM eZForum_ForumCategoryLink WHERE ForumID='$this->ID'\" );\r\n }",
"function smart_foundation_category_transient_flusher() {\n\t// Like, beat it. Dig?\n\tdelete_transient( 'smart_foundation_categories' );\n}",
"public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}",
"public function delete() {\n\t\t$sql = 'delete from cart_categories where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$sql = 'delete from cart_categories_description where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$cats = $this->getSubCategories();\n\t\tforeach ($cats as $cat) {\n\t\t\t$cat->delete();\n\t\t}\n\t}",
"function ppo_category_transient_flusher() {\n\t// Like, beat it. Dig?\n\tdelete_transient( 'ppo_category_count' );\n}",
"public function removeAllCategories()\n {\n return $this->unlinkAll('categories', true);\n }",
"public function refreshTables()\n {\n $em = $this->container->get('doctrine')->getManager();\n $repository = $this->container->get('doctrine')->getRepository('OpiferManualBundle:Category');\n $categories = $repository->findAll();\n\n foreach($categories as $category)\n {\n $em->remove($category);\n }\n $em->flush();\n }",
"public function removeAssignments()\n {\n return Yii::$app->authManager->revokeAll($this->user->id);\n }",
"public function clear_ids()\n\t{\n\t\tunset($this->_cat_ids);\n\t\t$this->_cat_ids = array();\n\t}",
"function recycle_forum_categories()\n\t{\n\t\t$table_forum = Database :: get_course_table(TABLE_FORUM);\n\t\t$table_forumcat = Database :: get_course_table(TABLE_FORUM_CATEGORY);\n\t\t$sql = \"SELECT fc.cat_id FROM \".$table_forumcat.\" fc LEFT JOIN \".$table_forum.\" f ON fc.cat_id=f.forum_category WHERE f.forum_id IS NULL\";\n\t\t$res = api_sql_query($sql,__FILE__,__LINE__);\n\t\twhile ($obj = mysql_fetch_object($res))\n\t\t{\n\t\t\t$sql = \"DELETE FROM \".$table_forumcat.\" WHERE cat_id = \".$obj->cat_id;\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}",
"public function tearDown() {\n $this->kb_category = KnowledgeBaseCategory::$categories_by_parent = KnowledgeBaseCategory::$categories = null;\n }",
"private function deletePendingAssignments()\n {\n $ids = $this->assignments->pluck('id')->toArray();\n $chunks = array_chunk($ids, 50000);\n foreach ($chunks as $chunk)\n {\n PendingDhcpAssignment::whereIn('id',$chunk)->delete();\n }\n }",
"public function clearPermissionsCollection(): void\n {\n $this->permissions = null;\n }",
"public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }",
"function circle_category_transient_flusher() {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\t// Like, beat it. Dig?\n\tdelete_transient( 'circle_categories' );\n}",
"public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }",
"public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}",
"public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }",
"public function index()\n {\n /*$categories=Category::withTrashed()->get();\n\n foreach($categories as $cat){\n $cat->deleted_at = null;\n $cat->save();\n }*/\n\n /*$categories=Category::find(1);\n $categories->delete();*/\n\n\n /* $categories=Category::all();\n\n\n foreach($categories as $cat){\n $cat->delete();\n }*/\n return view('admin.category.index');\n }",
"function ClearAllAssign()\n {\n $this->_smarty->clear_all_assign();\n }",
"public function DeleteGroupCategory() {\n\t\t\t$this->objGroupCategory->Delete();\n\t\t}",
"function delete_all()\n {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->procedure = 'POST_DELETE';\n\n\n /*if ($_SERVER['REQUEST_METHOD'] == 'POST') {*/\n for ($i = 0; $i < count($this->p_delete); $i++) {\n $this->Admin_model->package = 'POSTS_PKG';\n $this->Admin_model->delete($this->p_delete[$i]);\n //Modules::run('admin/Post_Categories/delete', $this->p_delete[$i]);\n }\n\n /* } else {\n redirect('admin/Posts/display_cat');\n }\n redirect('admin/Posts/display_cat');*/\n }",
"public function unsetAll() {\n\t\tparent::unsetAll();\n\t}",
"public function deletePermissions() {\n\t\t// delete group permissions\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_linklist_category_to_group\n\t\t\tWHERE\t\tcategoryID = \".$this->categoryID;\n\t\tWCF::getDB()->sendQuery($sql);\n\t}",
"public function cleanupNews() {\n\n $this->_useCategoryDatasource();\n $this->_useItemDatasource();\n\n // Delete old news items\n $this->_externalNewsItemDatasource->prune();\n\n // Identify non-permanent categories that haven't been updated in a while\n $unusedCategories = $this->_externalNewsCategoryDatasource->getPrunable();\n\n // Remove mapping links between agent users and old non-permanent categories\n $mappingDatasource = new Datasource_Cms_ExternalNews_CategoriesAgentsMap();\n $mappingDatasource->pruneByCategories($unusedCategories);\n\n // Remove old non-permanent categories\n $this->_externalNewsCategoryDatasource->prune();\n }",
"public function EliminarCategorias()\n\t{\n\n\t\t$sql = \" select codcategoria from productos where codcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from categorias where codcategoria = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codcategoria);\n\t\t\t$codcategoria = base64_decode($_GET[\"codcategoria\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: categorias?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: categorias?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}",
"function delivery_category_transient_flusher() {\n\t// Like, beat it. Dig?\n\tdelete_transient( 'delivery_categories' );\n}",
"public function remove() {\n if ( is_null( $this->id ) )\n return;\n\n $this->prepare(\n 'DELETE FROM `categories` WHERE `category_id` = :category_id OR `parent_category_id` = :parent_category_id'\n , 'ii'\n , array( ':category_id' => $this->id, ':parent_category_id' => $this->id )\n )->query();\n }",
"function delete(){\n // Renumber resolutions\n $resolutions = resolution::getResolutions($this->committeeId, $this->topicId);\n foreach($resolutions as $resolution){\n if($resolution->resolutionNum <= $this->resolutionNum)\n continue;\n $resolution->resolutionNum--;\n $resolution->saveInfo();\n }\n // Delete subclauses\n foreach($this->preambulatory as $clause){\n $clause->delete();\n }\n foreach($this->operative as $clause){\n $clause->delete();\n }\n // Delete resolution\n mysql_query(\"DELETE FROM resolution_list WHERE id='$this->resolutionId'\") or die(mysql_error());\n }",
"public function deleteAllByCategoryId($id)\n {\n return $this->deleteByColumn('category_Id', $id);\n }",
"public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }",
"function emc_category_transient_flusher() {\r\n\t// Like, beat it. Dig?\r\n\tdelete_transient( 'all_the_cool_cats' );\r\n}",
"public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}",
"public function cleanup() : void\n {\n unset($this->groups);\n }",
"public function remove_all_cat_field()\n\t{\n\t\t//Get logged in session admin id\n\t\t$user_id \t\t\t\t\t\t= ($this->session->userdata('user_id_hotcargo')) ? $this->session->userdata('user_id_hotcargo') : 1;\n\t\t$setting_data \t\t\t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t$data['data']['setting_data'] \t= $setting_data;\n\t\t$data['data']['settings'] \t\t= $this->sitesetting_model->get_settings();\n\t\t$data['data']['dealer_id'] \t\t= $user_id;\n\t\t\n\t\t//getting all admin data \n\t\t$data['myaccount_data'] \t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t\n\t\t\n\t\t//Get requested form type from url segment position 3\n\t\t$field_id \t\t\t\t\t= $this->uri->segment(3);\n\t\t\n\t\t//deleting query\n\t\t$this->mongo_db->where(array('form_type' => $field_id));\n\t\tif($this->mongo_db->delete_all('form_fields'))\n\t\t\t$this->session->set_flashdata('flash_message', 'info_deleted');\n\t\telse\n\t\t\t$this->session->set_flashdata('flash_message', 'info_delete_failed');\n\t\t\t\n\t\tredirect('control/data-forms');\n\t}",
"public function delete($delete_all = true): void\n {\n $query_lang = 'DELETE FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang '\n .'WHERE category_id = '. $this->category_id\n . ($delete_all ? '' : ' AND clang_id = '. $this->clang_id);\n $result_lang = \\rex_sql::factory();\n $result_lang->setQuery($query_lang);\n\n // If no more lang objects are available, delete\n $query_main = 'SELECT * FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang '\n .'WHERE category_id = '. $this->category_id;\n $result_main = \\rex_sql::factory();\n $result_main->setQuery($query_main);\n if (0 === $result_main->getRows()) {\n $query = 'DELETE FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n // reset priorities\n $this->setPriority(true);\n }\n\n // Don't forget to regenerate URL list and search_it index\n \\d2u_addon_backend_helper::generateUrlCache();\n\n // Delete from YRewrite forward list\n if (rex_addon::get('yrewrite')->isAvailable()) {\n if ($delete_all) {\n foreach (rex_clang::getAllIds() as $clang_id) {\n $lang_object = new self($this->category_id, $clang_id);\n $query_forward = 'DELETE FROM '. \\rex::getTablePrefix() .'yrewrite_forward '\n .\"WHERE extern = '\". $lang_object->getUrl(true) .\"'\";\n $result_forward = \\rex_sql::factory();\n $result_forward->setQuery($query_forward);\n }\n } else {\n $query_forward = 'DELETE FROM '. \\rex::getTablePrefix() .'yrewrite_forward '\n .\"WHERE extern = '\". $this->getUrl(true) .\"'\";\n $result_forward = \\rex_sql::factory();\n $result_forward->setQuery($query_forward);\n }\n }\n }",
"function recycle_link_categories()\n\t{\n\t\t$link_cat_table = Database :: get_course_table(TABLE_LINK_CATEGORY);\n\t\t$link_table = Database :: get_course_table(TABLE_LINK);\n\t\t$sql = \"SELECT lc.id FROM \".$link_cat_table.\" lc LEFT JOIN \".$link_table.\" l ON lc.id=l.category_id WHERE l.id IS NULL\";\n\t\t$res = api_sql_query($sql,__FILE__,__LINE__);\n\t\twhile ($obj = mysql_fetch_object($res))\n\t\t{\n\t\t\t$sql = \"DELETE FROM \".$link_cat_table.\" WHERE id = \".$obj->id;\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}",
"function pixelgrade_category_transient_flusher() {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\t// Like, beat it. Dig?\n\tdelete_transient( 'pixelgrade_categories' );\n}",
"public function deleteClean() {\n\n $id = $this->request->get('category_id');\n\n // check category valid\n $category = ApplicationCategory::find($id)->first();\n\n $next_id = $this->request->get('next_category_id');\n\n\n $category_next = ApplicationCategory::find($next_id)->first();\n\n // check if exists.\n\n DB::table('apps')\n ->where('category_id', $id)\n ->update(['category_id' => $next_id]);\n\n $category->delete();\n\n return redirect('/develop/categories');\n\n\n }",
"public function remove_assignments(){\n \n $this->load->model('assignment');\n $this->load->model('action');\n $this->load->model('micro_history_event');\n \n $request = array_pop($this->request->find(intval($this->input->post('request_id', true))));\n $operation = \"remove\";\n \n $assignments = json_decode($this->input->post('assignments'));\n \n foreach($assignments as $assignment){\n \n $assignment_info = array_pop($this->assignment->find($assignment->assignment_id));\n $action = $request->actionForAssignment($assignment_info);\n $this->micro_history_event->create(array(\n 'request_id'\t=> $request->id, \n 'actor_id'\t=> $this->data['user']->id, \n 'actor_name'\t=> $this->data['user']->name, \n 'event_type'\t=> $operation, \n 'identifier'\t=> 'action', \n 'value'\t\t=> $action->id, \n 'value_text'\t=> $action->toString()));\n\n if ($action->action === 'grant') {\n // delete no-longer-pending assignment\n $assignment_info->delete();\n }\n $action->delete(); \n }\n \n $total_pending_actions = $this->get_pending_actions($request, true);\n print json_encode(array(\"total_pending_actions\"=>$total_pending_actions));\n \n }",
"public function run()\n {\n DB::table('user_access_request_categories')->truncate();\n\n\t\tDB::statement(\"INSERT INTO user_access_request_categories (id, category) VALUES\t\n\t\t\t(1, 'PROGRAM'),\n (2, 'CONNECTIVITY');\");\n }",
"public function postCategoryMultiDelete(){\n\t\t$cat_ids = explode(',', Input::get('cat_ids'));\n\t\tif(count($cat_ids)){\n\t\t\ttry{\n\t\t\t\tforeach($cat_ids as $key => $value){\n\t\t\t\t\tif(!is_numeric($value))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t$category = ShiftCategory::find($value);\n\t\t\t\t\t$this->shift->deleteCategory($category);\n\t\t\t\t}\n\t\t\t\treturn Redirect::back()->with('success', 'Selected category deleted successfully');\n\t\t\t}catch(\\Exception $e){\n\t\t\t\treturn Redirect::back()->with('error', $e->getMessage());\n\t\t\t}\n\t\t}else\n\t\t\treturn Redirect::back()->with('error', 'One or more category required to be selected before delete');\n\t}",
"public function clearFileCats()\n {\n $this->collFileCats = null; // important to set this to null since that means it is uninitialized\n $this->collFileCatsPartial = null;\n\n return $this;\n }",
"private function clearCache($category)\n {\n Cache::flush();\n }",
"public function removeAll()\n\t{\n\t\t$this->clear();\n\n\t\t$this->values = array();\n\t}",
"public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }",
"public function deleting(assignment $assignment)\n {\n //code...\n }",
"public function massDestroy(Request $request)\n {\n if (! Gate::allows('categoria_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Categoria::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }",
"function categories_delete()\n{\n // Get database information\n $dbconn = xarDBGetConn();\n $xartable = xarDBGetTables();\n\n // Delete categories table\n $query = \"DROP TABLE \".$xartable['categories'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete links table\n $query = \"DROP TABLE \".$xartable['categories_linkage'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete categories ext privileges table\n $query = \"DROP TABLE \".$xartable['categories_ext_privileges'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete module variables\n// xarModDelVar('categories', 'bold');\n xarModDelVar('categories', 'catsperpage');\n\n // Remove module hooks\n if (!xarModUnregisterHook('item', 'new', 'GUI',\n 'categories', 'admin', 'newhook')) return;\n if (!xarModUnregisterHook('item', 'create', 'API',\n 'categories', 'admin', 'createhook')) return;\n if (!xarModUnregisterHook('item', 'modify', 'GUI',\n 'categories', 'admin', 'modifyhook')) return;\n if (!xarModUnregisterHook('item', 'update', 'API',\n 'categories', 'admin', 'updatehook'))return;\n if (!xarModUnregisterHook('item', 'delete', 'API',\n 'categories', 'admin', 'deletehook'))return;\n if (!xarModUnregisterHook('module', 'modifyconfig', 'GUI',\n 'categories', 'admin', 'modifyconfighook'))return;\n if (!xarModUnregisterHook('module', 'updateconfig', 'API',\n 'categories', 'admin', 'updateconfighook'))return;\n if (!xarModUnregisterHook('module', 'remove', 'API',\n 'categories', 'admin', 'removehook')) return;\n\n // UnRegister blocks\n if (!xarModAPIFunc('blocks', 'admin', 'unregister_block_type',\n array('modName' => 'categories',\n 'blockType'=> 'navigation'))) return;\n\n xarTplUnregisterTag('categories-navigation');\n xarTplUnregisterTag('categories-filter');\n xarTplUnregisterTag('categories-catinfo');\n /**\n * Remove instances and masks\n */\n\n // Remove Masks and Instances\n xarRemoveMasks('categories');\n xarRemoveInstances('categories');\n\n // Deletion successful\n return true;\n}",
"function remove_all_cat($id,$tab) \r\n{\r\n\t\r\n\t$qlist=hb_mysql_query(\"SELECT * FROM \".$tab.\" WHERE id='$id'\");\r\n\tif (hb_mysql_num_rows($qlist)>0) {\r\n\t\t\r\n\t\t while($curitem=hb_mysql_fetch_array($qlist)) \r\n\t\t {\r\n\t\t\t \r\n\t\t\t remove_all_cat($curitem['id'],$tab);\r\n\t\t \r\n\t\t }\r\n\t\r\n\t}\r\n\t\r\n\thb_mysql_query(\"DELETE FROM \".$tab.\" WHERE id='$id'\");\r\n}",
"public function delete_category()\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tTransaction is needed despite the one query as delete is on cascade\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query ( \"DELETE FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $this->con->affected_rows == 0 )\r\n\t\t\t{\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = CATEGORY_DONT_EXIST;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t}",
"public function delete_all()\n {\n }",
"function atarr_category_transient_flusher() {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn false;\n\t}\n\t// Like, beat it. Dig?\n\tdelete_transient( 'atarr_categories' );\n}",
"public function flush(): void\n {\n container()->get('dbal')->prepare('UPDATE `torrents` SET `category` = :new WHERE `category` = :old ')->bindParams([\n 'new' => $this->getInput('move_to'), 'old' => $this->getInput('id')\n ])->execute();\n\n // Delete it~\n container()->get('dbal')->prepare('DELETE FROM `categories` WHERE id = :id')->bindParams([\n 'id' => $this->getInput('id')\n ])->execute();\n\n // TODO flush Redis cache\n container()->get('redis')->del('site:enabled_torrent_category');\n }",
"function gravit_category_transient_flusher() {\r\r\n\t// Like, beat it. Dig?\r\r\n\tdelete_transient( 'all_the_cool_cats' );\r\r\n}",
"public function clearCategory()\n\t{\n\t\tProductInfo::updateByCriteria('active = ?', 'productId = ? and typeId = ? and entityName = ?', array(0, $this->getId(), ProductInfoType::ID_CATEGORY, ProductInfoType::ENTITY_NAME_CATEGORY));\n\t\treturn $this;\n\t}",
"public function cleanup()\n {\n if ($this->catalogRule != '-') {\n $this->deleteAllCatalogRule->run();\n }\n }",
"public function clear()\n {\n $this->_id = null;\n $this->_title = null;\n $this->_positions = [];\n $this->_isDefault = null;\n }",
"public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }",
"private function delCategory($idx) {\n \t$query = Category::find()->where('ID != 1 && PARENTID='.$idx)->all();\n \tforeach($query as $items) {\n \t\t$this->delCategory($items['ID']);\n \t}\n\n \t$Postmodel = Products::findAll(['CATEGORYID'=>$idx]);\n \tforeach($Postmodel as $items) {\n \t\t$items->CATEGORYID = 0;\n \t\t$items->save();\n \t}\n \t$this->findModel_category($idx)->delete();\n }",
"function root_category_transient_flusher() {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n\t\treturn;\n\t}\n\t// Like, beat it. Dig?\n\tdelete_transient( 'root_categories' );\n}",
"protected function _deleteExistingRules()\n\t{\n\t\t$rulecollection = $this->_rulecollectionFactory->create();\n\t\tforeach($rulecollection as $rule):\n\t\t\t$rule->delete();\n\t\tendforeach;\t\t\n\t}",
"public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }",
"public static function gc()\n {\n Dba::write('DELETE FROM `album` USING `album` LEFT JOIN `song` ON `song`.`album` = `album`.`id` WHERE `song`.`id` IS NULL');\n }",
"protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }",
"public function reSetEntriesCount()\n\t{\n\t\t$criteria = KalturaCriteria::create(categoryEntryPeer::OM_CLASS);\n\t\t$criteria->addAnd(categoryEntryPeer::CATEGORY_FULL_IDS, $this->getFullIds() . '%', Criteria::LIKE);\n\t\t$count = categoryEntryPeer::doCount($criteria);\n\n\t\t$this->setEntriesCount($count);\n\t}",
"function sb_assignment_delete ($node) {\n\n db_query(\"DELETE FROM {eto_assignments}\n WHERE \" . $node->key_field . \" = %d AND \" . $node->target_field . \" = %d\",\n\t $node->uid, $node->selected_uid);\n\n}",
"function delete()\r\n {\r\n $sub_categories =& eZCompanyType::getByParentID( $this->ID );\r\n foreach ( $sub_categories as $category )\r\n {\r\n $category->delete();\r\n }\r\n $top_category = new eZCompanyType( 0 );\r\n $companies =& eZCompany::getByCategory( $this->ID );\r\n foreach ( $companies as $company )\r\n {\r\n $company->removeCategories();\r\n $top_category->addCompany( $company );\r\n }\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n $res[] = $db->query( \"DELETE FROM eZContact_CompanyType WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n }",
"public function clear()\n {\n $this->feature_cvterm_id = null;\n $this->feature_id = null;\n $this->cvterm_id = null;\n $this->pub_id = null;\n $this->is_not = null;\n $this->rank = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }",
"public function resetValues(){\n $this->categoryFingerprints = null;\n //$this->threshold=35;\n\n }",
"public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }",
"public function clearDocCats()\n {\n $this->collDocCats = null; // important to set this to null since that means it is uninitialized\n $this->collDocCatsPartial = null;\n\n return $this;\n }",
"public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }",
"public static function removeAll(){\n\n foreach(static::all() as $key => $value){\n static::remove($key);\n }\n }",
"function deleteCategoryMeta($cat_id) {\n\t\t$course_meta = new CourseMeta($cat_id);\n\t\t$course_meta->delete();\n\t}",
"public function clear(): void\n {\n $this->items = collect();\n\n $this->save();\n }",
"public function clearExperts()\n\t{\n\t\t$this->collExperts = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }",
"public function clearPostDailyStatss()\n\t{\n\t\t$this->collPostDailyStatss = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}",
"abstract public function deleteAll();",
"public function clear()\n {\n if (null !== $this->aCakeType) {\n $this->aCakeType->removeArticle($this);\n }\n if (null !== $this->aShape) {\n $this->aShape->removeArticle($this);\n }\n $this->article_id = null;\n $this->description = null;\n $this->price = null;\n $this->creation = null;\n $this->visible = null;\n $this->shape_id = null;\n $this->cake_type_id = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }",
"private function resetAll()\n {\n $this->title = null;\n $this->caption = null;\n $this->categories = null;\n $this->image = null;\n $this->tags = null;\n $this->imagePath = null;\n $this->postId = null;\n }",
"public function massDestroy(Request $request)\n {\n if (!Gate::allows('lesson_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Assignment::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }",
"protected function clearAllPersistentData()\n {\n foreach ($this->_sessionNamespace as $key => $value) {\n unset($this->_sessionNamespace->{$key});\n }\n }",
"public function delall()\n {\n }",
"public function clearConcepts()\n {\n foreach ($this->relationships as $relationship) {\n $relationship->clearConcepts();\n }\n }",
"public function destroy(int $id)\n {\n $category = $this->category_model->findOrFail($id);\n $posts = $category->posts;\n\n if ($posts->count() > 0) {\n foreach ($posts as $post) {\n $post->update([\n 'category_id' => (int) self::CATEGORY_ID_OF_UNCATEGORIZED,\n ]);\n }\n }\n\n if ($id !== (int) self::CATEGORY_ID_OF_UNCATEGORIZED) {\n $category = $category->delete();\n }\n\n return [];\n }",
"public function deletes_category(){\n $ids = $this->input->post('checkone');\n foreach($ids as $id)\n {\n $this->delete_color_once($id);\n }\n\t\t$this->session->set_flashdata(\"mess\", \"Xóa thành công!\");\n redirect($_SERVER['HTTP_REFERER']);\n }",
"function ciniki_directory_categoryDelete(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}",
"public function testDeleteCategory()\n {\n $category = new Category();\n\n Yii::$app->db->createCommand('set foreign_key_checks=0')->execute();\n $category->setAttributes(['name' => 'name','class' => 'active','featured_campaign_id' => 1]);\n $category->save(false);\n $this->tester->canSeeRecord('backend\\models\\Category',array('name' => 'name','class' => 'active','featured_campaign_id' => 1));\n $category->delete();\n $this->assertFalse($category == null);\n Yii::$app->db->createCommand('set foreign_key_checks=1')->execute();\n }"
] | [
"0.65797263",
"0.648564",
"0.6411816",
"0.6224246",
"0.61792797",
"0.586514",
"0.58278584",
"0.5687127",
"0.5651581",
"0.56162715",
"0.5612332",
"0.55711657",
"0.55596244",
"0.5538181",
"0.55321044",
"0.54771346",
"0.5421295",
"0.5410044",
"0.5398949",
"0.5396658",
"0.53953326",
"0.5381417",
"0.5327047",
"0.5321832",
"0.53091127",
"0.5291197",
"0.5289851",
"0.5287761",
"0.5287271",
"0.52860546",
"0.52704775",
"0.5268416",
"0.52545476",
"0.5244667",
"0.5240762",
"0.5231585",
"0.5213616",
"0.52021265",
"0.51839393",
"0.51519984",
"0.5145771",
"0.514363",
"0.51319885",
"0.51242566",
"0.5112845",
"0.5112408",
"0.51038027",
"0.51017946",
"0.50938326",
"0.5090717",
"0.5088",
"0.508688",
"0.50855464",
"0.50821525",
"0.5079323",
"0.5069682",
"0.5057637",
"0.5048761",
"0.5048749",
"0.50481576",
"0.5048094",
"0.5044365",
"0.5030627",
"0.50256014",
"0.502508",
"0.50218755",
"0.50125873",
"0.5009754",
"0.5003241",
"0.5001175",
"0.49967742",
"0.4996112",
"0.49945062",
"0.4981403",
"0.49809858",
"0.49766022",
"0.49328557",
"0.49328074",
"0.49265274",
"0.49263486",
"0.49238664",
"0.49200553",
"0.49152112",
"0.4902225",
"0.4885593",
"0.48843217",
"0.48819554",
"0.48806605",
"0.48715627",
"0.48678505",
"0.48513702",
"0.48510814",
"0.48488858",
"0.48444518",
"0.48421657",
"0.4841286",
"0.4841108",
"0.48387906",
"0.48381743",
"0.48354492",
"0.48348418"
] | 0.0 | -1 |
Handle multi_entry_category_update. There is no hook in EE so we only trigger this if the $_POST is correct. Thanks to Mark Croxton for contributing this. | public function multi_entry_category_update()
{
// Does the user have permission?
if ( !ee()->publisher_helper->allowed_group('can_access_content'))
{
show_error(lang('unauthorized_access'));
}
$entries = ee()->input->post('entry_ids', TRUE);
$cat_ids = ee()->input->post('category', TRUE);
$type = ee()->input->post('type', TRUE);
$entry_ids = array();
if ( !$entries || !$type)
{
show_error(lang('unauthorized_to_edit'));
}
if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))
{
return ee()->output->show_user_error('submission', lang('no_categories_selected'));
}
// For the entries affected, sync publisher_category_posts to category_posts
foreach (explode('|', trim($entries)) as $entry_id)
{
$entry_ids[] = $entry_id;
}
// default states
$default_language_id = ee()->publisher_model->default_language_id;;
$default_view_status = ee()->publisher_setting->default_view_status();
$states = array();
foreach($entry_ids as $entry_id)
{
// we'll always have a state for the default language and status
$states = array(array(
'publisher_lang_id' => $default_language_id,
'publisher_status' => $default_view_status
));
if ($type == 'add')
{
// Adding categories
// ----------------------------------------------------------------
// We want to add categories to all the open and draft versions
// of an entry without changing existing category selections
// for each entry, look up existing distinct states
$query = ee()->db->distinct()
->select('publisher_lang_id, publisher_status')
->where('entry_id', $entry_id)
->get('publisher_titles');
if ($query->num_rows() > 0)
{
$result = $query->result_array();
foreach($result as $row)
{
if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))
{
$states[] = array(
'publisher_lang_id' => $row['publisher_lang_id'],
'publisher_status' => $row['publisher_status']
);
}
}
}
// build an an array of records to insert into publisher_category_posts
$data = array();
foreach($states as $state)
{
// add the new categories
foreach($cat_ids as $cat_id)
{
$data[] = array(
'entry_id' => $entry_id,
'cat_id' => $cat_id,
'publisher_lang_id' => $state['publisher_lang_id'],
'publisher_status' => $state['publisher_status']
);
}
}
// delete any relationships with the newly added categories that already exist
// for this entry so that we don't end up with duplicate rows
ee()->db->where('entry_id', $entry_id)
->where_in('cat_id', $cat_ids)
->delete('publisher_category_posts');
// (re)insert the categories with the appropriate states
ee()->db->insert_batch('publisher_category_posts', $data);
}
elseif($type == 'remove')
{
// Removing categories
// ----------------------------------------------------------------
// we're simply removing the selected categories from all versions of the entry
ee()->db->where('entry_id', $entry_id)
->where_in('cat_id', $cat_ids)
->delete('publisher_category_posts');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}",
"public function postCategoryMultiUpdate(){\n\t\t$selected_items_id = Input::get('id');\n\t\t$selected_item_color_id = Input::get('shift_category_color_id');\n\t\t$messages = new MessageBag();\n\t\t\n\t\tforeach($selected_items_id as $key => $value){\n\t\t\tif(isset($selected_item_color_id[$key])){\n\t\t\t\ttry{\n\t\t\t\t\t$category = ShiftCategory::find($value);\n\t\t\t\t\t$category->shift_category_color_id = $selected_item_color_id[$key];\n\t\t\t\t\t$this->shift->saveCategory($category);\n\t\t\t\t}catch(\\Exception $e){\n\t\t\t\t\t$messages->add('error', $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif($messages->count())\n\t\t\treturn Redirect::back()->withErrors($messages);\n\t\telse\n\t\t\treturn Redirect::to($this->_adminPrefix. '/shifts/category-list')->with('success', 'Selected categories updated successfully');\t\n\t}",
"public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }",
"function wp_update_category($catarr)\n {\n }",
"function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}",
"function update_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}",
"public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}",
"function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}",
"public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}",
"public function executeAddCategoryUpdate(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/updatePost-' . $request->postData('postId'));\n\n }",
"public function testUpdateItemSubCategory()\n {\n }",
"function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}",
"public function update($product_category_id)\n\t{\n\t\t$master['status'] = True;\n $data = array();\n $master = array();\n $original_category_name=$this->db->from('tbl_product_category')->where('category_id',$product_category_id)->get()->result();\n $is_unique='';\n if($this->input->post('category')!=$original_category_name[0]->category)\n {\n \t$is_unique = '|is_unique[tbl_product_category.category]';\n }\n\n $this->form_validation->set_rules('category', 'Category', 'trim|required|max_length[64]'.$is_unique);\n $this->form_validation->set_rules('remarks', 'Remarks', 'trim|max_length[254]');\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\">', '</p>');\n\t\tif ($this->form_validation->run() == True) \n\t\t{\n\t\t\t$this->product_category->update($product_category_id);\n\t\t\t$master['status'] = True;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$master['status'] = false;\n foreach ($_POST as $key => $value) \n {\n if (form_error($key) != '') \n {\n $data['error_string'] = $key;\n $data['input_error'] = form_error($key);\n array_push($master, $data);\n }\n }\n\t\t}\n\t\techo(json_encode($master));\n\t}",
"public function save_category_posts($entry_id, $meta, $data)\n {\n $categories = array();\n\n // Channel:Form/Safecracker\n if (isset($data['categories']))\n {\n $categories = $data['categories'];\n }\n // Normal Entry Save\n elseif (isset($data['revision_post']['category']))\n {\n $categories = $data['revision_post']['category'];\n }\n\n $publisher_save_status = ee()->input->post('publisher_save_status');\n\n // Insert new categories.\n $this->_save_category_posts($entry_id, $publisher_save_status, $categories);\n\n // If option is enabled, and saving as open, delete drafts and save new draft rows too.\n if(\n $publisher_save_status == PUBLISHER_STATUS_OPEN &&\n ee()->publisher_setting->sync_drafts()\n ){\n $this->_save_category_posts($entry_id, 'draft', $categories);\n }\n\n // Get open records, and re-insert them into category_posts, otherwise\n // we get draft category assignments added to the core table.\n if(\n $publisher_save_status == PUBLISHER_STATUS_DRAFT &&\n ($categories = $this->get_category_posts($entry_id, PUBLISHER_STATUS_OPEN))\n ){\n // First delete all category assignments for this entry.\n ee()->db->where('entry_id', $entry_id)\n ->delete('category_posts');\n\n foreach ($categories as $category)\n {\n $data = array(\n 'cat_id' => $category,\n 'entry_id' => $entry_id\n );\n\n $qry = ee()->db->where($data)->get('category_posts');\n\n if ($qry->num_rows() == 0)\n {\n ee()->db->insert('category_posts', $data);\n }\n }\n }\n }",
"public function update($postArray)\n {\n $params = BaseMtc_membership_category::getParams();\n return $this->updateRow($postArray, $params);\n }",
"public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }",
"public function updatecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n // copy all entries from $args to $obj that are found in the categories table\n // this prevents possible SQL errors if non existing keys are passed to this function\n $ztables = DBUtil::getTables();\n $obj = array();\n foreach ($args as $key => $arg) {\n if (array_key_exists($key, $ztables['dizkus_categories_column'])) {\n $obj[$key] = $arg;\n }\n }\n \n if (isset($obj['cat_id'])) {\n $obj = DBUtil::updateObject($obj, 'dizkus_categories', null, 'cat_id');\n return true;\n }\n \n return false;\n }",
"function bvt_sfa_feed_admin_screen() {\n\n // TODO: Break this function down into smaller bits?\n\n global $wpdb;\n\n $submit_flag = \"bvt_sfa_feed_admin_form\";\n\n $categories = bvt_sfa_feed_admin_get_categories();\n\n if (isset($_POST[$submit_flag]) && $_POST[$submit_flag] == 'Y') {\n\n $errors = false;\n\n // Postback; save feed settings...\n\n foreach ($categories as $category) {\n\n if ($_POST['bvt_sfa_catfeed'][$category->cat_ID]) {\n\n // ...only for categories actually submitted\n\n $new_values = $_POST['bvt_sfa_catfeed'][$category->cat_ID];\n\n $sql = $wpdb->prepare(\"\n INSERT INTO \" . BVT_SFA_DB_FEED_TABLE . \" (\n category_id,\n feed_url,\n postrank_url,\n cache_time\n )\n VALUES (\n %d,\n %s,\n %s,\n %d\n )\n ON DUPLICATE KEY UPDATE\n feed_url = %s,\n postrank_url = %s,\n cache_time = %d\",\n $category->cat_ID,\n $new_values['feed_url'],\n $new_values['postrank_url'],\n $new_values['cache_time'],\n $new_values['feed_url'],\n $new_values['postrank_url'],\n $new_values['cache_time']\n );\n }\n\n if ($wpdb->query($sql) === FALSE) {\n\n echo '\n <div class=\"error\">\n <p>\n <strong>Error saving settings!</strong>\n It was not possible to save feed settings for feed ID\n ' . htmlspecialchars($category->cat_ID) . '. Error: ';\n $wpdb->print_error();\n echo '</p></div>';\n\n $errors = true;\n }\n }\n\n // Save static content\n\n update_option(\n \"BVT_SFA_FEED_INTRO_HEADING\",\n $_POST[\"bvt_sfa_feed_intro_heading\"]\n );\n\n update_option(\n \"BVT_SFA_FEED_INTRO_BODY\",\n $_POST[\"bvt_sfa_feed_intro_body\"]\n );\n\n update_option(\n \"BVT_SFA_FEED_INTRO_BODY_HOMEPAGE\",\n $_POST[\"bvt_sfa_feed_intro_body_homepage\"]\n );\n\n // Save advanced settings\n\n update_option(\n \"BVT_SFA_TOPICS_CATEGORY_ID\",\n $_POST[\"bvt_sfa_topics_category_id\"]\n );\n\n update_option(\n \"BVT_SFA_METRICS_ITEMS\",\n str_replace(\" \", \"\", strtolower($_POST[\"bvt_sfa_metrics_items\"]))\n // remove spaces, set to lowercase\n );\n\n if (!$errors) {\n echo '<div class=\"updated\"><p><strong>Success.</strong>\n New settings saved.</p></div>';\n }\n\n // Re-get categories, since the parent category might have changed\n\n $categories = bvt_sfa_feed_admin_get_categories();\n }\n\n // Read config from DB\n\n foreach ($categories as $category) {\n\n $sql = $wpdb->prepare(\"\n SELECT\n category_id,\n feed_url,\n postrank_url,\n last_update,\n cache_time\n FROM\n \" . BVT_SFA_DB_FEED_TABLE . \"\n WHERE\n category_id = %d\",\n $category->cat_ID\n );\n\n // Merge config with list of categories\n\n if ($result = $wpdb->get_row($sql)) {\n\n $category->feed_url = $result->feed_url;\n $category->postrank_url = $result->postrank_url;\n $category->cache_time = $result->cache_time;\n $category->last_update =\n ($result->last_update == \"0000-00-00 00:00:00\") ?\n \"Never\" :\n $result->last_update;\n }\n else {\n\n $category->feed_url = \"\";\n $category->postrank_url = \"\";\n $category->cache_time = BVT_SFA_FEED_CACHE_TIME;\n $category->last_update = \"Never\";\n }\n }\n\n // Output form\n\n ?>\n\n <div class=\"wrap\">\n <form method=\"post\" action=\"\">\n\n <input type=\"hidden\" name=\"<?php echo $submit_flag; ?>\" value=\"Y\" />\n\n <h2>PostRank Feed Seetings</h2>\n\n <h3>Subject feeds</h3>\n\n <table class=\"widefat\">\n <thead>\n <tr>\n <th>Subject title</th>\n <th>Feed URL</th>\n <th>PostRank URL</th>\n <th>Cache time (seconds)</th>\n <th>Last updated</th>\n </tr>\n </thead>\n\n <tbody>\n\n <?php foreach ($categories as $category) { ?>\n\n <tr>\n\n <td><?php echo htmlspecialchars($category->name) ?></td>\n <td>\n <input\n type=\"text\"\n style=\"width: 100%;\"\n value=\"<?php echo htmlspecialchars($category->feed_url) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][feed_url]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][feed_url]\" />\n </td>\n <td>\n <input\n type=\"text\"\n style=\"width: 100%;\"\n value=\"<?php echo htmlspecialchars($category->postrank_url) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][postrank_url]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][postrank_url]\" />\n </td>\n <td>\n <input\n type=\"text\"\n value=\"<?php echo htmlspecialchars($category->cache_time) ?>\"\n name=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][cache_time]\"\n id=\"bvt_sfa_catfeed[<?php echo $category->cat_ID ?>][cache_time]\" />\n </td>\n <td>\n <?php echo htmlspecialchars($category->last_update) ?>\n </td>\n\n </tr>\n\n <?php } ?>\n\n </tbody>\n </table>\n\n\n <h3>Static content</h3>\n\n <p>Please note that HTML is not allowed in these fields.</p>\n\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_heading\">Intro heading</label>\n </th>\n <td>\n <input\n style=\"width: 47.5%;\"\n type=\"text\"\n value=\"<?php echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_HEADING\")); ?>\"\n name=\"bvt_sfa_feed_intro_heading\"\n id=\"bvt_sfa_feed_intro_heading\" />\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_body_homepage\">\n Intro text (home page)\n </label>\n </th>\n <td>\n <textarea\n style=\"width: 95%; height: 7em;\"\n name=\"bvt_sfa_feed_intro_body_homepage\"\n id=\"bvt_sfa_feed_intro_body_homepage\"><?php\n echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_BODY_HOMEPAGE\"));\n ?></textarea>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_feed_intro_body\">\n Intro text (category pages)\n </label>\n <p><em>Note</em>: The text \"<strong>[category]</strong>\" will be\n replaced with the current category name.</p>\n </th>\n <td>\n <textarea\n style=\"width: 95%; height: 7em;\"\n name=\"bvt_sfa_feed_intro_body\"\n id=\"bvt_sfa_feed_intro_body\"><?php\n echo htmlspecialchars(get_option(\"BVT_SFA_FEED_INTRO_BODY\"));\n ?></textarea>\n </td>\n </tr>\n </tbody>\n </table>\n\n <h3>Advanced settings</h3>\n\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_topics_category_id\">\n Parent category for subjects\n </label>\n </th>\n <td>\n <?php\n wp_dropdown_categories(array(\n \"exclude\" => 1, /* 1 is \"Uncategorized\" */\n \"hide_empty\" => false,\n \"hierarchical\" => 1,\n \"name\" => \"bvt_sfa_topics_category_id\",\n \"selected\" => get_option('bvt_sfa_topics_category_id')\n ));\n ?>\n </td>\n </tr>\n <tr>\n <th scope=\"row\">\n <label for=\"bvt_sfa_metrics_items\">\n PostRank metrics to display\n </label>\n </th>\n <td>\n <input\n style=\"width: 47.5%;\"\n type=\"text\"\n value=\"<?php echo htmlspecialchars(get_option(\"BVT_SFA_METRICS_ITEMS\")); ?>\"\n name=\"bvt_sfa_metrics_items\"\n id=\"bvt_sfa_metrics_items\" />\n <p>Comma-separated list of data IDs. Available IDs include:\n delicious, brightkite, reddit_comments, reddit_votes, views,\n identica, google, diigo, clicks, blip, digg, bookmarks,\n twitter, jaiku, tumblr, ff_likes, ff_comments, comments. These are\n <a href=\"http://www.postrank.com/postrank#sources\">described by\n PostRank</a>.</p>\n </td>\n </tr>\n </tbody>\n </table>\n\n <p class=\"submit\">\n <input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n </p>\n\n </form>\n </div>\n\n <?php\n}",
"function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}",
"function submit(){\n\t$parent_category = $this->uri->segment(4);\n\tif (!is_numeric($parent_category)){\n\t\t$parent_category = 0;\n\t}\n\n\t$this->form_validation->set_rules('category_name', 'Category Name', 'required');\n\n\tif ($this->form_validation->run() == FALSE){\n\t\t$this->create();\n\t} else {\n\n\t\t$update_id = $this->uri->segment(3);\n\n\t\tif ($update_id > 0){\n\t\t\t//This is an update\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$this->update($update_id, $data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully updated.</p>\";\n\t\t\t$parent_category = $update_id;\n\t\t} else {\n\t\t\t//Create new record\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$data['parent_category'] = $parent_category;\n\t\t\t$this->insert($data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully created.</p>\";\n\t\t\t$update_id = $this->get_max();\n\n\t\t\t$this->session->set_flashdata('category', $value);\n\t\t\t\n\t\t}\n\t\t//add flashdata\n\t\t$this->session->set_flashdata('category', $value);\t\n\n\t\tredirect ('store_categories/manage/'.$parent_category);\n\t\t\n\t}\n}",
"public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }",
"function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}",
"function multi_categories_edit($type, $query)\n {\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n \n \tif ($query->num_rows() == 0)\n {\n show_error($this->lang->line('unauthorized_to_edit'));\n }\n\n\t\t$this->load->helper('form');\n \n\t\t/** -----------------------------\n\t\t/** Fetch the cat_group\n\t\t/** -----------------------------*/\n\t\t\n\t\t/* Available from $query:\tentry_id, channel_id, author_id, title, url_title, \n\t\t\t\t\t\t\t\t\tentry_date, dst_enabled, status, allow_comments, \n\t\t\t\t\t\t\t\t\tsticky\n\t\t*/\n\n\t\t$sql = \"SELECT DISTINCT cat_group FROM exp_channels WHERE channel_id IN(\";\n\t\t\n\t\t$channel_ids = array();\n\t\t$entry_ids = array();\n\t\t\n\t\tforeach ($query->result_array() as $row)\n\t\t{\n\t\t\t$channel_ids[] = $row['channel_id'];\n\t\t\t$entry_ids[] = $row['entry_id'];\n\t\t\t\n\t\t\t$sql .= $row['channel_id'].',';\n\t\t}\n\t\t\n\t\t$group_query = $this->db->query(substr($sql, 0, -1).')');\n\t\t\n\t\t$valid = 'n';\n\t\t\n\t\tif ($group_query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $group_query->row('cat_group'));\n\t\t\t\n\t\t\tforeach($group_query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\t\t\t\t\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\tshow_error($this->lang->line('no_category_group_match'));\n\t\t}\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\t\t$this->api_channel_categories->category_tree(($cat_group = implode('|', $valid_cats)));\n\t\t//print_r($this->api_channel_categories->categories);\n\t\t$vars['cats'] = array();\n\t\t$vars['message'] = '';\n\t\t\n\t\tif (count($this->api_channel_categories->categories) == 0)\n\t\t{ \n\t\t\t$vars['message'] = $this->lang->line('no_categories');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// @confirm this is how we want to handle passing it to the view\n\t\t\t//$vars['cats'] = $this->api_channel_categories->categories;\n\t\t\t\n\t\t\tforeach ($this->api_channel_categories->categories as $val)\n\t\t\t{\n\t\t\t\t\t$vars['cats'][$val['3']][] = $val;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vars['edit_categories_link'] = FALSE; //start off as false, meaning user does not have privs\n\n\t\t\n\t\t$link_info = $this->api_channel_categories->fetch_allowed_category_groups($cat_group);\n\t\t\n\t\t// @todo- this kinda sucks, but I'm going to output the whole string for now\n\t\t\n\t\t$links = FALSE;\n\t\tif ($link_info !== FALSE)\n\t\t{\n\t\t\t// @todo needs reworking. If you include the z it throws an error because that triggers an include of cp.publish.\n\t\t\t// Without the z the permissions may not be working as per 1.6. \n\n\t\t\tforeach ($link_info as $val)\n\t\t\t{\n\t\t\t\t$links[] = array('url' => BASE.AMP.'C=admin_content'.AMP.'M=category_editor'.AMP.'group_id='.$val['group_id'],\n\t\t\t\t\t'group_name' => $val['group_name']); \t\n\t\t\t}\n\t\t}\n\n\t\t$vars['edit_categories_link'] = $links;\n\n\t\t$this->cp->set_breadcrumb(BASE.AMP.'C=content_edit', $this->lang->line('edit'));\n\n\t\t$vars['form_hidden'] = array();\n\t\t$vars['form_hidden']['entry_ids'] = implode('|', $entry_ids);\n\t\t$vars['form_hidden']['type'] = $type;\n\n\t\t$vars['type'] = $type;\n\t\n\t\t$this->cp->set_variable('cp_page_title', $this->lang->line('multi_entry_category_editor'));\n\n\t\t$this->javascript->compile();\n\t\t$this->load->view('content/multi_cat_edit', $vars);\n\t}",
"function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}",
"function pre_contact_update($post_id, $data) {\n\n // Check if user has permissions to save data.\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n\n // Check if not an autosave.\n if ( wp_is_post_autosave( $post_id ) ) {\n return;\n }\n\n // Check if not a revision.\n if ( wp_is_post_revision( $post_id ) ) {\n return;\n }\n\n if (!empty($_POST) && $data['post_type'] == 'contact') {\n // get category info first because we can cut processing short if there are no categories to deal with\n $old_cats = wp_get_post_categories($post_id);\n $cats = !empty($_POST['post_category']) ? array_filter($_POST['post_category']) : array();\n if (empty($old_cats) && empty($cats)) return;\n\n // get the rest of the old contact data\n $old_name = get_the_title($post_id);\n $old_email = get_post_meta($post_id, 'email', true);\n\n // and the new\n $email = $first_name = $last_name = '';\n foreach ($_POST['fields'] as $name => $value) {\n $field = get_field_object($name);\n switch ($field['name']) {\n case 'email':\n $email = sanitize_text_field($value);\n break;\n case 'first_name':\n $first_name = sanitize_text_field($value);\n break;\n case 'last_name':\n $last_name = sanitize_text_field($value);\n break;\n }\n }\n $name = get_full_name($first_name, $last_name);\n\n // get the categories to add and delete\n $to_add = array_diff($cats, $old_cats);\n $to_delete = array_diff($old_cats, $cats);\n\n // if categories weren't changed by email or name were changed, we still want to update the lists\n $updated_email = !empty($old_email) && $old_email != $email; // !empty($old_email) tells us if this is a new post or an edit\n $updated_name = !empty($old_email) && $old_name != $name; // !empty($old_email) tells us if this is a new post or an edit\n if (empty($to_add) && !empty($cats) && ($updated_email || $updated_name)) {\n $to_add = $cats;\n }\n\n if (!empty($to_add)) {\n // add this contact to each list\n foreach ($to_add as $cat_id) {\n // if email was changed, we need to remove the old email\n if ($updated_email) {\n delete_contact_from_list($cat_id, $old_email);\n }\n add_contact_to_list($cat_id, $email, $name);\n }\n }\n if (!empty($to_delete)) {\n // remove this contact from each list\n foreach ($to_delete as $cat_id) {\n delete_contact_from_list($cat_id, $old_email);\n }\n }\n }\n}",
"protected function _postUpdate()\n\t{\n\t}",
"function process_edit_category($parent_id, $title, $alias, $description, $date_add, $date_modify, $enabled, $id){\n\t\t $sql = \" Update category SET\n\t\t\t\t\t `parent_id` = ?, \n\t\t\t\t\t `title` = ?, \n\t\t\t\t\t `alias` = ?, \n\t\t\t\t\t `description` = ?, \n\t\t\t\t\t `date_add` = ?, \n\t\t\t\t\t `date_modify` = ?, \n\t\t\t\t\t `enabled` = ?\n\t\t\t\t WHERE cat_id = ?\";\n\t\t if($this->dbObj->SqlQueryInputResult($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($title), $alias, $description, $date_add, $date_modify, $enabled, $id)) <> FALSE){\n\t\t\t return true;\n\t\t }\n\t }",
"function wlms_book_categories_save()\n{\n global $wpdb;\n $name = \"\";\n \n $name = trim( $_POST['wlms_book_categories_name'] );\n $errors = array();\n\n if (strlen($name) == 0)\n {\n array_push( $errors, \"book_cat\" );\n }\n\n\n if( count($errors) == 0 )\n {\n $nonce = $_REQUEST['_wpnonce'];\n if ( ! wp_verify_nonce( $nonce, 'submit_books_categories' ) ) \n {\n exit; \n }\n\n // books categories save\n $id = 0;\n if(isset ($_POST['wlms_save_book_categories']))\n {\n $wpdb->query( $wpdb->prepare( \n \"\n INSERT INTO {$wpdb->prefix}wlms_book_categories\n ( name, status )\n VALUES ( %s, %d )\n \", \n array(\n $_POST['wlms_book_categories_name'], \n $_POST['wlms_book_cat_status']\n ) \n ) );\n \n $id = $wpdb->insert_id;\n set_message_key('item_saved', 'saved');\n }\n \n \n //update books categories\n if(isset ($_POST['wlms_update_book_categories']))\n {\n $request_id = 0;\n if ( is_numeric( $_GET['update_id'] ) ) {\n $request_id = absint( $_GET['update_id'] );\n $id = $request_id;\n }\n \n $wpdb->query(\n $wpdb->prepare(\n \"UPDATE {$wpdb->prefix}wlms_book_categories SET name = %s, status = %d WHERE id= %d\",\n $_POST['wlms_book_categories_name'], $_POST['wlms_book_cat_status'], $request_id\n )\n );\n \n set_message_key('item_updated', 'updated');\n }\n \n \n wp_redirect( esc_url_raw( add_query_arg( array( 'update_id' => $id ), admin_url( 'admin.php?page=wlms-pages&wlms-tab=wlms-book-categories&manage=add-book-categories' ) ) ) ); exit;\n }\n \n}",
"function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}",
"public function updatePost() {\n // strip_tags to secure input fields from inserting harmful code to database.\n \n $id = $_POST[\"single_post_id_update\"];\n $image = $_FILES[\"image\"];\n $title = strip_tags($_POST[\"title\"]);\n $content = strip_tags($_POST[\"content\"]);\n $id_category = $_POST[\"category_list\"];\n foreach($id_category as $key => $value) {\n $id_category = $value;\n\n }\n\n // If no image has been selected, choose the existing one to upload.\n if (empty($image[\"tmp_name\"])) {\n $new_location = $_POST[\"existing_image\"];\n $update_post = true;\n \n // Else upload new image.\n } else {\n $temporary_location = $image[\"tmp_name\"];\n $new_location = \"../images/uploads/\" . $image[\"name\"];\n $update_post = move_uploaded_file($temporary_location, $new_location);\n }\n\n \n // Insert variables to correct rows in table.\n if($update_post) {\n // Define the value of the array. Point out the exact number to insert to database.\n $update_post_statement = $this->pdo->prepare(\n \"UPDATE posts\n SET title = :title, content = :content, image = :image, id_category = :id_category\n WHERE id = :id\");\n\n $update_post_statement->execute(\n [\n \":title\" => $title,\n \":content\" => $content,\n \"id\" => $id,\n \":image\" => $new_location,\n \":id_category\" => $id_category\n ]\n );\n\n $update_post = $update_post_statement;\n return $update_post;\n }\n }",
"function ccontent_update()\n\t{\n\t\tlusers_require('content/update');\n\n\t\t$post_data = linput_post();\n\t\t$post_data['time'] = date('Y-m-d', strtotime($post_data['date'])) . ' ' . date('H:i:s', strtotime($post_data['time']));\n\n\t\tif (hform_validate(array('name', 'link', 'body')))\n\t\t{\n\t\t\t$cat = mcontent_get_cat($post_data['id']);\n\n\t\t\tlimage_upload_many(lconf_get('content', 'images'), $post_data['link']);\n\n\t\t\tmcontent_update($post_data['id'], $post_data);\n\t\t\t// Check if link is default uri and change default uri too if needed\n\t\t\tif ($cat['link'] == lconf_dbget('default_uri')) lcrud_update(llang_table('settings'), array('name' => 'default_uri'), array('value' => $post_data['link']));\n\t\t\t// Do not update name for category from here\n\t\t\tunset($post_data['name']);\n\t\t\tmcategories_update($cat['id'], $post_data);\n\t\t\t// Update comments too\n\t\t\tlcrud_update(llang_table('comments'), array('module' => CONT, 'module_item' => $cat['link']), array('module_item' => $post_data['link']));\n\n\t\t\tlcache_delete_all();\n\n\t\t\tluri_redirect('main/user/admin/content', l('Content successfully updated.'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$content = mcontent_read($post_data['id']);\n\t\t\tluri_sredirect(lroute_get_uri('main/user_item/admin/content_update') . '/' . $content['link'], l('All fields marked with * are required.'));\n\t\t}\n\t}",
"public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }",
"function cp_ad_premium_packs(){\r\n\t//update Categories\r\n\tif(isset($_POST['dazake_category_submit'])){\r\n\t\tif(isset($_POST['dazake_category_check'])){\r\n\t\t\tforeach($_POST['dazake_category_check'] as $value){\r\n\t\t\t\t$pricename = \"dazake_category{$value}_price\";\r\n\t\t\t\t$pricefeaturename = \"dazake_category{$value}_price_feature\";\r\n\t\t\t\t$pinumname = \"dazake_category{$value}_pic_num\";\r\n\t\t\t\t\r\n\t\t\t\tif(isset($_POST[$pricename ]))\r\n\t\t\t\t\tupdate_option( $pricename, $_POST[$pricename ] );\r\n\t\t\t\t\t\r\n\t\t\t\tif(isset($_POST[$pinumname]))\r\n\t\t\t\t\tupdate_option( $pinumname, $_POST[$pinumname] ) ;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tif(isset($_POST[$pricefeaturename]))\r\n\t\t\t\t\tupdate_option( $pricefeaturename, $_POST[$pricefeaturename] ) ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t\r\n\t\t\r\n\t\t//update free pic nums\r\n\t\tif(isset($_POST['dazakefreepicnum']))\r\n\t\t\tupdate_option( 'dazakefreepicnum', $_POST['dazakefreepicnum'] ) ;\r\n\t\t\t\t\r\n\t\t//update feature pic nums\r\n\t\tif(isset($_POST['dazakefeaturepicnum']))\r\n\t\t\tupdate_option( 'dazakefeaturepicnum', $_POST['dazakefeaturepicnum'] ) ;\r\n\t\t\t\r\n\t\t//update feature time\r\n\t\tif(isset($_POST['dazakefeaturetime']))\r\n\t\t\tupdate_option( 'dazakefeaturetime', $_POST['dazakefeaturetime'] ) ;\r\n\t\t\t\r\n\t\t//update premium time\r\n\t\tif(isset($_POST['dazakepremiumtime']))\r\n\t\t\tupdate_option( 'dazakepremiumtime', $_POST['dazakepremiumtime'] ) ;\r\n\t\t\t\r\n\t\t//update free time \r\n\t\tif(isset($_POST['dazakefreetime']))\r\n\t\t\tupdate_option( 'dazakefreetime', $_POST['dazakefreetime'] ) ;\r\n\t\t\t\r\n\t}\r\n\t\r\n\t$categories = get_categories( array('hide_empty' => 0,\r\n 'taxonomy' \t => APP_TAX_CAT) );\r\n?>\r\n<div class=\"wrap\">\r\n <div class=\"icon32\" id=\"icon-themes\"><br/></div>\r\n <h2><?php _e('Ad Premium Packs','appthemes') ?> </h2>\r\n <?php cp_admin_info_box(); ?>\r\n\t\t<form method = \"POST\">\r\n\t\t<p class = \"submit\">\r\n\t\t<input class = \"btn button-primary\" type = \"submit\" name = \"dazake_category_submit\" value = \"<?php _e('Save changes','appthemes') ?>\" >\r\n\t\t</p>\r\n\t\t\r\n\t\t\r\n\t\t<table>\r\n\t\t<tr>\r\n\t\t\t<td><span class = \"dazakespan\">Ad Listing Period Of Feature:</span></td>\r\n\t\t\t<td><input type = \"text\" class = \"dazaketext\" name = \"dazakefeaturetime\" value = \"<?php echo get_option('dazakefeaturetime')?>\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td><span class = \"dazakespan\">Ad Listing Period Of Premium:</span></td>\r\n\t\t\t<td><input type = \"text\" class = \"dazaketext\" name = \"dazakepremiumtime\" value = \"<?php echo get_option('dazakepremiumtime')?>\"></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td><span class = \"dazakespan\">Ad Listing Period Of Free:</span></td>\r\n\t\t\t<td><input type = \"text\" class = \"dazaketext\" name = \"dazakefreetime\" value = \"<?php echo get_option('dazakefreetime')?>\"></td>\r\n\t\t</tr>\r\n\t\t\r\n\t\t\r\n\t\t<tr>\r\n\t\t\t<td><span class = \"dazakespan\">Pic Num Of Free</span></td>\r\n\t\t\t<td><select name=\"dazakefreepicnum\" class=\"dazakeselect\"> \r\n\t\t\t\t<?php \r\n\t\t\t\t\tfor ($i=1; $i <9 ; $i++) { \r\n\t\t\t\t\t\tif($i == get_option('dazakefreepicnum'))\r\n\t\t\t\t\t\t\techo '<option value=\"'.$i.'\" selected= \"true\">'.$i.'</option> ';\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\techo '<option value=\"'.$i.' \">'.$i.'</option> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t\r\n\t\t\t</select></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td><span class = \"dazakespan\">Pic Num Of Feature</span></td>\r\n\t\t<td><select name=\"dazakefeaturepicnum\" class=\"dazakeselect\"> \r\n\t\t\t\t<?php \r\n\t\t\t\t\tfor ($i=1; $i <9 ; $i++) { \r\n\t\t\t\t\t\tif($i == get_option('dazakefeaturepicnum'))\r\n\t\t\t\t\t\t\techo '<option value=\"'.$i.'\" selected= \"true\">'.$i.'</option> ';\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\techo '<option value=\"'.$i.' \">'.$i.'</option> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t?>\t\t\r\n\t\t</select></td>\r\n\t\t</tr>\r\n\t\t\r\n\t\t</table>\r\n\t\t\r\n\t\t<table id=\"tblspacer\" class=\"widefat fixed\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\" style=\"width:35px;\"> </th>\r\n <th scope=\"col\"><?php _e('Categories Name','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Price Per Categories','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Feature Price Per Categories','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Pic Num Of The Categories','appthemes') ?></th>\r\n <th scope=\"col\"><?php _e('Update Check','appthemes') ?></th>\r\n </tr>\r\n </thead>\r\n\t\t<tbody id=\"list\">\r\n\t\t\r\n<?php\r\n\t$add = 1;\r\n\tforeach($categories as $key => $value){\r\n\t$catid = $value->cat_ID;\r\n\t$pricename = \"dazake_category{$catid}_price\";\r\n\t$pricefeaturename = \"dazake_category{$catid}_price_feature\";\r\n\t$pinumname = \"dazake_category{$catid}_pic_num\";\r\n?>\r\n\t<tr class=\"<?php echo $value->category_nicename ?>\">\r\n <td style=\"padding-left:10px;\"><?php echo $add++; ?>.</td>\r\n <td><?php echo $value->cat_name ?></td>\r\n <td><input type = \"text\" name = \"<?php echo $pricename ?>\" value = \"<?php echo get_option($pricename);?>\" ><span><?php echo get_option('cp_curr_pay_type')?></span></td>\r\n <td><input type = \"text\" name = \"<?php echo $pricefeaturename ?>\" value = \"<?php echo get_option($pricefeaturename);?>\" ><span><?php echo get_option('cp_curr_pay_type')?></span></td>\r\n <td>\r\n\t\t\t<select name=\"<?php echo $pinumname ?>\" class=\"dazakeselect\"> \r\n\t\t\t\t<?php \r\n\t\t\t\t\tfor ($i=1; $i <9 ; $i++) { \r\n\t\t\t\t\t\tif($i == get_option($pinumname))\r\n\t\t\t\t\t\t\techo '<option value=\"'.$i.'\" selected= \"true\">'.$i.'</option> ';\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\techo '<option value=\"'.$i.' \">'.$i.'</option> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t\r\n\t\t\t</select> \r\n\t\t</td>\r\n <td><input type=\"checkbox\" class = \"dazakecheck\" name=\"dazake_category_check[]\" value = \"<?php echo $value->cat_ID ?>\"></td>\r\n </tr>\r\n<?php\r\n}//end foreach\r\n?>\r\n\t</tbody>\r\n\t</table>\r\n\t</form>\r\n<?php\r\n}",
"public function save_entry_update() {\n\t\tglobal $wpdb;\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-entries' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'update_entry' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tif ( !isset( $_POST['entry_id'] ) )\n\t\t\treturn;\n\n\t\t$entry_id = absint( $_POST['entry_id'] );\n\n\t\tcheck_admin_referer( 'update-entry-' . $entry_id );\n\n\t\t// Get this entry's data\n\t\t$entry = $wpdb->get_var( $wpdb->prepare( \"SELECT data FROM $this->entries_table_name WHERE entries_id = %d\", $entry_id ) );\n\n\t\t$data = unserialize( $entry );\n\n\t\t// Loop through each field in the update form and save in a way we can use\n\t\tforeach ( $_POST['field'] as $key => $value ) {\n\t\t\t$fields[ $key ] = $value;\n\t\t}\n\n\t\tforeach ( $data as $key => $value ) :\n\n\t\t\t$id = $data[ $key ]['id'];\n\n\t\t\t// Special case for checkbox and radios not showing up in $_POST\n\t\t\tif ( !isset( $fields[ $id ] ) && in_array( $data[ $key ][ 'type' ], array( 'checkbox', 'radio' ) ) )\n\t\t\t\t$data[ $key ]['value'] = '';\n\n\t\t\t// Only update value if set in $_POST\n\t\t\tif ( isset( $fields[ $id ] ) ) {\n\t\t\t\tif ( in_array( $data[ $key ][ 'type' ], array( 'checkbox' ) ) )\n\t\t\t\t\t$data[ $key ]['value'] = implode( ', ', $fields[ $id ] );\n\t\t\t\telse\n\t\t\t\t\t$data[ $key ]['value'] = esc_html( $fields[ $id ] );\n\t\t\t}\n\t\tendforeach;\n\n\t\t$where = array( 'entries_id' => $entry_id );\n\t\t// Update entry data\n\t\t$wpdb->update( $this->entries_table_name, array( 'data' => serialize( $data ), 'notes' => $_REQUEST['entries-notes'] ), $where );\n\t}",
"function processForm(){\n /*Admin page content goes here */\n if( isset($_POST['rssMultiUpdate']) ){\n require \"classes/RssUpdateSingle.php\";\n \n $RssUpdateSingle = new RssUpdateSingle;\n $RssUpdateSingle->updateBlog();\n }\n }",
"public function updated(Category $category)\n {\n //\n }",
"public function updateAction()\n\t{\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false','messages' => array());\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t\n\t\t\t/* SAVE THE CATEGORY RELATIONSHIPS START */\n\t\t\tif(isset($post['relaties_beheerder']))\n\t\t\t{\n\t\t\t\t$beheerders = $post['relaties_beheerder'];\n\t\t\t\tif($beheerders)\n\t\t\t\t{\n\t\t\t\t\tforeach($beheerders as $beheerder)\n\t\t\t\t\t{\n\t\t\t\t\t\t$acl = new Acl();\n\t\t\t\t\t\t$acl->id = $this->uuid();\n\t\t\t\t\t\t$acl->entity = 'category';\n\t\t\t\t\t\t$acl->userid = $beheerder;\n\t\t\t\t\t\t$acl->clearance = 900;\n\t\t\t\t\t\t$acl->entityid = $post['id'];\n\t\t\t\t\t\tif($acl->save())\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\tforeach ($acl->getMessages() as $message)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo 'ACL1:'.$message;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(isset($post['relaties_leden']))\n\t\t\t{\n\t\t\t\t$leden = $post['relaties_leden'];\n\t\t\t\tif($leden)\n\t\t\t\t{\n\t\t\t\t\tforeach($leden as $lid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$acl = new Acl();\n\t\t\t\t\t\t$acl->id = $this->uuid();\n\t\t\t\t\t\t$acl->entity = 'category';\n\t\t\t\t\t\t$acl->userid = $lid;\n\t\t\t\t\t\t$acl->clearance = 400;\n\t\t\t\t\t\t$acl->entityid = $post['id'];\n\t\t\t\t\t\tif($acl->save())\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\tforeach ($acl->getMessages() as $message)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo 'ACL2:'.$message;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* SAVE THE CATEGORY RELATIONSHIPS END */\t\n\t\t}\n\t\techo json_encode($status);\n\t}",
"public function updateCategories()\n {\n $this->updateCategoriesByType();\n $this->updateCategoriesByParent();\n $this->updateCategoriesByID();\n }",
"function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}",
"function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}",
"function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}",
"public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}",
"public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }",
"public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}",
"public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}",
"public function editmulticategories($editdata) {\n\n if (isset($editdata)) {\n\n for ($i = 0; $i < count($editdata['category_id']); $i++) {\n \n $data = array(\n 'name' => $editdata['category_name'][$i],\n );\n if ($this->input->post('custom_fields_' . $i)) {\n $custom_fields = $this->input->post('custom_fields_' . $i);\n $custom_data = array_values(array_filter($custom_fields));\n\n foreach ($custom_data as $custom_ids) {\n if (!empty($custom_ids)) {\n $data['custom_fields'] = json_encode($custom_data);\n }\n }\n }\n if (trim($editdata['supportemails'][$i]) != \"\") {\n if (strpos(trim($editdata['supportemails'][$i]), ' ') != FALSE) {\n\n $arr = explode(' ', trim($editdata['supportemails'][$i]));\n $str = implode(',', $arr);\n $data['support_emails'] = $str;\n } else {\n $data['support_emails'] = $editdata['supportemails'][$i];\n }\n } else {\n $data['support_emails'] = NULL;\n }\n// var_dump($editdata['supportemails'][$i]);\n// die;\n// var_dump($editdata['supportemails'][$i]);\n if ($this->checkcategory($editdata['category_name'][$i], $this->session->userdata('objSystemUser')->accountid) == 0) {\n $this->db->where('id', $editdata['category_id'][$i]);\n $this->db->update('categories', $data);\n $arr_category[] = $editdata['category_id'][$i];\n }\n }\n\n return $arr_category;\n } else {\n return FALSE;\n }\n }",
"public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }",
"public function isValidCategory() {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\n\t\t// if no splits then category is required otherwise MUST be NULL (will be ignored in Save)\n\t\tif (empty($_POST['splits']) && empty($_POST['category_id'])) {\n\t\t\t$this->form_validation->set_message('isValidCategory', 'The Category Field is Required');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}",
"public function testUpdateCategoryUsingPUT()\n {\n }",
"public function setUpdateCategory(?UpdateCategory $value): void {\n $this->getBackingStore()->set('updateCategory', $value);\n }",
"public function handleEdit($input)\n\t{\n\t\t$id = $input['kdsubkategori'];\n\t\t$update = $this->find($id);\n\t\t$update->NmSubKategori = $input['nmsubkategori'];\n\t\t$update->save();\n\t}",
"public function updated(Category $category)\n {\n //\n }",
"public function setUpdateCategory($val)\n {\n $this->_propDict[\"updateCategory\"] = $val;\n return $this;\n }",
"public function update_cat_att()\n\t\t{\n\t\t\t$id=$this->input->post('cat_id');\n\t\t\t$cat_name=$this->input->post('cat_edit_name');\n\t\t\t$update=$this->db->where(\"f_att_id\",$id)->update('food_attribute',array(\"f_att_name\"=>$cat_name));\n\t\t\tif($update)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t}",
"public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }",
"function kcsite_update_posts_cats(){\n\tglobal $staticVars;\n\t$args = array(\n\t\t'post_type' => 'post', \n\t\t'post_status' => 'any',\n\t\t'numberposts' => 1000,\n\t\t'lang' => pll_current_language('slug'),\n\t\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'new-type',\n\t\t\t\t'field' => 'id',\n\t\t\t\t'terms' => array($staticVars['ordinaryNewTypeID']),\n\t\t\t\t'operator' => 'NOT IN'\n\t\t\t)\n\t\t)\n\t);\t\t\t\n\t$results = get_posts($args);\n\tforeach ($results as $key => $val) {\n\t\twp_set_post_terms($val->ID, array($staticVars['ordinaryNewTypeID']), 'new-type');\n\t}\t\n\t// iprastos lt - 89, iprastos en - 15\n}",
"public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \n\n }",
"function ProcessMultilevelSubCategories()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"ProcessMultilevelSubCategories();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\")) {\n $this->sub_categories_count = $this->listSettings->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < $this->sub_categories_count; $i ++) {\n $sub_category = array();\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\")) {\n $sub_category[\"library\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LIBRARY\", array(\n $i), true);\n }\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\")) {\n $sub_category[\"link_field\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LINK_FIELD\", array(\n $i), true);\n }\n $this->sub_categories[] = $sub_category;\n }\n\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORIES_COUNT\", array(), true);\n }\n\n }",
"function classiera_update_my_category_fields($term_id) {\r\n\tif(isset($_POST['taxonomy'])){\t\r\n\t if($_POST['taxonomy'] == 'category'):\r\n\t\t$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t$tag_extra_fields[$term_id]['your_image_url'] = strip_tags($_POST['your_image_url']);\r\n\t\t$tag_extra_fields[$term_id]['category_image'] = $_POST['category_image'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_code'] = $_POST['category_icon_code'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_color'] = $_POST['category_icon_color'];\r\n\t\tupdate_option(MY_CATEGORY_FIELDS, $tag_extra_fields);\r\n\t endif;\r\n\t}\r\n}",
"public function update_category_records($update_id, $update_details)\r\n {\r\n $this->db->where('Category_id',$update_id);\r\n \r\n $this->db->update('contentcategory', $update_details);\r\n \r\n if($this->db->affected_rows()>0)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n \r\n }",
"public function product_update_post()\n\t\t\t\t{\n\t\t\t\t}",
"public function update_multi_entries_start ()\n\t{\n\t\t$return = (ee()->extensions->last_call) ?\n\t\t\t\t\tee()->extensions->last_call : '';\n\n\t\tee()->load->library('calendar_permissions');\n\n\t\t$group_id = ee()->session->userdata['group_id'];\n\n\t\tif ($group_id != 1 AND ee()->calendar_permissions->enabled())\n\t\t{\n\t\t\t$count = count($_POST['entry_id']);\n\n\t\t\t//remove all the ones they are denied permission to\n\t\t\tforeach ($_POST['entry_id'] as $key => $entry_id)\n\t\t\t{\n\t\t\t\t//if there are only calendar IDs, lets alert\n\t\t\t\tif ( ! ee()->calendar_permissions->can_edit_entry($group_id, $entry_id))\n\t\t\t\t{\n\t\t\t\t\tforeach ($_POST as $post_key => $post_data)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($_POST[$post_key]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($_POST[$post_key][$key]);\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//if we've removed everything, they were all\n\t\t\t//denied and we need to alert\n\t\t\tif ($count > 0 and count($_POST['entry_id']) == 0)\n\t\t\t{\n\t\t\t\tee()->extensions->end_script = TRUE;\n\n\t\t\t\treturn $this->show_error(lang('invalid_calendar_permissions'));\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}",
"function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}",
"private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}",
"public function postUpdate(Request $request, $id)\n\t{\n\t\t$response['status'] = 'error';\n\t\t$response['message'] = trans('categories.not_updated');\n\n\t\tif ( ! empty($_POST))\n\t\t{\n\t\t\t$error = FALSE;\n\n\t\t\tif (empty(trim(Input::get('title'))))\n\t\t\t{\n\t\t\t\t$response['message'] = trans('categories.title_required');\n\t\t\t\t$error = TRUE;\n\t\t\t}\n\n\t\t\t$category_level = Input::get('level');\n\t\t\t$parent = Input::get('parent');\n\n\t\t\tif ( ! empty($category_level) && in_array($category_level, ['1', '2']))\n\t\t\t{\n\t\t\t\tif (empty($parent))\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.parent_required');\n\t\t\t\t\t$error = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($error === FALSE)\n\t\t\t{\n\t\t\t\t$data = [\n\t\t\t\t\t'title' => trim(Input::get('title')),\n\t\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t\t'level' => $category_level,\n\t\t\t\t\t'parent' => $parent,\n\t\t\t\t\t'size_group' => Input::get('size_group'),\n\t\t\t\t\t'position' => Input::get('position'),\n\t\t\t\t\t'visible' => Input::get('visible'),\n\t\t\t\t\t'active' => Input::get('active'),\n\t\t\t\t\t'page_title' => Input::get('page_title'),\n\t\t\t\t\t'meta_description' => Input::get('meta_description'),\n\t\t\t\t\t'meta_keywords' => Input::get('meta_keywords'),\n\t\t\t\t];\n\n\t\t\t\tif (Model_Categories::updateCategory($id, $data) === TRUE)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//Manage Friendly URL\n\t\t\t\t\t\tModel_Categories::setURL($id, Input::get('friendly_url'));\n\n\t\t\t\t\t\t$response['status'] = 'success';\n\t\t\t\t\t\t$response['message'] = trans('categories.updated');\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response['message'] = $e;\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$response['message'] = trans('categories.not_updated');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json($response);\n\t}",
"public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }",
"public function executeUpdate(sfWebRequest $request)\n {\n $this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));\n $this->forward404Unless($forum_categories = Doctrine::getTable('ForumCategories')->find(array($request->getParameter('id'))), sprintf('Object forum_categories does not exist (%s).', $request->getParameter('id')));\n $this->form = new ForumCategoriesForm($forum_categories);\n\n $this->processForm($request, $this->form,\"ForumCategories\");\n\n $this->setTemplate('edit');\n }",
"public function postUpdate(Model $model, $entry) {\n $modelName = $model->getName();\n $id = $entry->getId();\n\n if (isset($this->preUpdateFields[$modelName][$id])) {\n $preUpdateFields = $this->preUpdateFields[$modelName][$id];\n\n unset($this->preUpdateFields[$modelName][$id]);\n if (!$this->preUpdateFields[$modelName]) {\n unset($this->preUpdateFields[$modelName]);\n }\n if (!$this->preUpdateFields) {\n unset($this->preUpdateFields);\n }\n } else {\n $preUpdateFields = null;\n }\n\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n $logModel->logUpdate($model, $entry, $preUpdateFields);\n }",
"public function ParsePostData() {\n\t\t\tif (array_key_exists($this->strControlId, $_POST)) {\n //$this->blnModified = true;\n\t\t\t\t// It was -- update this Control's value with the new value passed in via the POST arguments\n\t\t\t\t$strValue = $_POST[$this->strControlId];\n\n foreach($this->arrListItems as $objListItem){\n if($objListItem->Value == $strValue){\n $objListItem->Selected = true;\n }else{\n $objListItem->Selected = false;\n }\n }\n }\n }",
"FUNCTION Knowledge_update_Category( &$dbh,\n\t\t\t\t\t$aspid,\n\t\t\t\t\t$catid,\n\t\t\t\t\t$name,\n\t\t\t\t\t$display_order )\n\t{\n\t\tif ( ( $aspid == \"\" ) || ( $catid == \"\" )\n\t\t\t|| ( $name == \"\" ) )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$aspid = database_mysql_quote( $aspid ) ;\n\t\t$catid = database_mysql_quote( $catid ) ;\n\t\t$name = database_mysql_quote( $name ) ;\n\t\t$display_order = database_mysql_quote( $display_order ) ;\n\n\t\t$query = \"UPDATE chatkbcats SET name = '$name', display_order = '$display_order' WHERE catID = $catid AND aspID = '$aspid'\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\treturn true ;\n\t\t}\n\t\treturn false ;\n\t}",
"public function postProcessEdit($param)\n {\n $categorieBase = new Category($this->request->getPost());\n $this->lang = $this->request->getPost('lang');\n $categorieBase->active = isset($categorieBase->active) ? 1 : 0;\n\n if (!$this->tableModel->save($categorieBase)) {\n Tools::set_message('danger', $this->tableModel->errors(), lang('Core.warning_error'));\n return redirect()->back()->withInput();\n }\n $categorieBase->saveLang($this->lang, $categorieBase->id);\n\n // Success!\n Tools::set_message('success', lang('Core.save_data'), lang('Core.cool_success'));\n $redirectAfterForm = [\n 'url' => '/' . env('CI_SITE_AREA') . $this->pathcontroller,\n 'action' => 'edit',\n 'submithandler' => $this->request->getPost('submithandler'),\n 'id' => $categorieBase->id,\n ];\n $this->redirectAfterForm($redirectAfterForm);\n }",
"function updateCategoryRow($category_id, $category)\r\n{\r\n $result = false;\r\n \r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"UPDATE categories set category = :category where category_id = :category_id\");\r\n \r\n $binds = array(\r\n // Used to replace all array information of one particular ID\r\n \":category_id\" => $category_id,\r\n \":category\" => $category\r\n );\r\n\r\n if ($stmt->execute($binds) && $stmt->rowCount() > 0) {\r\n // If executed properly, results in success\r\n $result = true;\r\n }\r\n\r\n return $result;\r\n}",
"public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}",
"public function post_list()\n\t{\n\t\tif(Request::ajax())\n\t\t{\n\t\t\t$list = Input::get('list');\n\t\t\t$forums = ForumCat::all();\n\n\t\t\t// Loop through all forums/categories\n\t\t\tforeach($forums as $f)\n\t\t\t{\n\t\t\t\t// Start a weight counter. We'll use this to tell how far through the\n\t\t\t\t// updated list the current forum is. This will be the new 'weight'\n\t\t\t\t// of the forum.\n\t\t\t\t$i = 1;\n\t\t\t\t// Loop through the updated list\n\t\t\t\tforeach($list as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t// To find the current forum\n\t\t\t\t\tif($f->id == $k)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Determine the new parent ID and whether it's now a category.\n\t\t\t\t\t\t$is_cat = ($v == \"root\") ? 1 : 0;\n\t\t\t\t\t\t$id = ($v == \"root\") ? 0 : $v;\n\n\t\t\t\t\t\t// Set the new information and save.\n\t\t\t\t\t\t$f->is_category = $is_cat;\n\t\t\t\t\t\t$f->parent_id = $id;\n\t\t\t\t\t\t$f->weight = $i;\n\t\t\t\t\t\t$f->save();\n\t\t\t\t\t}\n\t\t\t\t\t// Increment the weight counter, this wasn't the right one.\n\t\t\t\t\telse $i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// We'll return this so the user actually knows that everything was\n\t\t\t// updated successfully.\n\t\t\treturn \"Success. Updates applied.\";\n\t\t}\n\t\t// Return a nice catch-all to tell anyone who actually managed to submit\n\t\t// the form (aka have javascript turned off) to use javascript.\n\t\treturn \"Sorry, but you require Javascript to perform this action.\";\n\t}",
"function fm_update_links_cats($catid) {\r\n\t// Changes all associated links to deleted cat to 0\r\n\tif ($linkcats = get_records('fmanager_link', \"category\", $catid)) {\r\n\t\tforeach ($linkcats as $lc) {\t\t\r\n\t\t\t$lc->category = 0;\r\n\t\t\tif (!update_record('fmanager_link', $lc)) {\r\n\t\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"public function ajax_save_category()\n {\n $translation = ee()->input->post('translation');\n $status = ee()->input->post('publisher_save_status');\n\n // Stop here if false or if the array is empty\n if ( !$translation || empty($translation))\n {\n ee()->publisher_helper->send_ajax_response('failure');\n }\n\n $result = ee()->publisher_category->save_translation($translation, $status);\n\n if ($result)\n {\n ee()->publisher_helper->send_ajax_response('success');\n }\n else\n {\n ee()->publisher_helper->send_ajax_response($result);\n }\n }",
"protected function processForm(sfWebRequest $request, sfForm $form,$keyToRedirect, $flagCategoryId ='')\n {\n $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));\n $data = $request->getParameter($form->getName());\n if ($form->isValid())\n {\n if($keyToRedirect == \"Forums\")\n {\n $oForums = new Forums();\n $order = $oForums->maxForumOrderByCategories($data[\"ForumCategoriesId\"]);\n $form->getObject()->setOrdering(($order+1));\n $form->getObject()->setLastTopicBy( $this->getUser()->getAttribute('admin_user_id'));\n }\n\n $forum_categories = $form->save();\n\n\n if($keyToRedirect == \"ForumCategories\")\n {\n if($request->isMethod(sfRequest::PUT))\n $this->getUser()->setFlash('succMsg', \"Update successful.\");\n else\n $this->getUser()->setFlash('succMsg', \"New category added successfully.\");\n\n $this->redirect('Forums/index');\n }\n elseif($keyToRedirect == \"Forums\")\n {\n if($request->isMethod(sfRequest::PUT)){\n $this->getUser()->setFlash('succMsg', \"Update successful.\");\n $this->getUser()->setFlash('succmessages');\n }else{\n $this->getUser()->setFlash('succMsg', \"New forum added successfully.\");\n }\n\n if($flagCategoryId != '')\n\t\t\t\t\t$this->redirect('Forums/forumsList?flagCategoryId='.$flagCategoryId);\n else\n\t\t\t\t\t$this->redirect('Forums/forumsList');\n }\n //$this->redirect('Forums/edit?id='.$forum_categories->getId());\n }\n }",
"public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }",
"public function actionUpdate($id)\n { $this->layout='inner';\n $model = $this->findModel($id);\n $vendor = ArrayHelper::map(User::find()->where(['usertype'=>'Vendor'])->all(), 'id', 'username');\n $cat_list = ArrayHelper::map(ProductCategory::find()->where(['parent_id'=>'0'])->all(), 'id', 'cat_name');\n $cat= ProductCat::find()->Where(['product_id'=>$id])->one();\n $query=$this->fetchChildCategories($cat['category_id']);\n $str=rtrim($this->sam, \"|\");\n $str_data=explode(\"|\",$str);\n if($str_data>0){ \n // $str_data[]=$cat['category_id'];\n } \n // print_r($str_data); die;\n if ($model->load(Yii::$app->request->post())) {\n //$last_cat=end($_POST['Product']['category_id']); \n if($model->save()){\n //$sql=\"update product_cat set category_id = '\".$last_cat .\"' WHERE product_id='\".$model->id.\"'\";\n //Yii::$app->db->createCommand($sql)->execute();\n /*$product_cat= new ProductCat();\n $product_cat->product_id=$model->id;\n $product_cat->category_id=$last_cat;\n $product_cat->save();*/\n //Yii::$app->getSession()->setFlash('success','successful updated');\n return $this->redirect(['add-search-terms','id'=>$id]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'cat'=>$str_data,\n 'vendor'=>$vendor,\n 'cat_list'=>$cat_list,\n\n ]);\n }\n }",
"public function editAction() {\n $id = (int) $this->params()->fromRoute('id', 0);\n\n if (!$id) {\n return $this->redirect()->toRoute('category', array('action' => 'add'));\n }\n $page = (int) $this->params()->fromRoute('page', 0);\n\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n $category = $this->getCategoryTable()->getCategory($id);\n $form->get('id')->setValue($id);\n $form->bind($category);\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $category->exchangeArray($data);\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter(),\n 'exclude' => array(\n 'field' => 'id',\n 'value' => $id,\n )\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $categoryId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category updated successfully');\n\n return $this->redirect()->toRoute('category');\n }\n }\n }\n return array('form' => $form, 'id' => $id, 'page' => $page);\n }",
"public function edit_category($id = null)\n { \n //check if id is set\n if(isset($id))\n {\n $data['category'] = $this->blog_model->get_category($id); //get data of category\n $data['categories'] = $this->blog_model->get_category(); //get all categories from database (for parent purpose)\n\n //if category id desn't exist\n if($data['category'] == false)\n {\n $data['category_error'] = 'Category does not exist'; //set category_error variable\n \n }\n\n //validate form on category update\n $this->form_validation->set_rules('cat_name', 'Category Name', 'required|trim|htmlspecialchars|callback_validate_change_cat_name['.$id.']', array(\n 'required' => '%s is not provided!'\n ));\n $this->form_validation->set_rules('cat_desc', 'Category Description', 'trim|htmlspecialchars');\n\n //if form is not successfully validated\n if($this->form_validation->run() == FALSE)\n {\n if(isset($_POST['submit']))\n {\n $data['info'] = 'An Error occured!';\n }\n $data['cat_parent'] = $this->blog_model->get_category($data['category']['parent_id']); //get category parent\n $data['title'] = 'Edit Category';\n $data['page'] = 'category';\n $this->load->view('template/header',$data);\n $this->load->view('blog/edit_category');\n $this->load->view('template/footer');\n }\n else\n {\n $update = $this->blog_model->update_category($id, $_POST);\n if($update == true)\n {\n $data['category'] = $this->blog_model->get_category($id);\n $data['cat_parent'] = $this->blog_model->get_category($data['category']['parent_id']);\n $data['title'] = 'Edit Category';\n $data['page'] = 'category';\n $data['info'] = 'Category has been successfully updated!';\n $this->load->view('template/header',$data);\n $this->load->view('blog/edit_category');\n $this->load->view('template/footer');\n }\n else\n {\n $data['category'] = $this->blog_model->get_category($id);\n $data['cat_parent'] = $this->blog_model->get_category($data['category']['parent_id']);\n $data['title'] = 'Edit Category';\n $data['page'] = 'category';\n $data['info'] = 'You have made no changes!';\n $this->load->view('template/header',$data);\n $this->load->view('blog/edit_category');\n $this->load->view('template/footer');\n }\n }\n }\n else\n {\n header('location:'.base_url.'index.php/blog/category');\n }\n }",
"public static function checkUpdateRequest() {\n self::checkConnection();\n $data = self::validateUpdateRequest();\n if ($data != null) {\n $project = self::getProjectById($data['id']);\n $project->update($data);\n $project->save();\n $project->updateCategory($data['categories']);\n redirect(url(['_page' => 'project_detail', 'project_id' => $data['id']]));\n }\n }",
"public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }",
"public function CreateUpdateCategory()\n\t{\n\t\tif (version_compare(JVERSION, '3.0', 'lt'))\n\t\t{\n\t\t\tJTable::addIncludePath(JPATH_PLATFORM . 'joomla/database/table');\n\t\t}\n\n\t\t$obj = new stdclass;\n\n\t\t$app = JFactory::getApplication();\n\t\t$cat_id = $app->input->get('id', 0, 'INT');\n\n\t\tif (empty($app->input->get('title', '', 'STRING')))\n\t\t{\n\t\t\t$obj->code = 'ER001';\n\t\t\t$obj->message = 'Title Field is Missing';\n\n\t\t\treturn $obj;\n\t\t}\n\t\tif (empty($app->input->get('extension', '', 'STRING')))\n\t\t{\n\t\t\t$obj->code = 'ER002';\n\t\t\t$obj->message = 'Extension Field is Missing';\n\n\t\t\treturn $obj;\n\t\t}\n\n\t\t\n\t\tif ($cat_id)\n\t\t{\n\t\t\t$category = JTable::getInstance('Content', 'JTable', array());\n\t\t\t$category->load($cat_id);\n\t\t\t$data = array(\n\t\t\t'title' => $app->input->get('title', '', 'STRING'),\n\t\t);\n\n\t\t\t// Bind data\n\t\t\tif (!$cat_id->bind($data))\n\t\t\t{\n\t\t\t\t$this->setError($article->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$category = JTable::getInstance('content');\n\t\t\t$category->title = $app->input->get('title', '', 'STRING');\n\t\t\t$category->alias = $app->input->get('alias', '', 'STRING');\n\t\t\t$category->description = $app->input->get('description', '', 'STRING');\n\t\t\t$category->published = $app->input->get('published', '', 'STRING');\n\t\t\t$category->parent_id = $app->input->get('parent_id', '', 'STRING');\n\t\t\t$category->extension = $app->input->get('language', '', 'INT');\n\t\t\t$category->access = $app->input->get('catid', '', 'INT');\n\t\t}\n\n\t\t// Check the data.\n\t\tif (!$category->check())\n\t\t{\n\t\t\t$this->setError($category->getError());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Store the data.\n\t\tif (!$category->store())\n\t\t{\n\t\t\t$this->setError($category->getError());\n\n\t\t\treturn false;\n\t\t}\n\n\t\t//return true;\n\t}",
"public function updated(BlogCategory $blogCategory)\n {\n //\n }",
"function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}",
"public function update(){\n $service_category = new OsServiceCategoryModel($this->params['service_category']['id']);\n $service_category->set_data($this->params['service_category']);\n if($service_category->save()){\n $response_html = __('Service Category Updated. ID: ', 'latepoint') . $service_category->id;\n $status = LATEPOINT_STATUS_SUCCESS;\n }else{\n $response_html = $service_category->get_error_messages();\n $status = LATEPOINT_STATUS_ERROR;\n }\n if($this->get_return_format() == 'json'){\n $this->send_json(array('status' => $status, 'message' => $response_html));\n }\n }",
"function update_category_detail($siteData, $category_id) {\n $this->db->where('id', $category_id);\n $this->db->update('category', $siteData);\n }",
"public function update(Request $request, Postcategory $postcategory)\n {\n //\n }",
"function doEdit()\n {\n $dt = new lmbDate();\n $this->dt_up = $dt->getStamp();\n\n $node_id = $this->request->getInteger('id');\n $this->node = $node_id;\n $category['node_id'] = $node_id;\n $category['title'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_TITLE);\n $category['description'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_DESCR);\n $category['identifier'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_URI);\n\n $this->dt_cr = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $category['date_create'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $category['date_update'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_UPDATE_DATE);\n $category['is_branch'] = TreeItem::getIsBranchByNodeId($node_id);\n\n $this->setFormDatasource($category, 'object_form');\n\n if($this->request->hasPost())\n {\n $this->_validateAndSave(false);\n //$this->_onAfterSave();\n }\n }",
"public function validateCatalogEvents()\n {\n // instead of generic (we are capped by allowed store groups root categories)\n // check whether attempting to create event for wrong category\n if (self::ACTION_NEW === $this->getActionName()) {\n $categoryId = $this->_request->getParam('category_id');\n if (!$categoryId) {\n $this->_forward();\n return;\n }\n\n try {\n $category = $this->categoryRepository->get($categoryId);\n } catch (NoSuchEntityException $e) {\n $this->_forward();\n return;\n }\n\n if (!$this->_isCategoryAllowed($category) || !$this->_role->getIsWebsiteLevel()) {\n $this->_forward();\n return;\n }\n }\n }",
"public function update($postArray)\n {\n $params = BaseAta_program_category::getParams();\n return $this->updateRow($postArray, $params);\n }",
"public function onUpdateField()\n {\n //TODO Validate input\n\n $post = post();\n\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::updateField(\n $post['name'],\n $post['code'],\n $post['description'],\n $post['type'],\n $validation,\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }",
"public static function updateCategory(array $item)\n\t{\n\t\t$db = BackendModel::getDB(true);\n\n\t\t// build extra\n\t\t$extra = array(\n\t\t\t'id' => $item['extra_id'],\n\t\t\t'module' => 'faq',\n\t\t\t'type' => 'block',\n\t\t\t'label' => 'Faq',\n\t\t\t'action' => 'category',\n\t\t\t'data' => serialize(array(\n\t\t\t\t'id' => $item['id'],\n\t\t\t\t'extra_label' => ucfirst(BL::lbl('Faq', 'core')) . ': ' . $item['name'],\n\t\t\t\t'language' => $item['language'],\n\t\t\t\t'edit_url' => BackendModel::createURLForAction('edit') . '&id=' . $item['id'])\n\t\t\t\t),\n\t\t\t'hidden' => 'N'\n\t\t);\n\n\t\t// update extra\n\t\t$db->update('pages_extras', $extra, 'id = ? AND module = ? AND type = ? AND action = ?', array($extra['id'], $extra['module'], $extra['type'], $extra['action']));\n\n\t\t// update category\n\t\treturn $db->update('faq_categories', $item, 'id = ? AND language = ?', array($item['id'], $item['language']));\n\t}",
"public function SaveGroupCategory() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstGroup) $this->objGroupCategory->GroupId = $this->lstGroup->SelectedValue;\n\t\t\t\tif ($this->calDateRefreshed) $this->objGroupCategory->DateRefreshed = $this->calDateRefreshed->DateTime;\n\t\t\t\tif ($this->txtProcessTimeMs) $this->objGroupCategory->ProcessTimeMs = $this->txtProcessTimeMs->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the GroupCategory object\n\t\t\t\t$this->objGroupCategory->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public function editCustomField($editCategory) {\n\n if (isset($editCategory)) {\n\n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }",
"function update_category_detail($siteData,$category_id)\n\t{\n\t\t$this->db->where('id', $category_id);\n\t\t$this->db->update('category', $siteData); \n\t\t\n\t}",
"public function UpdateCategory($_category)\n\t\t{\n\t\t\t$query = \"update categories set \";\n\t\t\t$query .= \"categoryname = '\" . $this->CheckString($_category->getCategoryName()) . \"', \";\n\t\t\t$query .= \"parentcategoryid = \" . $_category->getParentCategoryID() . \", \";\n\t\t\t$query .= \"filtered = \" . $this->CheckBoolean($_category->getFiltered()) . \" , \";\n\t\t\t$query .= \"displayorder = \" . $_category->getDisplayOrder() . \" \";\n\t\t\t$query .= \" where categoryid = \" . $_category->getCategoryID();\n\t\t\treturn $query;\n\t\t}",
"function cp_update_options($options) {\r\n $toolsMessage = '';\r\n\r\n if (isset($_POST['submitted']) && $_POST['submitted'] == 'yes') {\r\n\r\n foreach ( $options as $value ) {\r\n if ( isset($_POST[$value['id']]) ) {\r\n //echo $value['id'] . '<-- value ID | ' . $_POST[$value['id']] . '<-- $_POST value ID <br/><br/>'; // FOR DEBUGGING\r\n update_option( $value['id'], appthemes_clean($_POST[$value['id']]) );\r\n } else {\r\n @delete_option( $value['id'] );\r\n }\r\n }\r\n\r\n // do a separate update for price per cats since it's not in the $options array\r\n if ( isset($_POST['catarray']) ) {\r\n foreach ( $_POST['catarray'] as $key => $value ) {\r\n // echo $key .'<-- key '. $value .'<-- value<br/>'; // FOR DEBUGGING\r\n update_option( $key, appthemes_clean($value) );\r\n }\r\n }\r\n\r\n // clean all values from the post and store them into a wordpress option as a serialized array of cat ID's\r\n if ( isset($_POST['catreqarray']) ) {\r\n foreach ( $_POST['catreqarray'] as $key => $value ) {\r\n $catreqarray[absint($value)] = '';\r\n }\r\n update_option('cp_required_categories', $catreqarray);\r\n } else if (isset($_POST['cp_required_membership_type'])){\r\n delete_option('cp_required_categories');\r\n }\r\n\r\n\t\t\tif ( get_option('cp_tools_run_expiredcheck') == 'yes' ) {\r\n\t\t\t\t\tupdate_option('cp_tools_run_expiredcheck', 'no');\r\n\t\t\t\t\tcp_check_expired_cron();\r\n\t\t\t\t\t$toolsMessage = '';\r\n\t\t\t\t\t$toolsMessage .= __('Ads Expired Check was executed.');\r\n\t\t\t}\r\n\r\n\t\t\t// flush out the cache so changes can be visible\r\n\t\t\tcp_flush_all_cache();\r\n\r\n echo '<div class=\"updated\"><p>'.__('Your settings have been saved.','appthemes'). ' ' . $toolsMessage . '</p></div>';\r\n\r\n } elseif ( isset($_POST['submitted']) && $_POST['submitted'] == 'convertToCustomPostType' ) {\r\n\t\tupdate_option('cp_tools_run_convertToCustomPostType', 'no');\r\n\t\t$toolsMessage .= cp_convert_posts2Ads();\r\n\t\techo $toolsMessage;\r\n\t}\r\n}"
] | [
"0.8170923",
"0.6424623",
"0.6291664",
"0.62079436",
"0.61742085",
"0.6161012",
"0.6133668",
"0.61207837",
"0.60949314",
"0.6066736",
"0.605513",
"0.6037569",
"0.5997986",
"0.59850764",
"0.5982726",
"0.5980113",
"0.5979108",
"0.59551746",
"0.5931074",
"0.5929418",
"0.589933",
"0.587068",
"0.58281106",
"0.5819787",
"0.57966655",
"0.5788094",
"0.57847106",
"0.575252",
"0.5748429",
"0.57286704",
"0.57205355",
"0.5700002",
"0.56423056",
"0.56334764",
"0.56331205",
"0.5622162",
"0.5608155",
"0.5583874",
"0.55765396",
"0.55739975",
"0.55739975",
"0.55660945",
"0.55652225",
"0.5551863",
"0.55515194",
"0.5533254",
"0.5524526",
"0.5516808",
"0.54943854",
"0.54894114",
"0.5462849",
"0.54541236",
"0.5453726",
"0.54535973",
"0.54515386",
"0.5449199",
"0.54429054",
"0.544186",
"0.543876",
"0.5430559",
"0.5417726",
"0.54125416",
"0.5408123",
"0.54011387",
"0.53883576",
"0.53775257",
"0.53675115",
"0.5358272",
"0.5340733",
"0.5333182",
"0.5329642",
"0.5329179",
"0.53265727",
"0.5326466",
"0.5324631",
"0.53210014",
"0.5316841",
"0.5304805",
"0.529904",
"0.52826023",
"0.526641",
"0.5266325",
"0.5261194",
"0.52608144",
"0.5259248",
"0.52584267",
"0.5258146",
"0.5256595",
"0.5256017",
"0.5255906",
"0.52555287",
"0.52441186",
"0.5243861",
"0.5243453",
"0.52382183",
"0.5234116",
"0.52296233",
"0.52255416",
"0.5219016",
"0.52164876"
] | 0.7950188 | 1 |
MCP Methods Get a specific category, and optionally all translations for it. | public function get($cat_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $translations = FALSE)
{
if ( !$cat_id)
{
show_error('$cat_id is required. publisher_category.php->get()');
}
if ($translations)
{
// TODO: turns out I never used this... Doesn't exist.
return $this->get_category_translations($cat_id);
}
else
{
$qry = ee()->db->select('c.*, uc.*, c.cat_id as cat_id')
->from('publisher_categories AS uc')
->join('categories AS c', 'c.cat_id = uc.cat_id')
->where('c.cat_id', $cat_id)
->where('c.site_id', ee()->publisher_lib->site_id)
->get();
return $qry->row() ?: FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCategory();",
"public function getCategory();",
"public function getCategory() {}",
"public function getTranslations( ?string $category = null ) : array;",
"function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }",
"function getCategory() \n {\n return $this->instance->getCategory();\n }",
"public function getMultilingual();",
"public function getCategory()\n {\n }",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }",
"public static function getBasicInfo($category_id=0, $language_id = 0)\n\t{\n\t\t$db = DataAccess::getInstance();\n\t\tif (!$category_id){\n\t\t\t//TODO: get this text from the DB somewhere...\n\t\t\treturn array('category_name' => \"Main\");\n\t\t}\n\t\tif (!$language_id){\n\t\t\t$language_id = $db->getLanguage();\n\t\t}\n\t\tif (isset(self::$_getInfoCache[$category_id][$language_id])){\n\t\t\treturn self::$_getInfoCache[$category_id][$language_id];\n\t\t}\n\t\t\n\t\t$sql = \"SELECT `category_name`,`category_cache`,`cache_expire`,`description` FROM \".geoTables::categories_languages_table.\" WHERE `category_id` = ? and language_id = ? LIMIT 1\";\n\t\t$result = $db->Execute($sql, array($category_id, $language_id));\n\t\tif (!$result || $result->RecordCount() == 0)\n\t\t{\n\t\t\ttrigger_error('ERROR CATEGORY SQL: Cat not found for id: '.$category_id.', Sql: '.$sql.' Error Msg: '.$db->ErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\t$show = $result->FetchRow();\n\t\t$show['category_name'] = geoString::fromDB($show['category_name']);\n\t\t$show['description'] = geoString::fromDB($show['description']);\n\t\t//save it, so we don't query the db a bunch\n\t\tself::$_getInfoCache[$category_id][$language_id] = $show;\n\t\treturn $show;\n\t}",
"public function get($category_id);",
"public function getCategory(): string;",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function get_translations($cat_id = FALSE, $group_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $lang_id = FALSE)\n {\n if ( !$cat_id)\n {\n show_error('$cat_id is required. publisher_category.php->get_translations()');\n }\n\n if ( !$group_id)\n {\n show_error('$group_id is required. publisher_category.php->get_translations()');\n }\n\n $categories = array();\n $translations = array();\n\n $where = array(\n 'publisher_status' => $status,\n 'cat_id' => $cat_id,\n 'site_id' => ee()->publisher_lib->site_id\n );\n\n $qry = ee()->db->from('publisher_categories')\n ->where($where)\n ->get();\n\n foreach ($qry->result() as $row)\n {\n $categories[$row->publisher_lang_id] = $row;\n }\n\n if ($lang_id)\n {\n $translations[$lang_id] = isset($categories[$lang_id]) ? $categories[$lang_id] : $categories[ee()->publisher_lib->default_lang_id];\n }\n else\n {\n $fields = $this->get_custom_fields($group_id);\n\n $field_select_default = array();\n\n foreach ($fields as $name => $field)\n {\n if (preg_match('/field_id_(\\d+)/', $name, $matches))\n {\n $field_select_default[] = 'cfd.'. $name;\n }\n }\n\n foreach ($this->get_enabled_languages() as $lid => $language)\n {\n // If we have existing category data\n if (isset($categories[$lid]))\n {\n $translations[$lid] = $categories[$lid];\n }\n // If the language ID in the loop is what our current default lang is\n elseif ($lid == ee()->publisher_lib->default_lang_id)\n {\n $default_qry = ee()->db->select('c.*, '. implode(',', $field_select_default))\n ->from('categories AS c')\n ->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')\n ->where('c.cat_id', $cat_id)\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n $default_category = (object) array();\n\n // Kind of silly, but NULL values in the DB don't work when accessing\n // the property value, e.g. $category->$field_name will throw an error.\n foreach ($default_qry->row() as $field => $value)\n {\n $default_category->$field = $value === NULL ? '' : $value;\n }\n\n $translations[$lid] = $default_category;\n }\n // The category has not been translated yet, so create the vars\n // with an empty translation value so the view doesn't bomb.\n else\n {\n $categories[$lid] = new stdClass();\n\n // Make sure our object has the same properties, but blank,\n // as a translated entry.\n foreach ($fields as $file_name => $field_data)\n {\n $categories[$lid]->$file_name = '';\n }\n\n $categories[$lid]->cat_id = $cat_id;\n $categories[$lid]->publisher_lang_id = $lid;\n\n $translations[$lid] = $categories[$lid];\n }\n\n $translations[$lid]->text_direction = $this->get_language($lid, 'direction');\n }\n }\n\n return $translations;\n }",
"public function getCategory($name);",
"public static function getCategory()\n {\n return self::$category;\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}",
"function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getLanguages($category_id = NULL, $language_name = NULL)\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n if (is_null($language_name) && is_null($category_id))\n {\n $query = 'SELECT field_name, experience, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN language_categories\n ON languages.category = language_categories.id';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no languages found.';\n }\n }\n else if (is_null($language_name) && !is_null($category_id))\n {\n $query = 'SELECT field_name, experience, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN language_categories\n ON languages.category = language_categories.id\n WHERE languages.category = :language_category';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute(array(':language_category' => $category_id)))\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no languages in this category.';\n }\n }\n else if (!is_null($language_name) && is_null($category_id))\n {\n $query = 'SELECT field_name, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN skills_categories\n ON languages.category = language_categories.id\n WHERE languages.field_name = :language_name';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute(array(':language_name' => $language_name)))\n {\n return $sth->fetch();\n }\n else\n {\n return 'Oops, there\\'s no language with that name';\n }\n }\n else\n {\n return 'There\\'s an error with your code. We don\\'t expect you to pass both $category_id and $language_name';\n }\n }",
"public function getCategory(){\n return $this->category;\n }",
"function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}",
"public function get_category(){\n\t\treturn $this->category;\n\t}",
"public function getLanguageCategories()\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n $query = 'SELECT id, category_name\n FROM language_categories';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no language categories found in the database.';\n }\n }",
"public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }",
"public function get($categoryId = null)\n {\n // Define the id of the category:\n $categoryId = isset($_POST['id']) ? $_POST['id'] : (isset($_GET['id']) ? $_GET['id'] : (!is_null($categoryId) ? $categoryId : false));\n // Define the category\n $category = Category::withTrashed()->where('id', $categoryId)->first();\n // Check if any category is found:\n if(!$category){\n // Display an error:\n FlashSession::addAlert('error', 'Er geen categorie gevonden met dit ID');\n // Return to the overview:\n return redirect('/admin/category');\n }\n // Return to view with category data:\n return view('admin.category.get', compact('category'));\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function ajax_get_category()\n {\n $cat_id = ee()->input->get('cat_id');\n $group_id = ee()->input->get('group_id');\n $status = ee()->input->get('publisher_view_status') ? ee()->input->get('publisher_view_status') : PUBLISHER_STATUS_OPEN;\n\n $data = array(\n 'cat_id' => $cat_id,\n 'status' => $status\n );\n\n $vars = ee()->publisher_helper->get_toolbar_options('category', $data, FALSE);\n\n $vars['cat_id'] = $cat_id;\n $vars['group_id'] = $group_id;\n $vars['data'] = ee()->publisher_category->get_translations($cat_id, $group_id, $status);\n $vars['save_url'] = ee()->publisher_helper_cp->mod_link('ajax_save_category', array(), TRUE);\n $vars['custom_fields'] = ee()->publisher_category->get_custom_fields($group_id);\n\n // Load core lang file so views are translated\n ee()->lang->loadfile('content');\n\n if (ee()->input->get('publisher_view_status'))\n {\n $data = ee()->load->view('category/edit_form', $vars, TRUE);\n }\n else\n {\n $data = ee()->load->view('category/edit', $vars, TRUE);\n }\n\n ee()->publisher_helper->send_ajax_response($data);\n }",
"public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}",
"public function getCategory() {\n\t\treturn $this->category;\n\t}",
"public function getCategory()\n {\n return $this->_category;\n }",
"public function getCategory()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Category (Linnworks API)');\n\t\t}",
"public function getCategory()\n {\n\n return $this->category;\n }",
"public function getCategory(): ?string;",
"public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"public function getCategories();",
"public function getCategories();",
"function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"public function index(){\n\n $default_lang = get_default_language(); // get the default language\n $categories = Category::where('translation_lang',$default_lang)-> selection() -> get();\n return view('admin.categories.index',compact('categories'));\n }",
"function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }",
"public function getAllTranslationByLanguage();",
"public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }",
"public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }",
"public function getSkill_byCategory_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->getSkill_byCategory($category_id);\n\t\treturn $this->response($result);\t\t\t\n\t}",
"function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function getDocumentCategoryTplInfo()\n\t{\n\t\t$oModuleModel = getModel('module');\n\t\t$oMemberModel = getModel('member');\n\t\t// Get information on the menu for the parameter settings\n\t\t$module_srl = Context::get('module_srl');\n\t\t$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);\n\t\t// Check permissions\n\t\t$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));\n\t\tif(!$grant->manager) return new Object(-1,'msg_not_permitted');\n\n\t\t$category_srl = Context::get('category_srl');\n\t\t$category_info = $this->getCategory($category_srl);\n\t\tif(!$category_info)\n\t\t{\n\t\t\treturn new Object(-1, 'msg_invalid_request');\n\t\t}\n\n\t\t$this->add('category_info', $category_info);\n\t}",
"public function getContentByCategory($category){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM contenu WHERE categorie = :categorie');\n\t\t$stmt->execute(array(':categorie' => $category));\n\t\treturn $stmt->fetch();\n\t}",
"public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }",
"public function getCategory(): string|null;",
"public function getAllWithCategory();",
"public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\Category\" );\n\t}",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function getAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory(intval($id));\r\n\t\tif(!$info) $this->output(-1, '操作失败.');\r\n\t\t$this->output(0, '', $info);\r\n\t}",
"public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}",
"function getCategory($id_category){\n $db = db();\n $db->begin();\n $data = $db->exec('SELECT * FROM m_song WHERE fk_id_category = '.$id_category);\n\n return $data;\n }",
"private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}",
"function getCategory() {\n\t\treturn $this->pluginCategory;\n\t}",
"public function getTranslationCategories()\n {\n try {\n $model = $this->getTranslationModel();\n if ($model instanceof ActiveRecord) {\n $list = $model::find()->groupBy('category')->all();\n return ArrayHelper::getColumn($list, 'category');\n }\n } catch (\\Exception $ex) {\n Yii::error($ex->getMessage(), 'translations');\n }\n return [];\n }",
"public function categories_get($category_id = \"\") {\n $categories = array();\n $categories = $this->api_model->categories_get($category_id);\n $this->set_response($categories, REST_Controller::HTTP_OK);\n }",
"function getCategoryNameById($cat_id) {\n $ci = & get_instance();\n $category = $ci->crud->get(ES_PRODUCT_CATEGORIES, array('id' => $cat_id));\n if (count($category) > 0) {\n return $category['name'];\n } else {\n return \"Not available\";\n }\n}",
"public static function getCategoryDescription() {\n global $lC_Database, $lC_Language, $current_category_id;\n \n $Qcategory = $lC_Database->query('select categories_description from :table_categories_description where categories_id = :categories_id and language_id = :language_id');\n $Qcategory->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategory->bindInt(':categories_id', $current_category_id);\n $Qcategory->bindInt(':language_id', $lC_Language->getID());\n $Qcategory->execute();\n \n $output = '';\n if ($Qcategory->value('categories_description') != '') {\n $output .= $Qcategory->value('categories_description');\n }\n \n return $output;\n }",
"public function getLanguage($controller);",
"public function get(){\n\n $tabla = \"categorias\";\n \n $respuesta = ModeloCategorias::get($tabla);\n \n return $respuesta; \n }",
"function GetCategory($categoryId)\n\t{\n\t\t$result = $this->sendRequest(\"GetCategory\", array(\"CategoryId\"=>$categoryId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function cah_news_get_category_name($cat_ID) {\r\n $response = cah_news_get_rest_body('categories/' . $cat_ID);\r\n if ($response) {\r\n return $response->name;\r\n }\r\n}",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"public function get($cat){\r\n \tif($cat==\"demographics\"){\r\n \t\treturn $this->demographics;\r\n \t}\r\n \tif(isset($this->categories[$cat])){\r\n \t\treturn $this->data[$cat];\r\n \t}\r\n \tthrow new Exception(\"Invalid category!\");\r\n\t}",
"public function getAllCategories();",
"public function index()\n {\n $categories = QueryBuilder::for(Category::class)\n ->select('categories.*', 'category_translations.name')\n ->join('category_translations', 'categories.id', '=', 'category_translations.category_id')\n ->where('category_translations.locale', '=', app()->getLocale())\n ->allowedSorts(['name', 'created_at'])\n ->allowedIncludes(['posts', 'translations'])\n ->jsonPaginate();\n// dd(new CategoriesCollection($categories));\n return new CategoriesCollection($categories);\n }",
"public function cgetAction() {\n $api = $this->container->get('winefing.api_controller');\n $response = $api->get($this->get('router')->generate('api_get_article_categories'));\n $serializer = $this->container->get('jms_serializer');\n $articleCategories = $serializer->deserialize($response->getBody()->getContents(), 'ArrayCollection<Winefing\\ApiBundle\\Entity\\ArticleCategory>', 'json');\n return $this->render('admin/blog/articleCategory.html.twig', array(\"articleCategories\" => $articleCategories)\n );\n }",
"public function getCategory()\n {\n \t$cat = Category::with('child')->get();\n return response()->json( [ 'cat' => $cat ] );\n }",
"function article_category() {\n $category = Registry::get('category');\n return $category->title;\n}",
"public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }",
"public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}",
"public function getCategory()\r\n{\r\n $query_string = \"SELECT categoryname, categorydescription FROM categories \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}",
"public function getCategory(int $id)\n {\n }",
"public function translateCategory($lc)\n {\n return $this->LC_CATEGORIES[$lc];\n }",
"public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }"
] | [
"0.6765036",
"0.6765036",
"0.67195314",
"0.658613",
"0.651059",
"0.63749427",
"0.63533765",
"0.6295764",
"0.6261291",
"0.6197481",
"0.619715",
"0.6110495",
"0.60551274",
"0.60551274",
"0.6053155",
"0.6050581",
"0.60484713",
"0.6034503",
"0.6032081",
"0.600723",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.599439",
"0.5965234",
"0.5963584",
"0.59582335",
"0.5940923",
"0.5938983",
"0.59290886",
"0.5911317",
"0.59037346",
"0.5903563",
"0.59026474",
"0.5896256",
"0.5894924",
"0.5866411",
"0.5865389",
"0.5837159",
"0.5832719",
"0.58315325",
"0.582768",
"0.582768",
"0.5825985",
"0.58236134",
"0.58124137",
"0.5809867",
"0.57967865",
"0.5765889",
"0.5752366",
"0.5747816",
"0.5729563",
"0.57180643",
"0.56843233",
"0.567884",
"0.5678229",
"0.5677657",
"0.56657517",
"0.56652486",
"0.56648517",
"0.56648517",
"0.56648517",
"0.56633294",
"0.5654201",
"0.56532544",
"0.56515014",
"0.564652",
"0.56399417",
"0.56319535",
"0.56242263",
"0.5623361",
"0.5601131",
"0.55995625",
"0.55993456",
"0.55990046",
"0.5585051",
"0.5582013",
"0.55759287",
"0.557021",
"0.55574626",
"0.55450946",
"0.5537699",
"0.5534127",
"0.55277187",
"0.5524685",
"0.55198514",
"0.55174005",
"0.551667"
] | 0.60872656 | 12 |
Get all categories optionally by group with no translations, just category data. | public function get_all($group_id = FALSE, $status = PUBLISHER_STATUS_OPEN)
{
ee()->db->where('site_id', ee()->publisher_lib->site_id);
if (is_numeric($group_id))
{
ee()->db->where('group_id', $group_id);
}
$qry = ee()->db
->order_by('cat_name', 'asc')
->get('categories');
$categories = array();
foreach ($qry->result() as $category)
{
$category->translation_status = $this->is_translated_formatted($category->cat_id, ee()->publisher_setting->detailed_translation_status());
$categories[] = $category;
}
return !empty($categories) ? $categories : FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public function getAllWithCategory();",
"private function getCategories($groupID = null)\n {\n $this->db->select('*', '`bf_categories`')\n ->where('`visible` = 1' . \n ($groupID ? ' AND `category_group_id` = \\'' . intval($groupID) . '\\'' : ''))\n ->order('name', 'asc')\n ->execute();\n \n // Collect categories\n $categoryCollection = array();\n while($category = $this->db->next())\n {\n // Get image\n $image = $this->parent->db->getRow('bf_images', $category->image_id);\n \n // No image?\n if(!$image)\n {\n // Default image\n $imageURL = \n $this->parent->config->get('com.b2bfront.site.default-image', true);\n }\n else\n {\n $imageURL = Tools::getImageThumbnail($image->url);\n }\n \n $categoryCollection[] = array(\n 'name' => $category->name,\n 'id' => $category->id,\n 'url' => $imageURL\n );\n }\n \n return $categoryCollection;\n }",
"private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }",
"public function getAllCategories();",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }",
"public function allCategories()\n {\n return Category::all();\n }",
"public function getCategories();",
"public function getCategories();",
"public static function getAllCategories()\n {\n $return = (array) FrontendModel::get('database')->getRecords(\n 'SELECT c.id, c.title AS label, COUNT(c.id) AS total\n FROM menu_categories AS c\n INNER JOIN menu_alacarte AS i ON c.id = i.category_id AND c.language = i.language\n GROUP BY c.id\n ORDER BY c.sequence ASC',\n array(), 'id'\n );\n\n // loop items and unserialize\n foreach ($return as &$row) {\n if (isset($row['meta_data'])) {\n $row['meta_data'] = @unserialize($row['meta_data']);\n }\n }\n\n return $return;\n }",
"public function getTranslationCategories()\n {\n try {\n $model = $this->getTranslationModel();\n if ($model instanceof ActiveRecord) {\n $list = $model::find()->groupBy('category')->all();\n return ArrayHelper::getColumn($list, 'category');\n }\n } catch (\\Exception $ex) {\n Yii::error($ex->getMessage(), 'translations');\n }\n return [];\n }",
"function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}",
"public function getAllWithCategoryAndTags();",
"public function getCategories()\n {\n return Category::all();\n }",
"protected function findAllCategories()\n {\n return resolve([]);\n }",
"public static function getAllCategories()\n\t{\n\t\t$categories= Category::all();\n\t\treturn $categories;\n\t}",
"public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}",
"public function getAllCategories()\n {\n $this->datatables\n ->select('*,CategoryId')\n ->from($this->_categories)\n ->join($this->_modules, $this->_modules . '.ModuleId = ' . $this->_categories . '.ModuleId')\n ->select('ModuleName')\n ->select('CategoryName')\n ->add_column('Edit', '<a href=\"' . base_url() . 'categories_panel/$1\" target=\"_blank\"><i class=\"fa fa-pencil fa-fw\"></i></a>', 'CategoryId')\n ->add_column('Delete', '<a href=\"' . base_url() . 'categories_panel/$1\"><i class=\"fa fa-trash-o fa-fw\"></i></a>', 'CategoryId')\n ->unset_column('ModuleId')\n ->unset_column('Edit')\n ->unset_column('Delete')\n ->unset_column('CategoryId');\n\n $q = $this->datatables->generate();\n return $q;\n }",
"public function get_categories () {\n\t\treturn Category::all();\n\t}",
"public function getAll()\n {\n return CategorieResource::collection(Categorie::paginate());\n }",
"public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }",
"function getCategories(){\n\t\tif ($this->isAdmin() || $this->isSupervisor())\n\t\t\treturn CategoryQuery::create()->find();\n\n\t\t$sql = \"SELECT \".CategoryPeer::TABLE_NAME.\".* FROM \".UserGroupPeer::TABLE_NAME .\" ,\".\n\t\t\t\t\t\tGroupCategoryPeer::TABLE_NAME .\", \".CategoryPeer::TABLE_NAME .\n\t\t\t\t\t\t\" where \".UserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\n\t\t\t\t\t\tUserGroupPeer::GROUPID .\" = \".GroupCategoryPeer::GROUPID .\" and \".\n\t\t\t\t\t\tGroupCategoryPeer::CATEGORYID .\" = \".CategoryPeer::ID .\" and \".\n\t\t\t\t\t\tCategoryPeer::ACTIVE .\" = 1\";\n\n\t\t$con = Propel::getConnection(UserPeer::DATABASE_NAME);\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\treturn CategoryPeer::populateObjects($stmt);\n\t}",
"public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }",
"public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}",
"public static function getCategories()\n {\n $app = App::getInstance();\n\n $manager = BaseManager::build('FelixOnline\\Core\\Category', 'category');\n\n try {\n $values = $manager->filter('hidden = 0')\n ->filter('deleted = 0')\n ->filter('id > 0')\n ->order('order', 'ASC')\n ->values();\n\n return $values;\n } catch (\\Exception $e) {\n return array();\n }\n }",
"public function read_all_categories()\n {\n $result = array(\n \"status\" => \"\" ,\n \"body\" => array(\n \"categories\" => array(\n \"id\" => 0,\n \"category_name\" => \"\"\n ),\n \"count\" => 0\n ),\n \"error\" => array()\n );\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n $res = $stmt->get_result();\n $result['body']['count'] = $res->num_rows;\n if ($res->num_rows > 0){\n $result['status'] = \"Categories read \";\n while($row = $res->fetch_assoc()){\n $data = array(\n \"id\" => $row[\"id\"],\n \"category_name\" => $row['categoryName']\n );\n array_push($result['body']['categories'], $data);\n }\n } else {\n $result['status'] = \"No categories found \";\n }\n return $result;\n }",
"public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }",
"private function getAllCategories()\n {\n $query = Queries::$getAllCategories;\n\n try {\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n $this->successResponse($result);\n } catch (\\PDOException$e) {\n $this->errorResponse($e->getMessage());\n }\n }",
"public function getCategoriesGroup() {\n\t\t$imageTypes = $this->getImagesTypes();\n\t\t$categories = $this->getCollection()\n\t\t\t\t->addFieldToFilter('status',1);\n\t\t$arrayOptions = array();\n\t\t$i = 1;\n\t\tforeach($imageTypes as $key => $imageType)\n\t\t{\n\t\t\tif($key == 'uncategorized')\n\t\t\t{\n\t\t\t\t$arrayOptions[0] = 'Uncategorized';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arrayValue = array();\n\t\t\tforeach($categories as $category)\n\t\t\t{\n\t\t\t\tif($category->getImageTypes() == $key)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$arrayValue[] = array('value'=>$category->getId(),'label'=>$category->getTitle());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayOptions[$i]['value'] = $arrayValue;\n\t\t\t$arrayOptions[$i]['label'] = $imageType;\n\t\t\t$i++;\n\t\t}\n\t\treturn $arrayOptions;\n\t}",
"function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function getCategories(){\r\n\t\trequire_once(\"AffiliateUserGroupPeer.php\");\r\n \trequire_once(\"AffiliateGroupCategoryPeer.php\");\r\n \t$sql = \"SELECT \".AffiliateCategoryPeer::TABLE_NAME.\".* FROM \".AffiliateUserGroupPeer::TABLE_NAME .\" ,\".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::TABLE_NAME .\", \".AffiliateCategoryPeer::TABLE_NAME .\r\n\t\t\t\t\t\t\" where \".AffiliateUserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\r\n\t\t\t\t\t\tAffiliateUserGroupPeer::GROUPID .\" = \".AffiliateGroupCategoryPeer::GROUPID .\" and \".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::CATEGORYID .\" = \".AffiliateCategoryPeer::ID .\" and \".\r\n\t\t\t\t\t\tAffiliateCategoryPeer::ACTIVE .\" = 1\";\r\n \t\r\n \t$con = Propel::getConnection(AffiliateUserPeer::DATABASE_NAME);\r\n $stmt = $con->createStatement();\r\n $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); \r\n return BaseCategoryPeer::populateObjects($rs);\r\n }",
"public function get_categories()\n {\n $param = array(\n 'delete_flg' => $this->config->item('not_deleted','common_config')\n );\n $groups = $this->get_tag_group();\n\n if (empty($groups)) return array();\n\n $group_id = array_column($groups, 'tag_group_id');\n $param = array_merge($param, array('group_id' => $group_id));\n\n $tags = $this->Logic_tag->get_list($param);\n\n return $this->_generate_categories_param($groups, $tags);\n }",
"public function allCategoriesAllCountry() {\n $allnews = array();\n // $data = Newsdata::where('created_at', '<=', Carbon::now()->subDays(5)->toDateTimeString ())->get(); //Older than today\n // $data = Newsdata::where('created_at', '>=', Carbon::now()->subDays(2)->toDateTimeString ())->get(); //Younger than today\n // return $data;\n \n array_push($allnews, Newsdata::inRandomOrder()->get() );\n array_push($allnews, Business::inRandomOrder()->get() );\n array_push($allnews, Entertainment::inRandomOrder()->get() );\n array_push($allnews, Health::inRandomOrder()->get() );\n array_push($allnews, Science::inRandomOrder()->get() );\n array_push($allnews, Sport::inRandomOrder()->get() );\n array_push($allnews, Technology::inRandomOrder()->get() );\n\n $news = array();\n $news = $this->sortNewsIntoSingleArray($allnews);\n return $news;\n }",
"public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }",
"public function getAll(): Collection\n {\n return $this->categoryRepository->getAll();\n }",
"public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public function categories()\n {\n return $this->morphedByMany(\n Category::class,\n 'metable'\n );\n }",
"public function findAllCategories(): iterable;",
"public function loadAllCategories() {\n\t\t$sql = \"SELECT * FROM categories_grumble ORDER BY category_name ASC\";\n\t\t$this->db->query($sql);\n\t\treturn $this->db->rows();\n\t}",
"public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}",
"public function getCategoriesAndParents() {\n\t\t$cats = array();\n\t\tif ($this->categories) {\n\t\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['camaliga']);\n\t\t\t$catMode = intval($configuration[\"categoryMode\"]);\n\t\t\t$lang = intval($GLOBALS['TSFE']->config['config']['sys_language_uid']);\n\t\t\t// Step 1: select all categories of the current language\n\t\t\t$categoriesUtility = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('\\quizpalme\\Camaliga\\Utility\\AllCategories');\n\t\t\t$all_cats = $categoriesUtility->getCategoriesarrayComplete();\n\t\t\t// Step 2: aktuelle orig_uid herausfinden\n\t\t\t$orig_uid = intval($this->getUid());\t// ist immer die original uid (nicht vom übersetzten Element!)\n\t\t\tif ($lang > 0 && $catMode == 0) {\n\t\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid',\n\t\t\t\t\t\t'tx_camaliga_domain_model_content',\n\t\t\t\t\t\t'deleted=0 AND hidden=0 AND sys_language_uid=' . $lang . ' AND t3_origuid=' . $orig_uid);\n\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4))\n\t\t\t\t\t\tif ($row['uid']) {\n\t\t\t\t\t\t\t$orig_uid = intval($row['uid']);\t// uid of the translated element\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t\t}\n\t\t\t// Step 3: get the mm-categories of the current element (from the original or translated element)\n\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_local',\n\t\t\t\t'sys_category_record_mm',\n\t\t\t\t\"tablenames='tx_camaliga_domain_model_content' AND uid_foreign=\" . $orig_uid);\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4)){\n\t\t\t\t\t$uid = $row['uid_local'];\n\t\t\t\t\tif (!isset($all_cats[$uid]['parent'])) continue;\n\t\t\t\t\t$parent = (int) $all_cats[$uid]['parent'];\n\t\t\t\t\t//if (!$all_cats[$parent]['title'])\tcontinue;\n\t\t\t\t\tif (!isset($cats[$parent])) {\n\t\t\t\t\t\t$cats[$parent] = array();\n\t\t\t\t\t\t$cats[$parent]['childs'] = array();\n\t\t\t\t\t\t$cats[$parent]['title'] = $all_cats[$parent]['title'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($all_cats[$uid]['title'])\n\t\t\t\t\t\t$cats[$parent]['childs'][$uid] = $all_cats[$uid]['title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t}\n\t\treturn $cats;\n\t}",
"public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}",
"function get_categories_by_channel()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('channel_id'), array(\n\t\t\t'select' => array(),\n\t\t\t'where' => array(),\n\t\t\t'order_by' => 'cat_order',\n\t\t\t'sort' => 'asc',\n\t\t\t'limit' => FALSE,\n\t\t\t'offset' => 0\n\t\t));\n\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_channel_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_channel_categories($vars['channel_id'], $vars['select'], $vars['where'], $vars['order_by'], $vars['sort'], $vars['limit'], $vars['offset'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_channel_end', $data);\n\n\t\t$this->response($data);\n\t}",
"protected function getCategories()\n {\n if (! is_null($this->categories)) {\n return $this->categories;\n }\n\n $categories = $this->app['sanatorium.categories.category']->findAll();\n\n foreach ($categories as $category) {\n $category->uri = $category->url === '/' ? null : $category->url;\n }\n\n return $this->categories = $categories;\n }",
"function get_all_category(){\n $cat_args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n\n );\n $all_category = get_categories( $cat_args );\n\n return $all_category;\n }",
"public function getCategories($language = null) {\n global $db, $langval;\n if ($language === null) $language = $langval;\n $arCategories = $db->fetch_table(\"SELECT el.*, s.T1, s.V1, s.V2 FROM `kat` el\n LEFT JOIN `string_kat` s ON s.S_TABLE='kat' AND s.FK=el.ID_KAT\n AND s.BF_LANG=if(el.BF_LANG_KAT & \".$language.\", \".$language.\", 1 << floor(log(el.BF_LANG_KAT+0.5)/log(2)))\n WHERE ROOT=1 AND B_VIS=1 AND KAT_TABLE='\".$this->tableName.\"'\n ORDER BY el.ORDER_FIELD\");\n return $arCategories;\n }",
"public function getCategories(){\n return Category::get();\n }",
"public function get_current($by_group = FALSE)\n {\n if ( !ee()->publisher_setting->enabled())\n {\n return array();\n }\n\n // @todo - cache\n if(FALSE)\n {\n\n }\n else if (isset(ee()->session->cache['publisher']['all_categories']))\n {\n if ($by_group)\n {\n return ee()->session->cache['publisher']['all_categories'][$by_group];\n }\n else\n {\n return ee()->session->cache['publisher']['all_categories'];\n }\n }\n else\n {\n // Grab the custom fields. We don't need field_id_N in our templates\n $fields = $this->get_custom_fields();\n\n $field_select_default = array();\n $field_select_custom = array();\n\n foreach ($fields as $name => $field)\n {\n if (preg_match('/field_id_(\\d+)/', $name, $matches))\n {\n $field_select_default[] = 'cfd.'. $name .' AS \\''. $field->field_name.'\\'';\n $field_select_custom[] = $name .' AS \\''. $field->field_name.'\\'';\n }\n }\n\n $qry = ee()->db->select('c.*, '. implode(',', $field_select_default))\n ->from('categories AS c')\n ->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n ee()->session->cache['publisher']['all_categories'] = array();\n ee()->session->cache['publisher']['translated_categories'] = array();\n\n foreach ($qry->result_array() as $category)\n {\n ee()->session->cache['publisher']['all_categories'][$category['group_id']][$category['cat_id']] = $category;\n }\n\n $where = array(\n 'publisher_lang_id' => ee()->publisher_lib->lang_id,\n 'publisher_status' => ee()->publisher_lib->status,\n 'site_id' => ee()->publisher_lib->site_id\n );\n\n $qry = ee()->db->select('*, '. implode(',', $field_select_custom))\n ->from('publisher_categories')\n ->where($where)\n ->get();\n\n foreach ($qry->result_array() as $category)\n {\n ee()->session->cache['publisher']['translated_categories'][$category['group_id']][$category['cat_id']] = $category;\n }\n\n foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)\n {\n foreach ($group as $cat_id => $category)\n {\n if (isset(ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id]))\n {\n foreach (ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id] as $field_name => $field_value)\n {\n if ($field_value != '')\n {\n ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][$field_name] = $field_value;\n }\n }\n }\n }\n }\n\n foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)\n {\n foreach ($group as $cat_id => $category)\n {\n foreach ($category as $field => $value)\n {\n ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][str_replace('cat_', 'category_', $field)] = $value;\n }\n }\n }\n\n if ($by_group)\n {\n return ee()->session->cache['publisher']['all_categories'][$by_group];\n }\n else\n {\n return ee()->session->cache['publisher']['all_categories'];\n }\n }\n }",
"public static function getAllCategories() {\n\t\t\t$db = Db::getInstance();\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description\n\t\t\t\t\t\t\t\t\t\t\t FROM categories\n\t\t\t\t\t\t\t\t\t\t ORDER BY location\n\t\t\t\t\t\t\t\t\t\t');\n\t\t\t\t$categoryQuery->execute();\n\t\t\t$allCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allCategories;\n\t\t}",
"public function getAllCategories()\n {\n return $this->AllChildren()->filter('ClassName', PortfolioCategory::class);\n }",
"function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }",
"public function getAllCategories() {\n $q = $this->db->get('categories');\n if ($q->num_rows() > 0) {\n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }",
"public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}",
"public static function getCategories(){\n $categories = Category::all()->toArray();\n\n return $categories;\n }",
"public function all()\n {\n return $this->category->all();\n }",
"function getCategories()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('alias') . ',' .\n\t\t\t$this->db->nameQuote('id') . ',' .\n\t\t\t$this->db->nameQuote('name') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') .\n\t\t\t' WHERE ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' AND ' . $this->db->nameQuote('id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('trash') . ' = ' . $this->db->quote('0') .\n\t\t\t' ORDER BY ' . $this->db->nameQuote('ordering') . ' ASC';\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObjectList();\n\t}",
"public function getAllCategories() {\n $allCategories= $this->getCategories(); \n foreach ($allCategories as $value){\n $value->setChildren($this->getSubCategories($value->getId()));\n }\n return $allCategories;\n \n }",
"public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }",
"public function all() : Collection\n {\n return Category::all();\n }",
"function get_all_courses_category_wise($category)\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.seo_url', $category);\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n // return $this->db->last_query();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }",
"public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }",
"private function groupByCategory(){\n \n $searchResults = null;\n $items = $this->items; \n \n foreach($items as $item){\n foreach($item->categories as $category_tmp){ \n $searchResults[$category_tmp][] = $item;\n } \n }\n \n return $searchResults;\n }",
"public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }",
"public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }",
"public function findCategories();",
"public function getAllCategories() {\n\n if (!isset(parent::all()[0])) {\n return [];\n }\n return parent::all()[0]->children;\n }",
"function get_all_category_objects_by_id() {\n\tglobal $categories_by_id;\n\tif (empty($categories_by_id)) {\n\t\t$categories_by_id = array();\n\t\tforeach (get_categories(\"hide_empty=0\") as $category_object) {\n\t\t\t$categories_by_id[$category_object->term_id] = $category_object;\n\t\t}\n\t}\n\treturn $categories_by_id;\n}",
"public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}",
"public function getCategories() : array;",
"function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}",
"public static function get_categories($filter) {\n\t\t$query = DB::table(self::$table.' AS t1')\n\t\t\t->leftjoin('tbl_user AS t2', 't1.user_id', '=', 't2.id')\n\t\t\t->select('t1.*', 't2.name AS user_name')\n\t\t\t->orderBy('t1.created_at', 'DESC');\n\t\tif (isset($filter) && !blank($filter)) {\n\t\t\t$query = self::conditions_for_category($filter, $query);\n\t\t}\n\n\t\t$categories = parent::paginate($filter, $query);\n\t\treturn $categories;\n\t}",
"public static function getCategories($conditions='1',&$messages=\"\"){\n $messages=new Message();\n $result=Db::select(CATEGORY_TABLE_NAME,$conditions);\n if($result){\n return $result;\n }\n $messages->setErrorMessage(ERR_GET_CATEGORIES_COLLECTION);\n return false;\n }",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"public function getCategories(): Collection\n {\n return $this->model->categories()->get();\n }",
"public function getCategories()\n {\n return CategoryResource::collection(Category::with('products')->get())\n ->response()\n ->setStatusCode(200);\n }",
"public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }",
"public function get_categories() {\n return array ( 'general' );\n }",
"public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}",
"public function listCategories() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'categories', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"category_pk\",\n\t\"category_name\",),\n\t\"returns\" => array(\n\t\"categoryPK\",\n\t\"categoryName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}",
"public function getCategoriesWithImages() {\n return $this->categoryMapper->fetchCategoriesWithImages();\n }",
"public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }",
"private function fetchAllCategories()\n {\n $sql = '\n SELECT * FROM Rm_Category;\n ';\n\n $res = $this->db->executeSelectQueryAndFetchAll($sql);\n\n $categoriesArray = array();\n foreach ($res as $key => $row) {\n $name = $row->name;\n $categoriesArray[] = $name;\n }\n\n return $categoriesArray;\n }",
"public function get_categories() {\n\t\treturn [ 'general' ];\n\t}",
"public function get_categories() {\n\t\treturn [ 'general' ];\n\t}",
"public function get_categories() {\n\t\treturn [ 'general' ];\n\t}",
"public function getCategories() {\n $sql = sprintf(\"SELECT * FROM category c WHERE EXISTS (SELECT * FROM project_category pc WHERE pc.project_id = %d AND pc.category_id = c.id)\", $this->id);\n $categories = array();\n $results = self::$connection->execute($sql);\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\n }",
"public static function getAll() {\n self::checkConnection();\n $results = self::$connection->execute(\"SELECT * FROM category;\");\n $categories = array();\n foreach ($results as $category_arr) {\n array_push($categories, new Category($category_arr));\n }\n return $categories;\n }",
"public function get(){\n\n $tabla = \"categorias\";\n \n $respuesta = ModeloCategorias::get($tabla);\n \n return $respuesta; \n }",
"public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }",
"public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }",
"public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}",
"function getCategoriesAll($limit, $offset=0) {\n $this->db->select(\"*\");\n\t\t$this->db->limit($limit, $offset);\n $query = $this->db->get('post_category');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }",
"public function allCategories (){\n\n $categories = Category::orderBy('id','desc')->get();\n return response()->json([\n 'categories'=>$categories\n ],200);\n }",
"public function get_all_categories()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('category');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"public function fetchCategories(Request $request): JsonResponse\n {\n $key = config('netcore.module-forum.used_category_group.key', 'forum');\n\n $categories = CategoryGroup::where('key', $key)->firstOrFail()->categories;\n $categories->load('descendants');\n\n $disabledIDs = (array)$request->get('disable');\n $results = [];\n $i = 0;\n\n $categories->each(function (Category $category) use ($disabledIDs, &$results, &$i) {\n if ($category->isRoot() && $i) {\n $results[] = [\n 'id' => 0,\n 'text' => str_repeat('-', 100),\n 'disabled' => true,\n ];\n }\n\n $results[] = [\n 'id' => $category->id,\n 'text' => $category->getChainedNameAttribute(),\n 'disabled' => in_array($category->id, $disabledIDs),\n ];\n\n $i++;\n });\n\n return response()->json([\n 'results' => $results,\n 'pagination' => [\n 'more' => false,\n ],\n ]);\n }",
"public function get_translations($cat_id = FALSE, $group_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $lang_id = FALSE)\n {\n if ( !$cat_id)\n {\n show_error('$cat_id is required. publisher_category.php->get_translations()');\n }\n\n if ( !$group_id)\n {\n show_error('$group_id is required. publisher_category.php->get_translations()');\n }\n\n $categories = array();\n $translations = array();\n\n $where = array(\n 'publisher_status' => $status,\n 'cat_id' => $cat_id,\n 'site_id' => ee()->publisher_lib->site_id\n );\n\n $qry = ee()->db->from('publisher_categories')\n ->where($where)\n ->get();\n\n foreach ($qry->result() as $row)\n {\n $categories[$row->publisher_lang_id] = $row;\n }\n\n if ($lang_id)\n {\n $translations[$lang_id] = isset($categories[$lang_id]) ? $categories[$lang_id] : $categories[ee()->publisher_lib->default_lang_id];\n }\n else\n {\n $fields = $this->get_custom_fields($group_id);\n\n $field_select_default = array();\n\n foreach ($fields as $name => $field)\n {\n if (preg_match('/field_id_(\\d+)/', $name, $matches))\n {\n $field_select_default[] = 'cfd.'. $name;\n }\n }\n\n foreach ($this->get_enabled_languages() as $lid => $language)\n {\n // If we have existing category data\n if (isset($categories[$lid]))\n {\n $translations[$lid] = $categories[$lid];\n }\n // If the language ID in the loop is what our current default lang is\n elseif ($lid == ee()->publisher_lib->default_lang_id)\n {\n $default_qry = ee()->db->select('c.*, '. implode(',', $field_select_default))\n ->from('categories AS c')\n ->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')\n ->where('c.cat_id', $cat_id)\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n $default_category = (object) array();\n\n // Kind of silly, but NULL values in the DB don't work when accessing\n // the property value, e.g. $category->$field_name will throw an error.\n foreach ($default_qry->row() as $field => $value)\n {\n $default_category->$field = $value === NULL ? '' : $value;\n }\n\n $translations[$lid] = $default_category;\n }\n // The category has not been translated yet, so create the vars\n // with an empty translation value so the view doesn't bomb.\n else\n {\n $categories[$lid] = new stdClass();\n\n // Make sure our object has the same properties, but blank,\n // as a translated entry.\n foreach ($fields as $file_name => $field_data)\n {\n $categories[$lid]->$file_name = '';\n }\n\n $categories[$lid]->cat_id = $cat_id;\n $categories[$lid]->publisher_lang_id = $lid;\n\n $translations[$lid] = $categories[$lid];\n }\n\n $translations[$lid]->text_direction = $this->get_language($lid, 'direction');\n }\n }\n\n return $translations;\n }",
"public function getAll(){\n\n \t$categorias = $this->db->query(\"SELECT * FROM categorias ORDER BY id_categoria DESC\");\n\n \treturn $categorias;\n }"
] | [
"0.73190933",
"0.6857694",
"0.6663516",
"0.6623863",
"0.6621396",
"0.6543463",
"0.6534717",
"0.64489543",
"0.6350637",
"0.6350637",
"0.62522966",
"0.6251714",
"0.6215646",
"0.617186",
"0.61637235",
"0.6155696",
"0.6131653",
"0.6130057",
"0.6129755",
"0.61287165",
"0.61115795",
"0.61049426",
"0.61026984",
"0.609852",
"0.6076297",
"0.60379535",
"0.60309345",
"0.60309297",
"0.6009653",
"0.60096055",
"0.6000902",
"0.5982733",
"0.5978851",
"0.5975059",
"0.5974787",
"0.5965794",
"0.59595746",
"0.59553707",
"0.59497917",
"0.594897",
"0.59485924",
"0.59423405",
"0.5925412",
"0.59153306",
"0.59084517",
"0.58988035",
"0.58883977",
"0.5886027",
"0.588593",
"0.5882534",
"0.58811605",
"0.58766943",
"0.58628863",
"0.58606404",
"0.58572996",
"0.5855768",
"0.5836341",
"0.5829842",
"0.5826189",
"0.5823103",
"0.581333",
"0.58062744",
"0.5786157",
"0.57856417",
"0.57845324",
"0.577859",
"0.57771736",
"0.57745177",
"0.57659066",
"0.5761117",
"0.5760985",
"0.57588875",
"0.5716562",
"0.5714635",
"0.57026607",
"0.570201",
"0.5689552",
"0.56857264",
"0.5677117",
"0.5672442",
"0.56576616",
"0.56440854",
"0.56370825",
"0.56363875",
"0.5634949",
"0.5633543",
"0.5633543",
"0.5633543",
"0.5629411",
"0.56255937",
"0.562121",
"0.5608738",
"0.5592726",
"0.5589644",
"0.5588838",
"0.5586637",
"0.55842435",
"0.55791605",
"0.55733347",
"0.5572214"
] | 0.62082994 | 13 |
Grab specific category group, and optionally return only the group ID | public function get_group($group_id = FALSE, $return_id = FALSE)
{
// If no category group was specified, get the first one found.
// This is used in the CP Category management landing page.
if (is_numeric($group_id))
{
$qry = ee()->db->where('group_id', $group_id)
->get('category_groups');
}
else
{
$qry = ee()->db->limit(1)->get('category_groups');
}
return $qry->num_rows() ? ($return_id ? $qry->row('group_id') : $qry->row()) : FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public function get_group_category( $group_category = '', $list_id = '' ) {\n $groups = $this->get_group_categories( $list_id );\n if ( empty( $groups ) || empty( $group_category ) ) {\n return false;\n }\n foreach ( $groups as $group ) {\n if ( $group_category == $group->id || $group_category == $group->title ) {\n return $group;\n }\n }\n return false;\n }",
"public function get_group( $group_id = '', $group_category = '', $list_id = '' ) {\n $groups = $this->get_groups( $group_category, $list_id );\n foreach ( $groups as $group ) {\n if ( $group->id == $group_id ) {\n return $group;\n }\n if ( $group->name == $group_id ) {\n return $group;\n }\n }\n return false;\n }",
"function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"function get_group_by_id($group_id) {\n $sql = \"SELECT a.*, portal_nm \n FROM com_group a \n INNER JOIN com_portal b ON a.portal_id = b.portal_id\n WHERE group_id = ?\";\n $query = $this->db->query($sql, $group_id);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }",
"function get_member_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'), array(\n\t\t\t'select' => array()\n\t\t));\n\t\t\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_member_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_member_group($vars['group_id'], $vars['select'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_member_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"function get_group( $id ) {\r\n global $wpdb;\r\n return $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wpc_client_groups WHERE group_id = %d\", $id ), \"ARRAY_A\");\r\n }",
"function MyMod_Data_Group_Def_Get($group,$single=FALSE,$echo=True)\n {\n if ($this->MyMod_Data_Group_Singular($single))\n {\n if (!empty($this->ItemDataSGroups[ $group ]))\n {\n return $this->ItemDataSGroups[ $group ];\n }\n }\n else\n {\n if (!empty($this->ItemDataGroups[ $group ]))\n {\n return $this->ItemDataGroups[ $group ];\n }\n }\n\n if ($echo)\n {\n echo $this->ModuleName.\" Warning: Group $group undefined\";\n $this->AddMsg(\"Warning: Group $group undefined\");\n exit();\n }\n\n return array();\n }",
"public function get_campaigns_by_group( $group = '', $group_category = '', $args = [] ) {\n $campaigns = [];\n $group = $this->get_group( $group, $group_category );\n if ( ! $group || ! isset( $group->id ) ) {\n return $campaigns;\n }\n $all_campaigns = $this->get_campaigns( $args );\n foreach ( $all_campaigns as $campaign ) {\n $in_group = false;\n $conditions = $campaign->recipients->segment_opts->conditions;\n foreach ( $conditions as $condition ) {\n if ( is_array( $condition->value ) && in_array( $group->id, $condition->value ) ) {\n $in_group = true;\n }\n }\n if ( $in_group ) {\n // Remove the _link element\n if ( isset( $campaign->{'_links'} ) ) {\n unset( $campaign->{'_links'} );\n }\n $campaigns[] = $campaign;\n }\n }\n return $campaigns;\n }",
"private function _get_group_detail($tag_group_id){\n $param['tag_group_id'] = $tag_group_id;\n $param['delete_flg'] = $this->config->item('not_deleted','common_config');\n $record = $this->Logic_tag->get_group_detail($param);\n if(!empty($record[0])){\n return $record[0];\n }else{\n return false;\n }\n }",
"public function getById($group_id)\n {\n return $this->getQuery()->eq('id', $group_id)->findOne();\n }",
"public function group($group)\n {\n if (is_numeric($group)) {\n return $this->groupModel->find((int) $group);\n }\n\n return $this->groupModel->where('name', $group)->first();\n }",
"function getGroup() {\n\n\tglobal $db;\n\treturn $db->getGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function get_by_group($formatted = FALSE)\n {\n $groups = $this->get_groups();\n $categories = $this->get_all();\n $grouped = array();\n\n foreach ($groups as $group_id => $group)\n {\n $grouped[$group_id] = array(\n 'value' => $group_id,\n 'label' => $group->group_name\n );\n\n foreach ($categories as $index => $category)\n {\n if ($category->group_id == $group_id)\n {\n $grouped[$group_id]['categories'][] = array(\n 'value' => $category->cat_id,\n 'label' => $category->cat_name\n );\n }\n }\n }\n\n if ( !$formatted)\n {\n return $grouped;\n }\n\n // Leave a blank option other wise the on change event won't work\n $out = '<option value=\"\"></option>';\n\n foreach ($grouped as $group_index => $group)\n {\n $out .= '<optgroup label=\"'. $group['label'] .'\">';\n\n if ( !isset($group['categories'])) continue;\n\n foreach ($group['categories'] as $category_index => $category)\n {\n $url = ee()->publisher_helper_cp->mod_link('categories', array('group_id' => $group['value'] .'#category-'. $category['value']));\n\n $out .= '<option value=\"'. $url .'\">'. $category['label'] .'</option>';\n }\n\n $out .= '</optgroup>';\n }\n\n return $out;\n }",
"function find_group($db, $group_id)\n{\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM groups WHERE id = :group_id;\",\n array(':group_id' => $group_id)\n )->fetchAll();\n if ($records) {\n // groups are unique, there should only be 1 record\n return $records[0];\n }\n return NULL;\n}",
"public function getGroup()\n {\n //Note: group parts are not \"named\" so it's all or nothing\n return $this->_get('_group');\n }",
"function get_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->get($id);\n\t}",
"public static function get($group);",
"public function getGroup();",
"public function getGroup();",
"public function getGroup();",
"public function getGroup()\n {\n $this->getParam('group');\n }",
"public function group($group);",
"function acf_get_field_group($id = 0)\n{\n}",
"public function findOneByIdJoinedCategoryGroup($categoryGroupId)\n {\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT c, cg FROM category c \n JOIN c.categoryGroup cg\n WHERE c.id= :id'\n )\n ->setParameter('id', $categoryGroupId);\n\n return $query->getSingleResult();\n }",
"public function findGroupId($group) {\r\n\t\t\r\n\t\t$group = strtolower(preg_replace('/[^\\w\\-]/','', $group));\r\n\t\t\r\n\t\tGLOBAL $wgYammerCacheDir;\r\n\t\t\r\n\t\t# Authentication tests\r\n\t\tif(!$this->isOAuthAuthenticated()) {\r\n\t\t\treturn $this->performAuth();\r\n\t\t}\r\n\t\tif(empty($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please specify <code>$wgYammerCacheDir</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\tif(!is_dir($wgYammerCacheDir)) {\r\n\t\t\treturn $this->createErrorResponse('Please make sure that <code>$wgYammerCacheDir</code> as defined in your LocalSettings.php exists and is a directory. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# Try and see if the id is available in cache\r\n\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($group). '.txt';\r\n\t\tif(is_file($file)) {\r\n\t\t\treturn file_get_contents($file);\r\n\t\t}\r\n\t\t\r\n\t\t# Cache miss, we are going to process the groups list until the group is found\r\n\t\t\r\n\t\t$letter = strtolower(substr($group, 0, 1));\r\n\t\t$page = 0;\r\n\t\t\r\n\t\twhile(true) {\r\n\t\t\t$url = sprintf(self::YAMMER_URI_GROUPS_BY_LETTER, $letter, $page);\r\n\t\t\t$body = $this->signedRequest($url);\r\n\t\t\t\r\n\t\t\t# Make sure there are groups in the response\r\n\t\t\tif(false === stripos($body, '<id>')) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t# Try and parse the groups. \r\n\t\t\tif(!preg_match_all('#<response>(.*?)</response>#ims', $body, $m)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Process each group\r\n\t\t\tforeach($m[1] as $responseBody) {\r\n\t\t\t\t# Fetch group name and group id\r\n\t\t\t\t$name = preg_match('#<name>(.*?)</name>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t$id = preg_match('#<id>(.*?)</id>#i', $responseBody, $m) ? $m[1] : '';\r\n\t\t\t\t\r\n\t\t\t\t# Skip this response if either name or id is empty\r\n\t\t\t\tif(empty($name) || empty($id)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# Create a cache file with the group id\r\n\t\t\t\t$file = $wgYammerCacheDir . DIRECTORY_SEPARATOR . 'group-'.strtolower($name).'.txt';\r\n\t\t\t\tif(!is_file($file)) {\r\n\t\t\t\t\t$f = fopen($file, 'w');\r\n\t\t\t\t\tfwrite($f, $id);\r\n\t\t\t\t\tfclose($f);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# We found the correct group\r\n\t\t\t\tif($name == strtolower($group)) {\r\n\t\t\t\t\treturn $id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# Increase page number\r\n\t\t\t$page++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Group with name \"'.$group.'\" was not found');\r\n\t}",
"function MyMod_Data_Group_Actual_Get()\n {\n $this->PostInitItems();\n\n if (!empty($this->CurrentDataGroup))\n {\n $group=$this->CurrentDataGroup;\n }\n else\n {\n $group=$this->GetCGIVarValue($this->GroupDataCGIVar());\n }\n\n $groups=$this->MyMod_Data_Group_Defs_Get();\n if (!preg_grep('/^'.$group.'$/',array_keys($groups)))\n {\n $group=\"\";\n }\n\n if (\n empty($group)\n ||\n !$this->MyMod_Item_Group_Allowed($groups[ $group ])\n )\n {\n //No group found (or group found was not allowed)\n //Localize first allowed data group\n foreach ($groups as $rgroup => $groupdef)\n {\n if ($this->MyMod_Item_Group_Allowed($groups[ $rgroup ]))\n {\n $group=$rgroup;\n break;\n }\n }\n }\n\n return $group;\n }",
"function group_id($group_id=null)\n {\n if (isset($group_id)) {\n $this->group_id = intval($group_id);\n }\n return $this->group_id;\n }",
"protected function GetGroup() {\r\n\t\t\treturn $this->group;\r\n\t\t}",
"public function getGroup($group, &$name = NULL, &$description = NULL): int {\n\t\t$this->getAttributes();\n\t\tif(!is_numeric($group))\n\t\t\t$group = $this->cachedAttributeGroupNames2ID[ strtolower($group) ] ?? -1;\n\t\t$g = $this->cachedAttributeGroups[$group] ?? NULL;\n\t\t$name = $g[\"name\"] ?? NULL;\n\t\t$description = $g[\"description\"] ?? NULL;\n\t\treturn $group;\n\t}",
"function GetGroup ($id) {\n $path = REST_PATH . 'groups/' . $id . '.xml';\n\n // Call Rest API\n $result = CallRestApi($path);\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n\n return $xml;\n}",
"public function getGroup($groupId);",
"public abstract function getGroup();",
"function get_user_group($group_id)\n {\n $user_group = $this->db->query(\"\n SELECT\n *\n\n FROM\n `groups`\n\n WHERE\n `gro_id` = ?\n \",array($group_id))->row_array();\n \n return $user_group;\n }",
"public static function get_by_group(Group_DO $group){\n \n global $wpdb;\n $collections = array();\n \n $sql = \"SELECT id FROM \" . self::get_table_name() . \" WHERE group_id=\" \n . $group->get_id();\n \n $results = $wpdb->get_results($sql);\n \n foreach( $results as $row ){\n $collections[$row->id] = new Affiliation_Collection_DO($row->id);\n }\n \n return $collections;\n }",
"public function getGroup($id = null)\n {\n $res = $this->db->select(\"SELECT * FROM `{$this->domainGroup}` WHERE itemName()='{$id}'\", array('ConsistentRead' => 'true'));\n $this->logErrors($res);\n if(isset($res->body->SelectResult->Item))\n return self::normalizeGroup($res->body->SelectResult->Item);\n else\n return false;\n }",
"function getAllTestCategoriesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentGroupID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryGroupID'], $clientID);\n\n //First, we need get all the categories that has the parent groupID\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentGroupID, 'value' => $groupID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}",
"private function getCategories($groupID = null)\n {\n $this->db->select('*', '`bf_categories`')\n ->where('`visible` = 1' . \n ($groupID ? ' AND `category_group_id` = \\'' . intval($groupID) . '\\'' : ''))\n ->order('name', 'asc')\n ->execute();\n \n // Collect categories\n $categoryCollection = array();\n while($category = $this->db->next())\n {\n // Get image\n $image = $this->parent->db->getRow('bf_images', $category->image_id);\n \n // No image?\n if(!$image)\n {\n // Default image\n $imageURL = \n $this->parent->config->get('com.b2bfront.site.default-image', true);\n }\n else\n {\n $imageURL = Tools::getImageThumbnail($image->url);\n }\n \n $categoryCollection[] = array(\n 'name' => $category->name,\n 'id' => $category->id,\n 'url' => $imageURL\n );\n }\n \n return $categoryCollection;\n }",
"public function groupsGet($group_id = '') {\n\t\t$url = 'groups';\n\t\tif (!empty($group_id)) {\n\t\t\t$url .= '/';\n\t\t\tif (is_string($group_id)) {\n\t\t\t\t$url .= '=';\n\t\t\t\t$group_id = urlencode(urlencode($group_id));\n\t\t\t}\n\t\t\t$url .= $group_id;\n\t\t}\n\t\t$output = $this->get($url);\n\t\treturn $this->parseOutput($output);\n\t}",
"function Inscription_Handle_Collaborations_Group($group)\n {\n if (empty($group)) { $group=\"Collaborations\"; }\n \n if (empty($this->ItemDataSGroups[ $group ]))\n {\n $this->ItemDataSGroups[ $group ]=\n $this->ReadPHPArray(\"System/Inscriptions/SGroups.\".$group.\".php\");\n }\n\n return $group;\n }",
"private function getGroupFromDatabase($group)\n {\n $fields = array('id');\n $rows = $this->getDatabase()->getRecords($fields, 'nntp_group', array('name' => $group), '', '', 1);\n\n $row = false;\n if (count($rows) === 1) {\n $row = array_shift($rows);\n unset($rows);\n }\n\n return $row;\n }",
"function getAllTestCasesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside group\n $onlyIds = getAllTestCategoriesInsideAGroup($groupID, $clientID);\n\n //Next, create a string with all the categories inside the group\n $toFilter = implode(',', $onlyIds);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $allTestCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($allTestCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}",
"public function getAttributeGroup($id)\n { \n if (\\Gate::allows('isAdminOrMerchant')) { \n \n return AttributeGroup::latest()->where('merchant_id',Auth::user()->userable_id)->where('id',$id)->first();\n } \n }",
"public function getGroup($group_id, $join_group_type = false) {\n\t\t$q = SQLQuery::create()->select(\"StudentsGroup\")->where(\"id\", $group_id);\n\t\tif ($join_group_type) \n\t\t\t$q->join(\"StudentsGroup\",\"StudentsGroupType\",array(\"type\"=>\"id\"))\n\t\t\t\t->fieldsOfTable(\"StudentsGroup\")\n\t\t\t\t->field(\"StudentsGroupType\", \"name\", \"group_type_name\")\n\t\t\t\t;\n\t\treturn $q->executeSingleRow();\n\t}",
"function getGroup() ;",
"public function getIdGroup()\n {\n return $this->groupid;\n }",
"protected function getGroupFromGroup($name, $group)\n {\n if (isset($group->groups)) {\n foreach ($group->groups as $group2) {\n if ($group2->name == $name) {\n return $group2;\n }\n }\n }\n\n if (isset($group->groups)) {\n foreach ($group->groups as $group2) {\n $group3 = $this->getGroupFromGroup($name, $group2);\n\n if ($group3 !== null) {\n return $group3;\n }\n }\n }\n\n return null;\n }",
"public function getGroup() {\n\t\tif (empty($this->group)) {\n\t\t\t$this->group = $this->groupsTable->findById($this->groupId);\n\t\t}\n\t\treturn $this->group;\n\t}",
"public function get_group( $group_id ) {\n $g = $this->call( 'groupGet', [\n 'groupId' => $group_id,\n ] );\n\n return isset( $g ) && $g != false ? $g->group : false;\n }",
"public function getDetails($group_id);",
"public function getGroupid()\n {\n return $this->groupid;\n }",
"function fetchGroupDetails($group_id) {\n try {\n global $db_table_prefix;\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT\n id,\n name,\n is_default,\n can_delete,\n home_page_id\n FROM \".$db_table_prefix.\"groups\n WHERE\n id = :group_id\n LIMIT 1\";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[':group_id'] = $group_id;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n if (!($results = $stmt->fetch(PDO::FETCH_ASSOC)))\n return false;\n\n $stmt = null;\n\n return $results;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}",
"function &getById($groupId, $assocType = null, $assocId = null) {\n\t\t$params = array((int) $groupId);\n\t\tif ($assocType !== null) {\n\t\t\t$params[] = (int) $assocType;\n\t\t\t$params[] = (int) $assocId;\n\t\t}\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT * FROM groups WHERE group_id = ?' . ($assocType !== null?' AND assoc_type = ? AND assoc_id = ?':''), $params\n\t\t);\n\n\t\t$returner = null;\n\t\tif ($result->RecordCount() != 0) {\n\t\t\t$returner =& $this->_returnGroupFromRow($result->GetRowAssoc(false));\n\t\t}\n\t\t$result->Close();\n\t\tunset($result);\n\t\treturn $returner;\n\t}",
"function acf_get_field_group( $id = 0 ) {\n\treturn acf_get_internal_post_type( $id, 'acf-field-group' );\n}",
"function group_by_id($id)\n{\n\t$db = Database::getInstance();\n\t$group = $db->query(\n\t\t\"select * from {chatgroup} where groupid = ?\",\n\t\tarray($id),\n\t\tarray('return_rows' => Database::RETURN_ONE_ROW)\n\t);\n\treturn $group;\n}",
"public function get_first_group()\n {\n return ee()->db->select('MIN(group_id) AS group_id')\n ->get('category_groups')\n ->row('group_id');\n }",
"function getGroupId($group)\n {\n return '';\n }",
"function acf_get_raw_field_group($id = 0)\n{\n}",
"public function group(string $group);",
"function get_this_group($grp_id)\n{\n\t$db=new db_util();\n\t$query_string=\"SELECT * FROM vm_group WHERE v_group_id=$grp_id\";\n\t$result=$db->query($query_string);\n\treturn $result;\n}",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"public function getGroup()\n {\n return $this->group;\n }",
"private function getCustomGroupId($groupName) {\n\n if (array_key_exists($groupName, $this->customGroupCache)) {\n return $this->customGroupCache[$groupName];\n };\n\n $groupId = civicrm_api3('CustomGroup', 'getvalue', [\n 'name' => $groupName,\n 'return' => 'id',\n ]);\n $this->customGroupCache[$groupName] = $groupId;\n return $groupId;\n }",
"public function getGroup() {\n return $this->group;\n }",
"public function getGroup() {\n\t\t$ids = $this->getGroupIds();\n\t\treturn MessageGroups::getGroup( $ids[0] );\n\t}",
"function getGroupID($chamberID, $name) {\r\n $sql = $this->db->prepare(\"SELECT groupID FROM GROUPS WHERE chamberID=:chamber_id AND name=:group_name\");\r\n $sql->execute(array(\r\n 'chamber_id' => $chamberID,\r\n 'group_name' => $name,\r\n ));\r\n return $sql->fetch(PDO::FETCH_ASSOC);\r\n }",
"public function getGroup() {}",
"public function getGroup() {}",
"public function getGroup() {}",
"public function getGroup() {}",
"function GetGroupNameById($group_id)\n {\n $this->db->where('id', $group_id);\n $this->db->limit(1);\n $query = $this->db->get('groups');\n if ($query->num_rows()>0) {\n $row = $query->row_array();\n return $row['name'];\n } else {\n return '--';\n }\n }",
"public function findById($group_id);",
"public function set_group($id_group){\n if ( is_int($id_group) ){\n $this->id_group = $id_group;\n }\n return $this;\n }",
"public function getGroup() {\n \tif(count($this->groups))\n \t return $this->groups[0]->getName();\n \telse\n \t return null;\n }",
"function get_group($group_url_name) {\n error_reporting(0);\n \t$api_key = $this->options->get('api_key');\n\t \n \tif (!$api_key || !$group_url_name)\n \t return FALSE;\n\t\n $this->mu_api = new MeetupAPIBase($api_key, 'groups');\n $this->mu_api->setQuery( array('group_urlname' => $group_url_name) ); \n set_time_limit(0);\n $this->mu_api->setPageSize(200);\n \t$this->mu_api->setFormat('json-alt');\n\t\n $group_info = $this->mu_api->getResponse();\n\t\n return (count($group_info->results) > 0) ? $group_info->results[0] : FALSE;\n \n }",
"public function GetGroupVznIdGroup( $iIdGroup )\n\t{\n\t\t$oDb = $this->GetProject()->Db();\n\t\t\n\t\t$oSelect = $oDb\n\t\t\t->select()\n\t\t\t->from( \n\t\t\t\tarray( 'd' => Core_Library_TName::GetVarsetDataGroup( Lmds_Group::GROUP_VARSET_PREFIX ) ),\n\t\t\t\t'id_group' \n\t\t\t)\n\t\t\t->join( array( 'l' => Core_Library_TName::GetPjGroupLink() ), 'd.id_group=l.id_group' )\n\t\t\t// Used to check if group is not a user\n\t\t\t->join( array( 'g' => Core_Library_TName::GetPjGroup() ), 'l.id_group=g.id_group' )\n\t\t\t->where( 'd.id_data=?', $iIdGroup )\n\t\t\t->where( 'l.id_group_parent=?', Lmds_Utils::ROOT_GROUP_ID )\n\t\t\t->where( 'g.id_axis IS NOT NULL');\n\t\t\n\t\t$oResultSet = $oSelect->query();\n\t\t\n\t\tif ( $oResultSet->rowCount() != 1 ) {\n\t\t\tthrow new Core_Library_Exception( \n\t\t\t\tsprintf( 'Uniq group for record not found (found %d group(s))', $oResultSet->rowCount() ) \n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $oResultSet->fetchColumn();\n\t}",
"function get_group_by_name($group_name) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated groups\r\n $sql = \"SELECT id\r\n FROM groups\r\n WHERE is_active = '1'\r\n AND local = '0'\r\n AND name = '$group_name'\r\n ORDER BY name ASC;\";\r\n\r\n $groups_data = array();\r\n $groups = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $groups_data[$key] = $value;\r\n foreach ($groups_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $groups[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $groups;\r\n}",
"function db_get_group($gid)\n{\n\t$dbh = db_connect();\n\n\t$query = sprintf(\"SELECT * FROM `groups` WHERE id=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t$retval = $result->fetch_assoc();\n\n\t// Get the members as well.\n\t// In each group's entry, 'members' is an array listing the\n\t// IDs of members of that group. Positive IDs corresond to\n\t// feeds, and negative IDs correspond to groups.\n\t$query = sprintf(\"SELECT * FROM `group_members` WHERE parent=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\twhile ($row = $result->fetch_assoc())\n\t{\n\t\t$retval['members'][] = $row['member'];\n\t}\n\treturn $retval;\n}",
"function getGroup() {\n \n return null;\n \n }",
"public function findByGroup($group_id) {\n $connection = $this->connect();\n\n if (!$connection) {\n return false;\n }\n\n try {\n $sql = \"SELECT DISTINCT `entry`.`entry_id`, `entry`.`name`, `entry`.`first_name`, `entry`.`street`, `entry`.`zip_code`, `entry`.`city_id`, MIN(`entry`.`is_inherited`) AS 'is_inherited'\n FROM\n (SELECT `entry`.*, 0 AS 'is_inherited'\n FROM `entry` INNER JOIN `group_entry` ON `entry`.`entry_id` = `group_entry`.`entry_id`\n WHERE `group_entry`.`group_id` = $group_id\n UNION\n\n SELECT DISTINCT `entry`.*, 1 AS 'is_inherited'\n FROM `entry` INNER JOIN `group_entry` ON `entry`.`entry_id` = `group_entry`.`entry_id`\n INNER JOIN `group_connector` ON `group_entry`.`group_id` = `group_connector`.`parent_group_id`\n WHERE `group_connector`.`child_group_id` = $group_id) AS `entry`\n GROUP BY `entry`.`entry_id`\n ORDER BY `entry`.`is_inherited`, `entry`.`entry_id`\n \";\n\n $query = $connection->prepare($sql); \n $query->execute();\n\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n\n return $result;\n\n } catch(PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n }\n }",
"function _get_group_tags($group=NULL)\n{\n\t$group_tags=array(\n\t\t'dynamic_front_end'=>array('overlay','random','pulse','ticker','shocker','jumping','sections','big_tabs','tabs','carousel','hide','tooltip'),\n\t\t'dynamic_back_end'=>array('currency','if_in_group'),\n\t\t'structure'=>array('title','contents','include','concepts','concept','staff_note','menu','surround'),\n\t\t'formatting'=>array('list','indent','ins','del','b','u','i','s','sup','sub','size','color','highlight','font','align','left','center','right','abbr','box','quote'),\n\t\t'semantic'=>array('cite','samp','q','var','dfn','address'),\n\t\t'display_code'=>array('php','codebox','sql','code','tt','no_parse'),\n\t\t'execute_code'=>array('semihtml','html'),\n\t\t'media'=>array('flash','img'/*Over complex,'upload','exp_thumb','exp_ref'*/,'thumb'),\n\t\t'linking'=>array('url','email','reference','page','snapback','post','topic')\n\t);\n\n\tif (addon_installed('filedump')) $group_tags['media'][]='attachment';\n\n\t// Non-categorised ones\n\t$all_tags=_get_details_comcode_tags();\n\t$not_found=array();\n\tforeach (array_keys($all_tags[0]+$all_tags[1]) as $tag)\n\t{\n\t\tif (in_array($tag,array('exp_thumb','exp_ref','upload','attachment'))) continue; // Explicitly don't want to allow these (attachment will already be listed if allowed)\n\t\tforeach ($group_tags as $_group)\n\t\t{\n\t\t\tif (in_array($tag,$_group))\n\t\t\t{\n\t\t\t\tcontinue 2;\n\t\t\t}\n\t\t}\n\t\t$not_found[]=$tag;\n\t}\n\t$group_tags['CUSTOM']=$not_found;\n\n\tif ($group!==NULL && array_key_exists($group,$group_tags))\n\t\treturn $group_tags[$group];\n\n\treturn $group_tags;\n}",
"function acf_get_field_group_post($id = 0)\n{\n}",
"protected function _getGroupID($groupName)\n\t{\n\t\tif (!isset($this->_groupList[$groupName])) {\n\t\t\t$group = $this->_pdo->queryOneRow(sprintf('SELECT id FROM groups WHERE name = %s', $this->_pdo->escapeString($groupName)));\n\t\t\t$this->_groupList[$groupName] = $group['id'];\n\t\t}\n\t\treturn $this->_groupList[$groupName];\n\t}",
"function moduleExplodeGroup($group_id, $capability) {\n\tglobal $fmdb, $__FM_CONFIG;\n\t\n\t$return = false;\n\t\n\tif ($capability == 'access_specific_zones') {\n\t\t$group_id = substr($group_id, 2);\n\t\t$domain_sql = \"AND (domain_groups='$group_id' OR domain_groups LIKE '$group_id;%' OR domain_groups LIKE '%;$group_id;%' OR domain_groups LIKE '%;$group_id')\";\n\t\t$result = basicGetList('fm_' . $__FM_CONFIG['fmDNS']['prefix'] . 'domains', 'domain_id', 'domain_', $domain_sql);\n\t\tfor ($x=0; $x<$fmdb->num_rows; $x++) {\n\t\t\t$return[] = $fmdb->last_result[$x]->domain_id;\n\t\t}\n\t}\n\t\n\treturn $return;\n}",
"public function getGroupByName($groupName);",
"private function _getTagGroup()\n {\n $tagGroupId = $this->_getTagGroupId();\n\n if ($tagGroupId !== false) {\n return Craft::$app->getTags()->getTagGroupByUid($tagGroupId);\n }\n\n return null;\n }",
"function achieve_get_main_category()\r\n{\r\n global $sql;\r\n\r\n $main_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, Name FROM achievement_category WHERE ParentID=-1 and ID<>1 ORDER BY `GroupID` ASC\");\r\n while ($main_cat[] = $sql[\"dbc\"]->fetch_assoc($result));\r\n return $main_cat;\r\n}",
"function getGroupIdByName($groupName) {\n $sql = \"SELECT actiongroup_name, actiongroup_id\n FROM %s\n WHERE actiongroup_name = '%s'\";\n $sqlParams = array($this->tableGroups, $groupName);\n $result = NULL;\n if ($res = $this->databaseQueryFmt($sql, $sqlParams)) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $result = $row['actiongroup_id'];\n }\n }\n return $result;\n }",
"public function retrieveGroup($groupId)\n {\n return $this->start()->uri(\"/api/group\")\n ->urlSegment($groupId)\n ->get()\n ->go();\n }",
"protected function groupName($group=null) {\n\t\t$group = is_string($group) ? $group : $this->options['group']; \n\t\treturn $this->sanitize($group); \n\t}",
"private function getAttributeGroup(string $groupName): ?AttributeGroupInterface\n {\n return $this->attributeGroupByName->execute($this->defaultSetId, $groupName);\n }",
"function &getByGroup( $id )\n {\n $this->dbInit();\n $link_array = array();\n $return_array = array();\n \n $this->Database->array_query( $link_array, \"SELECT ID FROM eZLink_Link WHERE LinkGroup='$id' AND Accepted='Y' ORDER BY Title\" );\n\n for( $i=0; $i < count( $link_array ); $i++ )\n {\n $return_array[] = new eZLink( $link_array[$i][ \"ID\" ] );\n }\n\n\n return $return_array;\n }",
"public function GetGroupFromVznIdGroup( $iVznIdGroup )\n\t{\n\t\t$oDb = $this->GetProject()->Db();\n\t\t\n\t\t$oSelect = $oDb\n\t\t\t->select()\n\t\t\t->from(\n\t\t\t\tarray( 'd' => Core_Library_TName::GetVarsetDataGroup( Lmds_Group::GROUP_VARSET_PREFIX ) ),\n\t\t\t\t'id_data'\n\t\t\t)\n\t\t\t->where( 'd.id_group=?', $iVznIdGroup );\n\n\t\t$oResultSet = $oSelect->query();\n\t\t\n\t\tif ( $oResultSet->rowCount() != 1 ) {\n\t\t\tthrow new Core_Library_Exception( \n\t\t\t\tsprintf( 'Uniq group not found (found %d group(s))', $oResultSet->rowCount() ) \n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $oResultSet->fetchColumn();\n\t}",
"public function getGroup($option='')\n {\n global $mysqli;\n\n $groups ='';\n $select_group = $mysqli->query(\"SELECT * FROM groups\");\n while ($fetch_group = $select_group->fetch_assoc()) {\n $selected = \"\";\n if ($fetch_group[\"id\"] == $option)\n $selected = ' selected=\"selected\"';\n\n $groups.= '<option value=\"' . $fetch_group[\"id\"] . '\"' . $selected . '>' . $fetch_group[\"title\"] . '</option>';\n }\n return $groups;\n }",
"public function get_group_selector($course) {\n global $USER, $OUTPUT;\n\n if (!$groupmode = $course->groupmode) {\n return '';\n }\n\n $context = context_course::instance($course->id);\n $aag = has_capability('moodle/site:accessallgroups', $context);\n\n if ($groupmode == VISIBLEGROUPS or $aag) {\n $allowedgroups = groups_get_all_groups($course->id, 0, $course->defaultgroupingid);\n } else {\n $allowedgroups = groups_get_all_groups($course->id, $USER->id, $course->defaultgroupingid);\n }\n\n $activegroup = groups_get_course_group($course, true, $allowedgroups);\n\n $groupsmenu = array();\n if (!$allowedgroups or $groupmode == VISIBLEGROUPS or $aag) {\n $groupsmenu[0] = get_string('allgroups', 'block_user_directory');\n }\n\n if ($allowedgroups) {\n foreach ($allowedgroups as $group) {\n $groupsmenu[$group->id] = format_string($group->name);\n }\n }\n\n $url = $this->userdirectory->get_current_url('group');\n\n if (count($groupsmenu) == 1) {\n $groupname = reset($groupsmenu);\n $output = $groupname;\n } else {\n $select = new single_select($url, 'group', $groupsmenu, $activegroup, null, 'selectgroup');\n $output = $OUTPUT->render($select);\n }\n\n return $output;\n }",
"public function read_by_group()\n {\n // Create query\n $query = '\n SELECT *\n FROM ' . $this->table . ' \n WHERE group_id = ?';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(1, $this->group_id);\n\n // Execute query\n $stmt->execute();\n\n return $stmt;\n }"
] | [
"0.76983947",
"0.7062646",
"0.70292354",
"0.695643",
"0.66145825",
"0.65348166",
"0.64825004",
"0.64241004",
"0.63876474",
"0.63750595",
"0.63022715",
"0.6279023",
"0.62195444",
"0.6212036",
"0.6205768",
"0.6111761",
"0.6104808",
"0.60837454",
"0.6052708",
"0.6052708",
"0.6052708",
"0.6049206",
"0.6043613",
"0.6020259",
"0.60096455",
"0.6005619",
"0.5993001",
"0.59900826",
"0.59864295",
"0.5985097",
"0.59772575",
"0.5965015",
"0.5953485",
"0.5944863",
"0.59437466",
"0.5930513",
"0.5930445",
"0.5914582",
"0.5904736",
"0.59014136",
"0.5895972",
"0.589205",
"0.5883946",
"0.58785427",
"0.58729434",
"0.58684534",
"0.5867177",
"0.58618534",
"0.5850823",
"0.5848283",
"0.5844494",
"0.58436865",
"0.58303356",
"0.5828259",
"0.5821469",
"0.58173",
"0.58171475",
"0.58153135",
"0.57822466",
"0.5781255",
"0.577043",
"0.577043",
"0.577043",
"0.577043",
"0.577043",
"0.577043",
"0.57678086",
"0.5766626",
"0.57638836",
"0.573596",
"0.57325256",
"0.57325256",
"0.57325256",
"0.57325256",
"0.572141",
"0.57137436",
"0.5713673",
"0.5689392",
"0.56808436",
"0.5676172",
"0.5674908",
"0.56564265",
"0.56420135",
"0.5640882",
"0.5635065",
"0.5632345",
"0.5624751",
"0.5622108",
"0.5608843",
"0.56033707",
"0.5602175",
"0.5601052",
"0.5598517",
"0.55932677",
"0.5592931",
"0.55922705",
"0.55909836",
"0.55887425",
"0.5587532",
"0.5587313"
] | 0.7079017 | 1 |
Grab all category groups for the current site | public function get_groups()
{
$qry = ee()->db->where('site_id', ee()->publisher_lib->site_id)
->order_by('group_name', 'asc')
->get('category_groups');
$groups = array();
if ($qry->num_rows())
{
foreach ($qry->result() as $group)
{
$groups[$group->group_id] = $group;
}
}
return $groups;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public function getGroups();",
"public function getGroups();",
"public function getGroups() {}",
"public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}",
"public function getAllGroups();",
"function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"private function _get_groups() {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$groups = [];\n\t\t$page_index = 1;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( \"groups?per_page=100&page=$page_index\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$groups = array_merge( $groups, $response_arr );\n\n\t\t\t$page_index = get_next_page( $response );\n\n\t\t} while ( ! empty( $page_index ) );\n\n\t\treturn $groups;\n\n\t}",
"public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }",
"private function getCategories($groupID = null)\n {\n $this->db->select('*', '`bf_categories`')\n ->where('`visible` = 1' . \n ($groupID ? ' AND `category_group_id` = \\'' . intval($groupID) . '\\'' : ''))\n ->order('name', 'asc')\n ->execute();\n \n // Collect categories\n $categoryCollection = array();\n while($category = $this->db->next())\n {\n // Get image\n $image = $this->parent->db->getRow('bf_images', $category->image_id);\n \n // No image?\n if(!$image)\n {\n // Default image\n $imageURL = \n $this->parent->config->get('com.b2bfront.site.default-image', true);\n }\n else\n {\n $imageURL = Tools::getImageThumbnail($image->url);\n }\n \n $categoryCollection[] = array(\n 'name' => $category->name,\n 'id' => $category->id,\n 'url' => $imageURL\n );\n }\n \n return $categoryCollection;\n }",
"public function groups();",
"public function groups();",
"function getCategories(){\n\t\tif ($this->isAdmin() || $this->isSupervisor())\n\t\t\treturn CategoryQuery::create()->find();\n\n\t\t$sql = \"SELECT \".CategoryPeer::TABLE_NAME.\".* FROM \".UserGroupPeer::TABLE_NAME .\" ,\".\n\t\t\t\t\t\tGroupCategoryPeer::TABLE_NAME .\", \".CategoryPeer::TABLE_NAME .\n\t\t\t\t\t\t\" where \".UserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\n\t\t\t\t\t\tUserGroupPeer::GROUPID .\" = \".GroupCategoryPeer::GROUPID .\" and \".\n\t\t\t\t\t\tGroupCategoryPeer::CATEGORYID .\" = \".CategoryPeer::ID .\" and \".\n\t\t\t\t\t\tCategoryPeer::ACTIVE .\" = 1\";\n\n\t\t$con = Propel::getConnection(UserPeer::DATABASE_NAME);\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\treturn CategoryPeer::populateObjects($stmt);\n\t}",
"protected function getGroupList() {}",
"protected function getGroupList() {}",
"public function getCategories();",
"public function getCategories();",
"public function getGroups()\n\t{\t\t\n\t\t$groups = $this->tax_class->getTerms();\n\t\tforeach ($groups as &$group) \n\t\t{\n\t\t\t$key = md5($group->meta['location_address']);\n\t\t\t$cache = $this->getCache($key);\n\t\t\tif($cache)\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $cache;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $this->getLatLngByAddress($group->meta['location_address']);\n\t\t\t}\n\t\t\t$this->setCache($key, $group->meta['location']);\n\t\t}\n\t\treturn $groups;\n\t}",
"public function getCategoriesGroup() {\n\t\t$imageTypes = $this->getImagesTypes();\n\t\t$categories = $this->getCollection()\n\t\t\t\t->addFieldToFilter('status',1);\n\t\t$arrayOptions = array();\n\t\t$i = 1;\n\t\tforeach($imageTypes as $key => $imageType)\n\t\t{\n\t\t\tif($key == 'uncategorized')\n\t\t\t{\n\t\t\t\t$arrayOptions[0] = 'Uncategorized';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arrayValue = array();\n\t\t\tforeach($categories as $category)\n\t\t\t{\n\t\t\t\tif($category->getImageTypes() == $key)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$arrayValue[] = array('value'=>$category->getId(),'label'=>$category->getTitle());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayOptions[$i]['value'] = $arrayValue;\n\t\t\t$arrayOptions[$i]['label'] = $imageType;\n\t\t\t$i++;\n\t\t}\n\t\treturn $arrayOptions;\n\t}",
"function ajax_get_all_groups() {\r\n global $wpdb;\r\n\r\n $groups = $this->get_groups();\r\n\r\n if ( is_array( $groups ) && 0 < count( $groups ) ) {\r\n\r\n $i = 0;\r\n $n = ceil( count( $groups ) / 5 );\r\n\r\n $html = '';\r\n $html .= '<ul class=\"clients_list\">';\r\n\r\n\r\n\r\n foreach ( $groups as $group ) {\r\n if ( $i%$n == 0 && 0 != $i )\r\n $html .= '</ul><ul class=\"clients_list\">';\r\n\r\n $html .= '<li><label>';\r\n $html .= '<input type=\"checkbox\" name=\"groups_id[]\" value=\"' . $group['group_id'] . '\" /> ';\r\n $html .= $group['group_id'] . ' - ' . $group['group_name'];\r\n $html .= '</label></li>';\r\n\r\n $i++;\r\n }\r\n\r\n $html .= '</ul>';\r\n } else {\r\n $html = 'false';\r\n }\r\n\r\n die( $html );\r\n\r\n }",
"protected function getGroups()\n\t{\n\t\t// Initialize variables.\n\t\t$groups = array();\n\n\t\t// Get the client and client_id.\n\t\t$client = (string) $this->element['client'];\n\t\t$clientId = ($client == 'administrator') ? 1 : 0;\n\n\t\t// Get the database object and a new query object.\n\t\t$db\t\t= JFactory::getDBO();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t// Build the query.\n\t\t$query->select('id, title, template');\n\t\t$query->from('#__template_styles');\n\t\t$query->where('client_id = '.(int) $clientId);\n\t\t$query->order('template');\n\t\t$query->order('title');\n\n\t\t// Set the query and load the styles.\n\t\t$db->setQuery($query);\n\t\t$styles = $db->loadObjectList();\n\n\t\t// Build the grouped list array.\n\t\tforeach($styles as $style) {\n\n\t\t\t// Initialize the group if necessary.\n\t\t\tif (!isset($groups[$style->template])) {\n\t\t\t\t$groups[$style->template] = array();\n\t\t\t}\n\n\t\t\t$groups[$style->template][] = JHtml::_('select.option', $style->id, $style->title);\n\t\t}\n\n\t\t// Merge any additional groups in the XML definition.\n\t\t$groups = array_merge(parent::getGroups(), $groups);\n\n\t\treturn $groups;\n\t}",
"public function groups()\n {\n return $this->groupModel\n ->orderBy('name', 'asc')\n ->findAll();\n }",
"public static function groupList()\n {\n $category = Category::all();\n $array = [];\n foreach ($category->where('category_id', 0) as $parent){\n\n $array[$parent->title] = array();\n\n foreach($parent->children as $attribute) {\n $array[$parent->title][$attribute->id] = $attribute->title;\n }\n }\n\n return $array;\n }",
"public function getGroups(): array;",
"public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }",
"public function getGroupsList(){\n return $this->_get(1);\n }",
"function get_groups() {\r\n global $wpdb;\r\n $groups = $wpdb->get_results( \"SELECT wcg.*, count(wcgc.client_id) as clients_count FROM {$wpdb->prefix}wpc_client_groups wcg LEFT JOIN {$wpdb->prefix}wpc_client_group_clients wcgc ON wcgc.group_id = wcg.group_id GROUP BY wcg.group_id\", \"ARRAY_A\");\r\n return $groups;\r\n }",
"public function getGroupsList(){\n return $this->_get(3);\n }",
"public function getGroupList()\n\t{\n\t\t$db = FabrikWorker::getDbo(true);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('DISTINCT(group_id)')->from('#__{package}_formgroup');\n\t\t$db->setQuery($query);\n\t\t$usedgroups = $db->loadResultArray();\n\t\tJArrayHelper::toInteger($usedgroups);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id AS value, name AS text')->from('#__{package}_groups');\n\t\tif (!empty($usedgroups)) {\n\t\t\t$query->where('id NOT IN('.implode(\",\", $usedgroups) .')');\n\t\t}\n\t\t$query->where('published <> -2');\n\t\t$query->order(FabrikString::safeColName('text'));\n\t\t$db->setQuery($query);\n\t\t$groups = $db->loadObjectList();\n\t\t$list = JHTML::_('select.genericlist', $groups, 'jform[groups]', \"class=\\\"inputbox\\\" size=\\\"10\\\" style=\\\"width:100%;\\\" \", 'value', 'text', null, $this->id . '-from');\n\t\treturn array($groups, $list);\n\t}",
"private function groupByCategory(){\n \n $searchResults = null;\n $items = $this->items; \n \n foreach($items as $item){\n foreach($item->categories as $category_tmp){ \n $searchResults[$category_tmp][] = $item;\n } \n }\n \n return $searchResults;\n }",
"public function findGroups() {\n\t\t\n\t}",
"public static function getAllGroups()\n {\n return ValveGroup::all();\n }",
"function give_get_settings_groups() {\n\n\t$current_section = give_get_current_setting_section();\n\n\treturn apply_filters( 'give_get_groups_' . $current_section, array() );\n}",
"public function getAllGroups() {\n\t\t$groups = $this->group->getAll();\n\t\treturn $groups;\n\t}",
"function get_all_category_ids()\n {\n }",
"public function get_all_groups( $list_id = '' ) {\n $list_id = $this->sanitize_list_id( $list_id );\n $categories = $this->get_group_categories( $list_id );\n $output = [];\n foreach ( $categories as $cat ) {\n if ( ! is_object( $cat ) || ! isset( $cat->id ) ) {\n continue;\n }\n $groups = $this->get_groups( $cat->id, $list_id );\n foreach ( $groups as $group ) {\n $group->category_title = $cat->title;\n }\n $output = array_merge( $output, $groups );\n }\n // Remove the _links element\n foreach ( $output as $item ) {\n if ( isset( $item->_links ) ) {\n unset( $item->_links );\n }\n }\n return $output;\n }",
"public function getAllCategories();",
"public function get_categories()\n {\n $param = array(\n 'delete_flg' => $this->config->item('not_deleted','common_config')\n );\n $groups = $this->get_tag_group();\n\n if (empty($groups)) return array();\n\n $group_id = array_column($groups, 'tag_group_id');\n $param = array_merge($param, array('group_id' => $group_id));\n\n $tags = $this->Logic_tag->get_list($param);\n\n return $this->_generate_categories_param($groups, $tags);\n }",
"public function groups() {\n return $this->hasMany(Group::class, 'category_id');\n }",
"public function addMultipleCategoriesToGroup();",
"function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}",
"public function findCategories();",
"public function getGroups() {\n return parent::getGroups();\n }",
"public function getGroupsList(){\n return $this->_get(4);\n }",
"public function getGroupsList(){\n return $this->_get(4);\n }",
"function getCategories(){\r\n\t\trequire_once(\"AffiliateUserGroupPeer.php\");\r\n \trequire_once(\"AffiliateGroupCategoryPeer.php\");\r\n \t$sql = \"SELECT \".AffiliateCategoryPeer::TABLE_NAME.\".* FROM \".AffiliateUserGroupPeer::TABLE_NAME .\" ,\".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::TABLE_NAME .\", \".AffiliateCategoryPeer::TABLE_NAME .\r\n\t\t\t\t\t\t\" where \".AffiliateUserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\r\n\t\t\t\t\t\tAffiliateUserGroupPeer::GROUPID .\" = \".AffiliateGroupCategoryPeer::GROUPID .\" and \".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::CATEGORYID .\" = \".AffiliateCategoryPeer::ID .\" and \".\r\n\t\t\t\t\t\tAffiliateCategoryPeer::ACTIVE .\" = 1\";\r\n \t\r\n \t$con = Propel::getConnection(AffiliateUserPeer::DATABASE_NAME);\r\n $stmt = $con->createStatement();\r\n $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); \r\n return BaseCategoryPeer::populateObjects($rs);\r\n }",
"function olc_set_groups($categories_id,$shops) {\n\t$products_query=olc_db_query(\"SELECT products_id FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\"\n\twhere categories_id='\".$categories_id.APOS);\n\twhile ($products=olc_db_fetch_array($products_query)) {\n\t\tolc_db_query(SQL_UPDATE.TABLE_PRODUCTS.\" SET group_ids='\".$shops.\"'\n\t\twhere products_id='\".$products['products_id'].APOS);\n\t}\n\t// set status of categorie\n\tolc_db_query(SQL_UPDATE . TABLE_CATEGORIES . \" set group_ids = '\".$shops.\"'\n\twhere categories_id = '\" . $categories_id . APOS);\n\t// look for deeper categories and go rekursiv\n\t$categories_query=olc_db_query(\"SELECT categories_id FROM \".TABLE_CATEGORIES.\"\n\twhere parent_id='\".$categories_id.APOS);\n\twhile ($categories=olc_db_fetch_array($categories_query)) {\n\t\tolc_set_groups($categories['categories_id'],$shops);\n\t}\n\n}",
"public static abstract function getGroupList();",
"function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}",
"public static function getGroupList() {\n $params = $_GET;\n if (isset($params['parent_id'])) {\n // requesting child groups for a given parent\n $params['page'] = 1;\n $params['rp'] = 0;\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n }\n else {\n $requiredParams = [];\n $optionalParams = [\n 'title' => 'String',\n 'created_by' => 'String',\n 'group_type' => 'String',\n 'visibility' => 'String',\n 'component_mode' => 'String',\n 'status' => 'Integer',\n 'parentsOnly' => 'Integer',\n 'showOrgInfo' => 'Boolean',\n 'savedSearch' => 'Integer',\n // Ignore 'parent_id' as that case is handled above\n ];\n $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();\n $params += CRM_Core_Page_AJAX::validateParams($requiredParams, $optionalParams);\n\n // get group list\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n\n // if no groups found with parent-child hierarchy and logged in user say can view child groups only (an ACL case),\n // go ahead with flat hierarchy, CRM-12225\n if (empty($groups)) {\n $groupsAccessible = CRM_Core_PseudoConstant::group();\n $parentsOnly = $params['parentsOnly'] ?? NULL;\n if (!empty($groupsAccessible) && $parentsOnly) {\n // recompute group list with flat hierarchy\n $params['parentsOnly'] = 0;\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n }\n }\n\n //NYSS 5259 convert line breaks to html\n foreach ( $groups['data'] as &$group ) {\n $group['description'] = str_replace('\\r\\n', '\\n', $group['description']);\n $group['description'] = str_replace('\\r', '\\n', $group['description']);\n $group['description'] = str_replace('\\n', '<br />', $group['description']);\n } \n }\n\n CRM_Utils_JSON::output($groups);\n }",
"public function listGroups()\n {\n\t\t$data = $this->call(array(), \"GET\", \"groups.json\");\n\t\t$data = $data->{'groups'};\n\t\t$groupArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$groupArray->append(new Group($data[$i], $this));\n\t\t}\n\t\treturn $groupArray;\n }",
"public function groups()\n {\n #$ignore = array('internal', 'id', 'toc', 'todo', 'method');\n $titles = array(\n 'return' => 'Response',\n 'example' => $this->hasMany('example') ? 'Examples' : 'Example',\n 'copyright' => 'Copyright',\n 'see' => 'See also',\n 'link' => $this->hasMany('link') ? 'Links' : 'Link',\n );\n $groups = array();\n\n foreach ($titles as $key => $title) {\n if(\n isset($this->{$key})\n #&& !in_array($key, $ignore)\n ) {\n $groups[] = array(\n 'title' => $title,\n 'items' => (array) $this->get($key)\n );\n }\n }\n\n return $groups;\n }",
"public function getGroups() {\n\t\treturn $this->util->getDirectoriesInDirectory($this->cacheDir);\n\t}",
"public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}",
"public function retrieveGroups()\n {\n return $this->start()->uri(\"/api/group\")\n ->get()\n ->go();\n }",
"public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }",
"private function getGroups()\n {\n $where = '';\n if ($this->userGroups)\n {\n $groups = explode(',', $this->userGroups);\n $where .= \" uid IN ('\" . implode(\"','\", $groups) . \"') \";\n }\n $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_groups', $where);\n $res = array();\n while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)))\n {\n $res[$row['uid']] = $row;\n }\n\n $this->loadGroupIcons($res);\n\n return $res;\n }",
"public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }",
"public function getMenuGroups(){\n\t\t//y utilizando permisos\n\t\t\n\t\t$menuGroup = new MenuGroup();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn array($menuGroup);\n\t}",
"public function getAllGroups(){\n // Get list\n $lists = array(); \n $data = Group::where('account_id', $this->getAccountId()) \n ->where('user_id', $this->user_id)\n ->get() \n ->toArray();\n $lists = $data;\n return $lists;\n }",
"public function loadAllCategories() {\n\t\t$sql = \"SELECT * FROM categories_grumble ORDER BY category_name ASC\";\n\t\t$this->db->query($sql);\n\t\treturn $this->db->rows();\n\t}",
"public function getMenuGroups(){\n\t\t//y utilizando permisos\n\n\t\t$menuGroup = new MenuGroup();\n\n\n\n\n\t\treturn array($menuGroup);\n\t}",
"public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public function getDashboardGroups(): array;",
"public function ListGroups(){\n\t\t$query = \"SELECT groupTitle FROM [PUBLISH GROUPS TABLE] ORDER BY groupTitle ASC\";\n\t\treturn array(\"results\" => $this->SelectQueryHelper());\n\t}",
"public static function groupList()\r\n\t{\r\n\t\t$arrayData = array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$criteria->order = 'level DESC';\r\n\t\t$criteria->compare('level <',Yii::app()->user->level -1,false);\r\n\t\t$result = self::model()->findAll($criteria);\r\n\t\tforeach ($result as $r) {\r\n\t\t\t$arrayData[$r->id] = $r->groupname;\r\n\t\t}\r\n\t\treturn $arrayData;\r\n\t}",
"public function getMenuGroups(){\n\t\t//y utilizando permisos\n\t\t\n\t\t$menuGroup = new MenuGroup();\n\t\t\n\t\treturn array($menuGroup);\n\t}",
"function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }",
"public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }",
"function fetchAllGroups() {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT\n id,\n name,\n is_default,\n can_delete,\n home_page_id\n FROM \".$db_table_prefix.\"groups\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $id = $r['id'];\n $results[$id] = $r;\n }\n $stmt = null;\n\n return $results;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}",
"function fm_get_cat_list($groupid=0) {\r\n\tglobal $USER;\r\n\t\r\n\t// $cats = array();\r\n\t$cats[0] = get_string('btnnoassigncat','block_file_manager');\r\n\tif ($groupid == 0){\r\n\t\t$ownertype = OWNERISUSER;\r\n\t\t$rs = get_recordset_select('fmanager_categories', \"owner=$USER->id AND ownertype=$ownertype\", 'name');\r\n\t\t$catsrec = recordset_to_array($rs);\t\r\n\t} else {\r\n\t\t$ownertype = OWNERISGROUP;\r\n\t\t$rs = get_recordset_select('fmanager_categories', \"owner=$groupid AND ownertype=$ownertype\", 'name');\r\n\t\t$catsrec = recordset_to_array($rs);\r\n\t}\r\n\tif ($catsrec) {\r\n \tforeach ($catsrec as $c) {\r\n \t\t$cats[$c->id] = $c->name;\r\n \t}\r\n\t}\r\n\treturn $cats;\r\n}",
"public function getMenuGroups(){\n\t\t//y utilizando permisos\n\n\t\t$menuGroup = new MenuGroup();\n\n\t\treturn array($menuGroup);\n\t}",
"function getGroupWikiList() {\n global $course_id;\n\n $sql = \"SELECT `id`, `title`, `description` \"\n . \"FROM `wiki_properties` \"\n . \"WHERE `group_id` != ?d \"\n . \"AND `course_id` = ?d \"\n . \"ORDER BY `group_id` ASC\";\n\n return Database::get()->queryArray($sql, 0, $course_id);\n }",
"function feed_group_load_all($reload = FALSE) {\r\n $feed_groups = drupal_static(__FUNCTION__);\r\n\r\n if ($reload || !isset($feed_groups)) {\r\n $feed_groups = db_query('SELECT * FROM {feed_group} WHERE 1 = 1')->fetchAllAssoc('fgid');\r\n }\r\n return $feed_groups;\r\n}",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"function getAllAffinityGroups()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n return $this->DAO->getAllAffinityGroups();\n }",
"static function categories()\n {\n $category = \\SOE\\DB\\Category::where('parent_id', '0')\n ->orderBy('category_order')\n ->get();\n $return = array();\n foreach($categories as $cat)\n {\n $return[$cat->id] = $cat->slug;\n }\n return $return;\n }",
"public function getAllGroups()\n {\n $select = sprintf('\n SELECT\n group_id\n FROM\n %sfaqgroup',\n PMF_Db::getTablePrefix()\n );\n\n $res = $this->config->getDb()->query($select);\n $result = [];\n while ($row = $this->config->getDb()->fetchArray($res)) {\n $result[] = $row['group_id'];\n }\n\n return $result;\n }",
"public function getSubGroups() {}",
"public function groupList(){\n\t\techo json_encode($this->read_database->get_groups());\n\t}",
"public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}",
"public function findAllCategories(): iterable;",
"public function getCustomerGroups();",
"public function groups()\n {\n $response = $this->request->post($this->requestUrl('get_groups'), $this->params);\n\n return $response->groups;\n }",
"private static function _getSelectCategories()\n {\n $categories = Blog::category()->orderBy('name')->all();\n $sortedCategories = array();\n\n foreach($categories as $c)\n $sortedCategories[$c->id] = $c->name;\n\n return $sortedCategories;\n }",
"function bvt_sfa_feed_admin_get_categories() {\n\n $categories = get_categories(\n array(\n \"child_of\" => get_option(\"BVT_SFA_TOPICS_CATEGORY_ID\"),\n \"hide_empty\" => false\n )\n );\n\n return $categories;\n}",
"public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }",
"function getSocialNetworksByCategory($thisCategoryId) {\n\t\t$url = $this->apiURL . \"sites/\" . $this->yourID . \"/\" . $this->yourAPIKey . \"/\" . $thisCategoryId;\n\t\treturn $this->_curl_get($url);\n\t}",
"public function allCategories()\n {\n return Category::all();\n }",
"function ve_get_group_of_companies_navigation() {\n\n\t/**\n\t * Arguments for get posts:\n\t */\n\t\n\t$args = array(\n\t\t'orderby'\t\t\t=>\t'title',\n\t\t'order'\t\t\t\t=>\t'ASC',\n\t\t'post_type'\t\t\t=>\t'group_of_companies',\n\t\t'post_status'\t\t=>\t'publish',\n\t\t'posts_per_page'\t=>\t-1\n\t\t);\n\t$companies = get_posts( $args );\n\n\tforeach ( $companies as $company ) {\n\t\t$company_url = get_permalink($company->ID);\n\t\t$company_title = $company->post_title;\n\t\t?>\n\t\t<li>\n\t\t\t<a class=\"purple-hover\" href=\"<?php echo $company_url; ?>\"><?php echo $company_title ?></a>\n\t\t</li>\n\t<?php\n\t}\n}",
"public function getGroups(Request $request, $page) {\n $filter = $request->input('filter');\n $user = $request->get('auth');\n $immunity = User::getImmunity($user->userId);\n\n $getGroupSql = Group::where('immunity', '<', $immunity)\n ->where('name', 'LIKE', Value::getFilterValue($request, $filter))\n ->orderBy('name', 'ASC');\n\n $total = PaginationUtil::getTotalPages($getGroupSql->count('groupId'));\n $groups = $getGroupSql->take($this->perPage)->skip(PaginationUtil::getOffset($page))->get();\n\n foreach ($groups as $group) {\n $group->sitecpPermissions = $this->buildSitecpPermissions($user, $group);\n }\n\n return response()->json(\n [\n 'groups' => $groups,\n 'page' => $page,\n 'total' => $total\n ]\n );\n }",
"protected function _getGroups() {\n\t\t$groups = Mage::getResourceModel('flexslider/group_collection');\n\t\t$options = array('' => $this->__('-- Please Select --'));\n\n\t\tforeach($groups as $group) {\n\t\t\t$options[$group->getId()] = $group->getTitle();\n\t\t}\n\n\t\treturn $options;\n\t}",
"public function get_categories()\n {\n $categorymenu = new ContentObjectCategoryMenu($this->get_workspace());\n $renderer = new OptionsMenuRenderer();\n $categorymenu->render($renderer, 'sitemap');\n\n return $renderer->toArray();\n }",
"public function getCategories()\n {\n $categories = array();\n $collection = Mage::getModel('faq/category')->getCollection();\n $collection->getSelect()->order('position ASC');\n foreach ($collection as $category) {\n if ($category->getIsActive() && $category->isVisible()) {\n $categories[$category->getId()] = $category;\n }\n }\n return $categories;\n }",
"protected function getCategoriesToRegenerate()\n {\n $sets = $this->getItemSets()['image-sets'];\n $childCategories = $this->getChildK2Categories();\n $categories = array();\n foreach ($sets as $set) {\n foreach ($set['k2categories'] as $catId) {\n if (! in_array($catId, $categories)) {\n $categories[] = $catId;\n }\n if ($set['k2selectsubcategories'] == '1') {\n foreach ($childCategories as $child) {\n if ((! in_array($child->id, $categories)) && ($child->parent == $catId)) {\n $categories[] = $child->id;\n }\n }\n }\n }\n }\n return $categories;\n }",
"public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}",
"function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function getAllGroups()\n {\n $this->db->from(\"attribute_group\");\n $this->db->order_by('sort_id','ASC');\n $q = $this->db->get();\n return $q->result_array();\n }",
"public static function getAll(){\n $conn = DataManager::getInstance()->getConnection();\n if(!$conn || $conn->connect_error) exit();\n $statement = $conn->prepare('SELECT `id` FROM `groups` WHERE 1');\n if(!$statement || !$statement->execute()) exit();\n $result_set = $statement->get_result();\n $group_ids = array();\n while($row = $result_set->fetch_assoc()){\n array_push($group_ids, $row['id']);\n }\n $output = array();\n foreach($group_ids as $id){\n array_push($output, self::fromId($id));\n }\n return $output;\n }",
"private function getPopularCategories()\n {\n $query = Queries::$getPopularCategories;\n\n try {\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n $this->successResponse($result);\n } catch (\\PDOException$e) {\n $this->errorResponse($e->getMessage());\n }\n }"
] | [
"0.7119901",
"0.6809501",
"0.6809501",
"0.67347866",
"0.67156607",
"0.666446",
"0.66382635",
"0.65982777",
"0.6537011",
"0.6509248",
"0.64859027",
"0.64859027",
"0.634545",
"0.6305408",
"0.6305408",
"0.6297586",
"0.6297586",
"0.62926996",
"0.625669",
"0.6234821",
"0.62307227",
"0.62213004",
"0.6218487",
"0.62173283",
"0.6210872",
"0.6205342",
"0.61964315",
"0.61915076",
"0.6187328",
"0.61787295",
"0.61701316",
"0.6165388",
"0.61641836",
"0.6155171",
"0.6148907",
"0.6132189",
"0.6077893",
"0.6068205",
"0.60641205",
"0.6061787",
"0.6060664",
"0.6059038",
"0.60585374",
"0.60504615",
"0.60504615",
"0.60405946",
"0.6030928",
"0.60228544",
"0.60205674",
"0.60161436",
"0.6011094",
"0.6001327",
"0.5997288",
"0.5992817",
"0.5992037",
"0.5984428",
"0.5983847",
"0.5983024",
"0.5981036",
"0.5977382",
"0.59619856",
"0.59618926",
"0.5961642",
"0.59615415",
"0.59587234",
"0.5956825",
"0.5948836",
"0.5946594",
"0.59457505",
"0.59354645",
"0.59267855",
"0.59194744",
"0.59142965",
"0.5911722",
"0.59002244",
"0.58886355",
"0.58816284",
"0.5881516",
"0.58812636",
"0.58768487",
"0.58653164",
"0.58465433",
"0.58447015",
"0.5829826",
"0.5826844",
"0.58177745",
"0.58134776",
"0.58124876",
"0.5806212",
"0.57994443",
"0.579624",
"0.5794432",
"0.5791345",
"0.5788117",
"0.5782669",
"0.5780398",
"0.57785237",
"0.5775641",
"0.57735705",
"0.57683617"
] | 0.71832263 | 0 |
Get all groups and categories in each group | public function get_by_group($formatted = FALSE)
{
$groups = $this->get_groups();
$categories = $this->get_all();
$grouped = array();
foreach ($groups as $group_id => $group)
{
$grouped[$group_id] = array(
'value' => $group_id,
'label' => $group->group_name
);
foreach ($categories as $index => $category)
{
if ($category->group_id == $group_id)
{
$grouped[$group_id]['categories'][] = array(
'value' => $category->cat_id,
'label' => $category->cat_name
);
}
}
}
if ( !$formatted)
{
return $grouped;
}
// Leave a blank option other wise the on change event won't work
$out = '<option value=""></option>';
foreach ($grouped as $group_index => $group)
{
$out .= '<optgroup label="'. $group['label'] .'">';
if ( !isset($group['categories'])) continue;
foreach ($group['categories'] as $category_index => $category)
{
$url = ee()->publisher_helper_cp->mod_link('categories', array('group_id' => $group['value'] .'#category-'. $category['value']));
$out .= '<option value="'. $url .'">'. $category['label'] .'</option>';
}
$out .= '</optgroup>';
}
return $out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public static function groupList()\n {\n $category = Category::all();\n $array = [];\n foreach ($category->where('category_id', 0) as $parent){\n\n $array[$parent->title] = array();\n\n foreach($parent->children as $attribute) {\n $array[$parent->title][$attribute->id] = $attribute->title;\n }\n }\n\n return $array;\n }",
"private function groupByCategory(){\n \n $searchResults = null;\n $items = $this->items; \n \n foreach($items as $item){\n foreach($item->categories as $category_tmp){ \n $searchResults[$category_tmp][] = $item;\n } \n }\n \n return $searchResults;\n }",
"public function getGroups();",
"public function getGroups();",
"public function groups()\n {\n #$ignore = array('internal', 'id', 'toc', 'todo', 'method');\n $titles = array(\n 'return' => 'Response',\n 'example' => $this->hasMany('example') ? 'Examples' : 'Example',\n 'copyright' => 'Copyright',\n 'see' => 'See also',\n 'link' => $this->hasMany('link') ? 'Links' : 'Link',\n );\n $groups = array();\n\n foreach ($titles as $key => $title) {\n if(\n isset($this->{$key})\n #&& !in_array($key, $ignore)\n ) {\n $groups[] = array(\n 'title' => $title,\n 'items' => (array) $this->get($key)\n );\n }\n }\n\n return $groups;\n }",
"public function getCategoriesGroup() {\n\t\t$imageTypes = $this->getImagesTypes();\n\t\t$categories = $this->getCollection()\n\t\t\t\t->addFieldToFilter('status',1);\n\t\t$arrayOptions = array();\n\t\t$i = 1;\n\t\tforeach($imageTypes as $key => $imageType)\n\t\t{\n\t\t\tif($key == 'uncategorized')\n\t\t\t{\n\t\t\t\t$arrayOptions[0] = 'Uncategorized';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arrayValue = array();\n\t\t\tforeach($categories as $category)\n\t\t\t{\n\t\t\t\tif($category->getImageTypes() == $key)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$arrayValue[] = array('value'=>$category->getId(),'label'=>$category->getTitle());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayOptions[$i]['value'] = $arrayValue;\n\t\t\t$arrayOptions[$i]['label'] = $imageType;\n\t\t\t$i++;\n\t\t}\n\t\treturn $arrayOptions;\n\t}",
"public function getGroups() {}",
"public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }",
"public function get_groups()\n {\n $qry = ee()->db->where('site_id', ee()->publisher_lib->site_id)\n ->order_by('group_name', 'asc')\n ->get('category_groups');\n\n $groups = array();\n\n if ($qry->num_rows())\n {\n foreach ($qry->result() as $group)\n {\n $groups[$group->group_id] = $group;\n }\n }\n\n return $groups;\n }",
"public function groups();",
"public function groups();",
"public function getAllGroups();",
"function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public function groups()\n {\n return $this->groupModel\n ->orderBy('name', 'asc')\n ->findAll();\n }",
"public function groups() {\n return $this->hasMany(Group::class, 'category_id');\n }",
"public function getGroups(): array;",
"protected function getGroupList() {}",
"protected function getGroupList() {}",
"public function getCategories();",
"public function getCategories();",
"public function getAllWithCategory();",
"private function getCategories($groupID = null)\n {\n $this->db->select('*', '`bf_categories`')\n ->where('`visible` = 1' . \n ($groupID ? ' AND `category_group_id` = \\'' . intval($groupID) . '\\'' : ''))\n ->order('name', 'asc')\n ->execute();\n \n // Collect categories\n $categoryCollection = array();\n while($category = $this->db->next())\n {\n // Get image\n $image = $this->parent->db->getRow('bf_images', $category->image_id);\n \n // No image?\n if(!$image)\n {\n // Default image\n $imageURL = \n $this->parent->config->get('com.b2bfront.site.default-image', true);\n }\n else\n {\n $imageURL = Tools::getImageThumbnail($image->url);\n }\n \n $categoryCollection[] = array(\n 'name' => $category->name,\n 'id' => $category->id,\n 'url' => $imageURL\n );\n }\n \n return $categoryCollection;\n }",
"public static function groupList()\r\n\t{\r\n\t\t$arrayData = array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$criteria->order = 'level DESC';\r\n\t\t$criteria->compare('level <',Yii::app()->user->level -1,false);\r\n\t\t$result = self::model()->findAll($criteria);\r\n\t\tforeach ($result as $r) {\r\n\t\t\t$arrayData[$r->id] = $r->groupname;\r\n\t\t}\r\n\t\treturn $arrayData;\r\n\t}",
"function getAllGroups()\n {\n $this->db->from(\"attribute_group\");\n $this->db->order_by('sort_id','ASC');\n $q = $this->db->get();\n return $q->result_array();\n }",
"public function &getGroupBy();",
"function getCategories(){\n\t\tif ($this->isAdmin() || $this->isSupervisor())\n\t\t\treturn CategoryQuery::create()->find();\n\n\t\t$sql = \"SELECT \".CategoryPeer::TABLE_NAME.\".* FROM \".UserGroupPeer::TABLE_NAME .\" ,\".\n\t\t\t\t\t\tGroupCategoryPeer::TABLE_NAME .\", \".CategoryPeer::TABLE_NAME .\n\t\t\t\t\t\t\" where \".UserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\n\t\t\t\t\t\tUserGroupPeer::GROUPID .\" = \".GroupCategoryPeer::GROUPID .\" and \".\n\t\t\t\t\t\tGroupCategoryPeer::CATEGORYID .\" = \".CategoryPeer::ID .\" and \".\n\t\t\t\t\t\tCategoryPeer::ACTIVE .\" = 1\";\n\n\t\t$con = Propel::getConnection(UserPeer::DATABASE_NAME);\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\treturn CategoryPeer::populateObjects($stmt);\n\t}",
"public function findCategories();",
"public function findGroups() {\n\t\t\n\t}",
"public static abstract function getGroupList();",
"public function get_categories()\n {\n $param = array(\n 'delete_flg' => $this->config->item('not_deleted','common_config')\n );\n $groups = $this->get_tag_group();\n\n if (empty($groups)) return array();\n\n $group_id = array_column($groups, 'tag_group_id');\n $param = array_merge($param, array('group_id' => $group_id));\n\n $tags = $this->Logic_tag->get_list($param);\n\n return $this->_generate_categories_param($groups, $tags);\n }",
"public function getAllWithCategoryAndTags();",
"public function getGroups() {\n\t\t$groups = array(\n\t\t\t'get_posts' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use WP_Query instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_posts',\n\t\t\t\t\t'wp_get_recent_posts',\n\t\t\t\t\t'get_children',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_terms' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use get_the_terms() instead. Use wp_list_pluck() to get the IDs.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_terms',\n\t\t\t\t\t'wp_get_object_terms',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_get_post_categories' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use the equivalent get_the_* version instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_get_post_categories',\n\t\t\t\t\t'wp_get_post_tags',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wp_old_slug_redirect' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => '%s() is an uncached function; use wpcom_vip_old_slug_redirect() instead.',\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'wp_old_slug_redirect',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'get_term_by' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_get_term_by() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t'get_term_by',\n\t\t\t\t\t'get_cat_ID',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$wpcom_vip_fns = array(\n\t\t\t'get_category_by_slug',\n\t\t\t'get_term_link',\n\t\t\t'get_page_by_title',\n\t\t\t'get_page_by_path',\n\t\t\t'url_to_postid',\n\t\t);\n\t\tforeach ( $wpcom_vip_fns as $function ) {\n\t\t\t$groups[ $function ] = array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => \"%s() is an uncached function; use wpcom_vip_$function() instead.\",\n\t\t\t\t'functions' => array(\n\t\t\t\t\t$function\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn $groups;\n\t}",
"public function group(): Collection;",
"function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}",
"public function findAllCategories(): iterable;",
"public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }",
"public function getAllCategories();",
"public function getGroupsList(){\n return $this->_get(3);\n }",
"public function getGroupedByMainCategory(): array\n {\n $this->createPDO('select');\n $PDOLink = PDOProcessorBuilder::getProcessor('select', true);\n $PDOLink->setCommand('SELECT id, main_category_id, name FROM meta_subcategory');\n $tempResult = $PDOLink->execute();\n $result = [];\n foreach ($tempResult as $value) {\n if (!isset($result[$value['main_category_id']])) {\n $result[$value['main_category_id']] = [];\n }\n $result[$value['main_category_id']][$value['id']] = $value['name'];\n }\n return $result;\n }",
"public function getGroupsList(){\n return $this->_get(1);\n }",
"public function getAllGroups(){\n // Get list\n $lists = array(); \n $data = Group::where('account_id', $this->getAccountId()) \n ->where('user_id', $this->user_id)\n ->get() \n ->toArray();\n $lists = $data;\n return $lists;\n }",
"private function _get_groups() {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$groups = [];\n\t\t$page_index = 1;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( \"groups?per_page=100&page=$page_index\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$groups = array_merge( $groups, $response_arr );\n\n\t\t\t$page_index = get_next_page( $response );\n\n\t\t} while ( ! empty( $page_index ) );\n\n\t\treturn $groups;\n\n\t}",
"public function getAllGroups() {\n\t\t$groups = $this->group->getAll();\n\t\treturn $groups;\n\t}",
"function getCategories(){\r\n\t\trequire_once(\"AffiliateUserGroupPeer.php\");\r\n \trequire_once(\"AffiliateGroupCategoryPeer.php\");\r\n \t$sql = \"SELECT \".AffiliateCategoryPeer::TABLE_NAME.\".* FROM \".AffiliateUserGroupPeer::TABLE_NAME .\" ,\".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::TABLE_NAME .\", \".AffiliateCategoryPeer::TABLE_NAME .\r\n\t\t\t\t\t\t\" where \".AffiliateUserGroupPeer::USERID .\" = '\".$this->getId().\"' and \".\r\n\t\t\t\t\t\tAffiliateUserGroupPeer::GROUPID .\" = \".AffiliateGroupCategoryPeer::GROUPID .\" and \".\r\n\t\t\t\t\t\tAffiliateGroupCategoryPeer::CATEGORYID .\" = \".AffiliateCategoryPeer::ID .\" and \".\r\n\t\t\t\t\t\tAffiliateCategoryPeer::ACTIVE .\" = 1\";\r\n \t\r\n \t$con = Propel::getConnection(AffiliateUserPeer::DATABASE_NAME);\r\n $stmt = $con->createStatement();\r\n $rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM); \r\n return BaseCategoryPeer::populateObjects($rs);\r\n }",
"abstract protected function getGroupList() ;",
"public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public function getGroupList()\n\t{\n\t\t$db = FabrikWorker::getDbo(true);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('DISTINCT(group_id)')->from('#__{package}_formgroup');\n\t\t$db->setQuery($query);\n\t\t$usedgroups = $db->loadResultArray();\n\t\tJArrayHelper::toInteger($usedgroups);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id AS value, name AS text')->from('#__{package}_groups');\n\t\tif (!empty($usedgroups)) {\n\t\t\t$query->where('id NOT IN('.implode(\",\", $usedgroups) .')');\n\t\t}\n\t\t$query->where('published <> -2');\n\t\t$query->order(FabrikString::safeColName('text'));\n\t\t$db->setQuery($query);\n\t\t$groups = $db->loadObjectList();\n\t\t$list = JHTML::_('select.genericlist', $groups, 'jform[groups]', \"class=\\\"inputbox\\\" size=\\\"10\\\" style=\\\"width:100%;\\\" \", 'value', 'text', null, $this->id . '-from');\n\t\treturn array($groups, $list);\n\t}",
"public function getGroup();",
"public function getGroup();",
"public function getGroup();",
"public function getGroups()\n\t{\t\t\n\t\t$groups = $this->tax_class->getTerms();\n\t\tforeach ($groups as &$group) \n\t\t{\n\t\t\t$key = md5($group->meta['location_address']);\n\t\t\t$cache = $this->getCache($key);\n\t\t\tif($cache)\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $cache;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$group->meta['location'] = $this->getLatLngByAddress($group->meta['location_address']);\n\t\t\t}\n\t\t\t$this->setCache($key, $group->meta['location']);\n\t\t}\n\t\treturn $groups;\n\t}",
"public static function getAll(){\n $conn = DataManager::getInstance()->getConnection();\n if(!$conn || $conn->connect_error) exit();\n $statement = $conn->prepare('SELECT `id` FROM `groups` WHERE 1');\n if(!$statement || !$statement->execute()) exit();\n $result_set = $statement->get_result();\n $group_ids = array();\n while($row = $result_set->fetch_assoc()){\n array_push($group_ids, $row['id']);\n }\n $output = array();\n foreach($group_ids as $id){\n array_push($output, self::fromId($id));\n }\n return $output;\n }",
"protected function getGroups() {\n return DB::table('translation_identifiers')->select('group')->groupBy(['group'])->get()->pluck('group');\n }",
"function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }",
"public function addMultipleCategoriesToGroup();",
"function get_all_knowledge_base_articles_grouped($only_clients = true, $where = array())\n{\n $CI =& get_instance();\n $CI->load->model('knowledge_base_model');\n $groups = $CI->knowledge_base_model->get_kbg('', 1);\n $i = 0;\n foreach ($groups as $group) {\n $CI->db->select('slug,subject,description,tblknowledgebase.active as active_article,articlegroup,articleid,staff_article');\n $CI->db->from('tblknowledgebase');\n $CI->db->where('articlegroup', $group['groupid']);\n $CI->db->where('active', 1);\n if ($only_clients == true) {\n $CI->db->where('staff_article', 0);\n }\n $CI->db->where($where);\n $CI->db->order_by('article_order', 'asc');\n $articles = $CI->db->get()->result_array();\n if (count($articles) == 0) {\n unset($groups[$i]);\n $i++;\n continue;\n }\n $groups[$i]['articles'] = $articles;\n $i++;\n }\n\n return $groups;\n}",
"private function getGroups()\n {\n $where = '';\n if ($this->userGroups)\n {\n $groups = explode(',', $this->userGroups);\n $where .= \" uid IN ('\" . implode(\"','\", $groups) . \"') \";\n }\n $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_groups', $where);\n $res = array();\n while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)))\n {\n $res[$row['uid']] = $row;\n }\n\n $this->loadGroupIcons($res);\n\n return $res;\n }",
"public function get_all_groups( $list_id = '' ) {\n $list_id = $this->sanitize_list_id( $list_id );\n $categories = $this->get_group_categories( $list_id );\n $output = [];\n foreach ( $categories as $cat ) {\n if ( ! is_object( $cat ) || ! isset( $cat->id ) ) {\n continue;\n }\n $groups = $this->get_groups( $cat->id, $list_id );\n foreach ( $groups as $group ) {\n $group->category_title = $cat->title;\n }\n $output = array_merge( $output, $groups );\n }\n // Remove the _links element\n foreach ( $output as $item ) {\n if ( isset( $item->_links ) ) {\n unset( $item->_links );\n }\n }\n return $output;\n }",
"public static function getAllGroups()\n {\n return ValveGroup::all();\n }",
"function GetChannelHierarchyData() \n {\n $data = $this->GetChannelCategoryData();\n foreach ($data as $row => $val) {\n $data[$row]['channels'] = $this->db\n ->join(\n \"\n (\n select {$this->db->dbprefix('channel')}.id_channel as channel_id,\n max(case when {$this->db->dbprefix('package')}.id_package='1' then 1 else 0 end) as big_universe,\n max(case when {$this->db->dbprefix('package')}.id_package='2' then 1 else 0 end) as big_star,\n max(case when {$this->db->dbprefix('package')}.id_package='3' then 1 else 0 end) as big_sun,\n max(case when {$this->db->dbprefix('package')}.id_package='4' then 1 else 0 end) as big_fun,\n max(case when {$this->db->dbprefix('package')}.id_package='5' then 1 else 0 end) as big_deal\n from channel\n left join channel_category on channel_category.id_channel_category=channel.id_channel_category\n left join package_channel on package_channel.id_channel=channel.id_channel\n left join package on package.id_package=package_channel.id_package\n where channel.is_delete = 0\n group by {$this->db->dbprefix('channel_category')}.category_name, {$this->db->dbprefix('channel')}.name\n ) as {$this->db->dbprefix('channel_all')}\n \",\n 'channel_all.channel_id=channel.id_channel',\n 'left'\n )\n \n ->where(\"{$this->db->dbprefix('channel')}.id_channel_category IS NOT NULL\",null,false)\n ->where(\"{$this->db->dbprefix('channel')}.id_channel_category\",$val['id_channel_category'])\n ->where(\"{$this->db->dbprefix('channel')}.is_delete\",0)\n ->where(\"{$this->db->dbprefix('channel')}.id_channel_category !=\",0)\n ->order_by(\"{$this->db->dbprefix('channel')}.position\",\"asc\")\n ->order_by(\"{$this->db->dbprefix('channel')}.id_channel\",\"desc\")\n ->get('channel')\n ->result_array();\n }\n #echo $this->db->last_query();\n return $data;\n }",
"function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getGroupsList(){\n return $this->_get(4);\n }",
"public function getGroupsList(){\n return $this->_get(4);\n }",
"public function getCustomerGroups();",
"public function getGroups() {\n return parent::getGroups();\n }",
"function getAllTestCategoriesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentGroupID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryGroupID'], $clientID);\n\n //First, we need get all the categories that has the parent groupID\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCategoryParentGroupID, 'value' => $groupID);\n\n $testCategories = getFilteredItemsIDs($itemTypeTestCasesCategoriesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($testCategories as $tcat) {\n $onlyIds[] = $tcat['ID'];\n }\n\n return $onlyIds;\n}",
"public function getAllProductgroups () {\n $data = \\Drupal::database()->select('taxonomy_term_field_data', 't');\n $data->leftJoin('taxonomy_term__field_use_in_kmds', 'kmds', \"t.tid = kmds.entity_id\");\n $data->condition('t.vid', 'product_group', '=');\n $data->condition('kmds.field_use_in_kmds_value', 1, '=');\n $data->fields('t', ['tid','name']);\n $data->fields('kmds', ['field_use_in_kmds_value']);\n $active_terms = $data->execute()->fetchAll();\n\n $response = $active_terms;\n \n return new JsonResponse($response);\n }",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"public function getShowGroups(): array;",
"function olc_set_groups($categories_id,$shops) {\n\t$products_query=olc_db_query(\"SELECT products_id FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\"\n\twhere categories_id='\".$categories_id.APOS);\n\twhile ($products=olc_db_fetch_array($products_query)) {\n\t\tolc_db_query(SQL_UPDATE.TABLE_PRODUCTS.\" SET group_ids='\".$shops.\"'\n\t\twhere products_id='\".$products['products_id'].APOS);\n\t}\n\t// set status of categorie\n\tolc_db_query(SQL_UPDATE . TABLE_CATEGORIES . \" set group_ids = '\".$shops.\"'\n\twhere categories_id = '\" . $categories_id . APOS);\n\t// look for deeper categories and go rekursiv\n\t$categories_query=olc_db_query(\"SELECT categories_id FROM \".TABLE_CATEGORIES.\"\n\twhere parent_id='\".$categories_id.APOS);\n\twhile ($categories=olc_db_fetch_array($categories_query)) {\n\t\tolc_set_groups($categories['categories_id'],$shops);\n\t}\n\n}",
"public function getCategories() : array;",
"public static function getGroupList() {\n $params = $_GET;\n if (isset($params['parent_id'])) {\n // requesting child groups for a given parent\n $params['page'] = 1;\n $params['rp'] = 0;\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n }\n else {\n $requiredParams = [];\n $optionalParams = [\n 'title' => 'String',\n 'created_by' => 'String',\n 'group_type' => 'String',\n 'visibility' => 'String',\n 'component_mode' => 'String',\n 'status' => 'Integer',\n 'parentsOnly' => 'Integer',\n 'showOrgInfo' => 'Boolean',\n 'savedSearch' => 'Integer',\n // Ignore 'parent_id' as that case is handled above\n ];\n $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();\n $params += CRM_Core_Page_AJAX::validateParams($requiredParams, $optionalParams);\n\n // get group list\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n\n // if no groups found with parent-child hierarchy and logged in user say can view child groups only (an ACL case),\n // go ahead with flat hierarchy, CRM-12225\n if (empty($groups)) {\n $groupsAccessible = CRM_Core_PseudoConstant::group();\n $parentsOnly = $params['parentsOnly'] ?? NULL;\n if (!empty($groupsAccessible) && $parentsOnly) {\n // recompute group list with flat hierarchy\n $params['parentsOnly'] = 0;\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n }\n }\n\n //NYSS 5259 convert line breaks to html\n foreach ( $groups['data'] as &$group ) {\n $group['description'] = str_replace('\\r\\n', '\\n', $group['description']);\n $group['description'] = str_replace('\\r', '\\n', $group['description']);\n $group['description'] = str_replace('\\n', '<br />', $group['description']);\n } \n }\n\n CRM_Utils_JSON::output($groups);\n }",
"public function index()\n {\n return Group::all()->toArray();\n }",
"public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }",
"public function fetchGroupTypes(): array;",
"public function ListGroups(){\n\t\t$query = \"SELECT groupTitle FROM [PUBLISH GROUPS TABLE] ORDER BY groupTitle ASC\";\n\t\treturn array(\"results\" => $this->SelectQueryHelper());\n\t}",
"public static function data4Select($category)\n {\n // Grouped data\n $all_data = BusinessPartner::where('category_id', $category)->get();\n $results = array();\n foreach ($all_data as $buz) {\n $coupons = array();\n foreach ($buz->coupons as $l) {\n $tmp['id'] = $l->id;\n $tmp['text'] = $l->name;\n $coupons[] = $tmp;\n }\n $group['text'] = $buz->name;\n $group['children'] = $coupons;\n\n if (count($coupons)) {\n $results[] = $group;\n }\n }\n return array(\"results\"=>$results);\n }",
"private function getCategories() {\r\n $data['categories'] = array();\r\n\r\n $this->load->model('catalog/category');\r\n\r\n $categories_1 = $this->model_catalog_category->getCategories(0);\r\n\r\n foreach ($categories_1 as $category_1) {\r\n $level_2_data = array();\r\n\r\n $categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);\r\n\r\n foreach ($categories_2 as $category_2) {\r\n $level_3_data = array();\r\n\r\n $categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);\r\n\r\n foreach ($categories_3 as $category_3) {\r\n $level_3_data[] = array(\r\n 'category_id' => $category_3['category_id'],\r\n 'name' => $category_3['name'],\r\n );\r\n }\r\n\r\n $level_2_data[] = array(\r\n 'category_id' => $category_2['category_id'],\r\n 'name' => $category_2['name'],\r\n 'children' => $level_3_data\r\n );\r\n }\r\n\r\n $data['categories'][] = array(\r\n 'category_id' => $category_1['category_id'],\r\n 'name' => $category_1['name'],\r\n 'children' => $level_2_data\r\n );\r\n }\r\n return $data['categories'];\r\n }",
"public function getGroupList()\n\t{\n\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t$query = \"select id,group_name from main_groups where isactive = 1 order by group_name\";\n\t\t$result = $db->query($query);\n\t\t$group_arr = array();\n\t\twhile($row = $result->fetch())\n\t\t{\n\t\t\t$group_arr[$row['id']] = $row['group_name'];\n\t\t}\n\n\t\treturn $group_arr;\n\t}",
"public function groupList(){\n\t\techo json_encode($this->read_database->get_groups());\n\t}",
"public function getGroups(){\n $groups = Group::get()->toArray();\n $groups_array = array();\n foreach($groups as $group){\n $groups_array[$group['id']]['group_name'] = $group['group_name'];\n $groups_array[$group['id']]['user_ids'] = explode(\",\",$group['user_ids']);\n }\n return $groups_array;\n }",
"public function getAllCategories() {\n $allCategories= $this->getCategories(); \n foreach ($allCategories as $value){\n $value->setChildren($this->getSubCategories($value->getId()));\n }\n return $allCategories;\n \n }",
"function getAllTestCasesInsideAGroup($groupID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n //get all categories inside group\n $onlyIds = getAllTestCategoriesInsideAGroup($groupID, $clientID);\n\n //Next, create a string with all the categories inside the group\n $toFilter = implode(',', $onlyIds);\n\n //Create the filter\n // build return properties array\n $returnProperties = array();\n\n //build the filter\n $filters = array();\n $filters[] = array('ID' => $testCasesParentPropertyID, 'value' => $toFilter, 'mode' => '<-IN');\n\n $allTestCases = getFilteredItemsIDs($itemTypeTestCasesID, $clientID, $filters, $returnProperties);\n\n //Get only the testCategories ids\n $onlyIds = array();\n\n foreach ($allTestCases as $tcas) {\n $onlyIds[] = $tcas['ID'];\n }\n\n return $onlyIds;\n}",
"public function a_get_groups()\n {\n $query = Group::query();\n \n $query\n ->select(array(\n \"$this->groups_tb_id as id\",\n \"$this->groups_tb_name as name\",\n ));\n\n return $query\n ->get()\n ->toArray();\n }",
"function ajax_get_all_groups() {\r\n global $wpdb;\r\n\r\n $groups = $this->get_groups();\r\n\r\n if ( is_array( $groups ) && 0 < count( $groups ) ) {\r\n\r\n $i = 0;\r\n $n = ceil( count( $groups ) / 5 );\r\n\r\n $html = '';\r\n $html .= '<ul class=\"clients_list\">';\r\n\r\n\r\n\r\n foreach ( $groups as $group ) {\r\n if ( $i%$n == 0 && 0 != $i )\r\n $html .= '</ul><ul class=\"clients_list\">';\r\n\r\n $html .= '<li><label>';\r\n $html .= '<input type=\"checkbox\" name=\"groups_id[]\" value=\"' . $group['group_id'] . '\" /> ';\r\n $html .= $group['group_id'] . ' - ' . $group['group_name'];\r\n $html .= '</label></li>';\r\n\r\n $i++;\r\n }\r\n\r\n $html .= '</ul>';\r\n } else {\r\n $html = 'false';\r\n }\r\n\r\n die( $html );\r\n\r\n }",
"public function run()\n {\n $categories = [\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Gear', 'slug' => 'gear', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Parts', 'slug' => 'parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'Casual', 'slug' => 'casual', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 0, 'c_group' => 0, 'name' => 'News', 'slug' => 'news', 'sortorder' => 4, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Clothes', 'slug' => 'clothes', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Helmets', 'slug' => 'helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 1, 'name' => 'Boots', 'slug' => 'boots', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Suspension', 'slug' => 'suspension', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'maintenance', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 2, 'name' => 'Oils', 'slug' => 'oils', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'T-Sirts', 'slug' => 'tshirts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 1, 'c_group' => 3, 'name' => 'Caps', 'slug' => 'caps', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Jerseys', 'slug' => 'jerseys', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 5, 'c_group' => 1, 'name' => 'Pants', 'slug' => 'pants', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-helmets', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 6, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-helmets', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Adults', 'slug' => 'adults-boots', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 7, 'c_group' => 1, 'name' => 'Kids', 'slug' => 'kids-boots', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Fork', 'slug' => 'fork-parts', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 8, 'c_group' => 2, 'name' => 'Shock', 'slug' => 'shock-parts', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Airfilter', 'slug' => 'airfilter', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Oilfilter', 'slug' => 'oilfilter', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 9, 'c_group' => 2, 'name' => 'Brakepads', 'slug' => 'brakepads', 'sortorder' => 3, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Engine Oils', 'slug' => 'engine-oils', 'sortorder' => 1, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Suspension Oils', 'slug' => 'suspension-oils', 'sortorder' => 2, 'active' => 1],\n ['parent_id' => 10, 'c_group' => 2, 'name' => 'Maintenance', 'slug' => 'bike-maintenance', 'sortorder' => 3, 'active' => 1],\n ];\n\n DB::table('categories')->insert($categories);\n }",
"public abstract function getGroup();",
"public function groups(): MorphToMany;",
"public function provideValidCategoryGroups()\n {\n return [\n 'emptyArray' => [\n 'CategoryGroups' => [],\n 'expectedResult' => [],\n ],\n 'single group' => [\n 'CategoryGroups' => [\n 'group1' => $this->getMockCategoryGroup(1),\n ],\n 'expectedResult' => [\n 'groupHandle1' => [\n 'name' => 'groupName1',\n 'hasUrls' => null,\n 'template' => null,\n 'maxLevels' => null,\n 'locales' => [\n 'en' => [\n 'urlFormat' => null,\n 'nestedUrlFormat' => null,\n ],\n ],\n 'fieldLayout' => [\n 'fields' => [],\n ],\n ],\n ],\n ],\n 'multiple groups' => [\n 'CategoryGroups' => [\n 'group1' => $this->getMockCategoryGroup(1),\n 'group2' => $this->getMockCategoryGroup(2),\n ],\n 'expectedResult' => [\n 'groupHandle1' => [\n 'name' => 'groupName1',\n 'hasUrls' => null,\n 'template' => null,\n 'maxLevels' => null,\n 'locales' => [\n 'en' => [\n 'urlFormat' => null,\n 'nestedUrlFormat' => null,\n ],\n ],\n 'fieldLayout' => [\n 'fields' => [],\n ],\n ],\n 'groupHandle2' => [\n 'name' => 'groupName2',\n 'hasUrls' => null,\n 'template' => null,\n 'maxLevels' => null,\n 'locales' => [\n 'en' => [\n 'urlFormat' => null,\n 'nestedUrlFormat' => null,\n ],\n ],\n 'fieldLayout' => [\n 'fields' => [],\n ],\n ],\n ],\n ],\n ];\n }",
"public static function getAllCategories()\n {\n $return = (array) FrontendModel::get('database')->getRecords(\n 'SELECT c.id, c.title AS label, COUNT(c.id) AS total\n FROM menu_categories AS c\n INNER JOIN menu_alacarte AS i ON c.id = i.category_id AND c.language = i.language\n GROUP BY c.id\n ORDER BY c.sequence ASC',\n array(), 'id'\n );\n\n // loop items and unserialize\n foreach ($return as &$row) {\n if (isset($row['meta_data'])) {\n $row['meta_data'] = @unserialize($row['meta_data']);\n }\n }\n\n return $return;\n }",
"private function __getCats() {\n\n\t\t$rootcatID = Mage::app()->getStore()->getRootCategoryId();\n\n\t\t$categories = Mage::getModel('catalog/category')\n\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t\t\t\t->addIsActiveFilter();\n $data = array();\n foreach ($categories as $attribute) {\n\t\t\t$data[] = array(\n\t\t\t\t'value' => $attribute->getId(),\n\t\t\t\t'label' => $attribute->getName()\n\t\t\t);\n }\n return $data;\n }",
"function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }",
"protected function getGroups()\n\t{\n\t\t// Initialize variables.\n\t\t$groups = array();\n\n\t\t// Get the client and client_id.\n\t\t$client = (string) $this->element['client'];\n\t\t$clientId = ($client == 'administrator') ? 1 : 0;\n\n\t\t// Get the database object and a new query object.\n\t\t$db\t\t= JFactory::getDBO();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t// Build the query.\n\t\t$query->select('id, title, template');\n\t\t$query->from('#__template_styles');\n\t\t$query->where('client_id = '.(int) $clientId);\n\t\t$query->order('template');\n\t\t$query->order('title');\n\n\t\t// Set the query and load the styles.\n\t\t$db->setQuery($query);\n\t\t$styles = $db->loadObjectList();\n\n\t\t// Build the grouped list array.\n\t\tforeach($styles as $style) {\n\n\t\t\t// Initialize the group if necessary.\n\t\t\tif (!isset($groups[$style->template])) {\n\t\t\t\t$groups[$style->template] = array();\n\t\t\t}\n\n\t\t\t$groups[$style->template][] = JHtml::_('select.option', $style->id, $style->title);\n\t\t}\n\n\t\t// Merge any additional groups in the XML definition.\n\t\t$groups = array_merge(parent::getGroups(), $groups);\n\n\t\treturn $groups;\n\t}",
"public function findAllGroup()\n {\n $groupList = DB::table('groups')\n ->join('users', 'groups.user_id', '=', 'users.id')\n ->select('groups.*', DB::raw('CONCAT(\"อ.\",users.fname_th,\" \", users.lname_th) AS creater'))\n ->orderBy('fname_th','ASC')\n ->orderBy('group_name','ASC')\n ->get();\n// $findAllSection = Section::all()->orderBy('section_name');\n return response()->json($groupList);\n }",
"public function get_all($group_id = FALSE, $status = PUBLISHER_STATUS_OPEN)\n {\n ee()->db->where('site_id', ee()->publisher_lib->site_id);\n\n if (is_numeric($group_id))\n {\n ee()->db->where('group_id', $group_id);\n }\n\n $qry = ee()->db\n ->order_by('cat_name', 'asc')\n ->get('categories');\n\n $categories = array();\n\n foreach ($qry->result() as $category)\n {\n $category->translation_status = $this->is_translated_formatted($category->cat_id, ee()->publisher_setting->detailed_translation_status());\n\n $categories[] = $category;\n }\n\n return !empty($categories) ? $categories : FALSE;\n }",
"public function getSubGroups() {}",
"function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}",
"public function getArrayOfGroups() {\n\n $entityTypeId = Mage::getModel('eav/entity')->setType(Alpenite_Blog_Model_Post::ENTITY)->getTypeId();\n\n $sets = Mage::getModel('eav/entity_attribute_set')\n ->getResourceCollection()\n ->setEntityTypeFilter($entityTypeId)\n ->load();\n\n $resultArray = array();\n foreach ($sets as $set) {\n $setId = $set->getAttributeSetId();\n $groups = Mage::getModel('eav/entity_attribute_group')\n ->getResourceCollection()\n ->setAttributeSetFilter($setId)\n ->setSortOrder()\n ->load();\n\n $groupIds = array();\n foreach ($groups as $group) {\n $groupIds[] = array(\n 'value' => $setId . '_' . $group->getId(),\n 'label' => Mage::helper('eav')->__($group->getAttributeGroupName())\n );\n }\n\n $resultArray[] = array(\n 'value' => $groupIds,\n 'label' => Mage::helper('eav')->__($set->getAttributeSetName())\n );\n }\n\n return $resultArray;\n }",
"public function structure() {\n $list = $this->newQuery()->where('parent_id', 0)->orderBy('order_id', 'asc')->get();\n $list->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $children->transform(function (PageCategory $category) {\n $children = $category->newQuery()->where('parent_id', $category->getAttribute('id'))->orderBy('order_id', 'asc')->get();\n $category->setAttribute('children', $children);\n\n return $category;\n });\n $category->setAttribute('children', $children);\n\n return $category;\n });\n\n return $list->toArray();\n }"
] | [
"0.7382708",
"0.73814744",
"0.7122814",
"0.7009775",
"0.7009775",
"0.6850642",
"0.68419325",
"0.6830812",
"0.67784166",
"0.67660433",
"0.675087",
"0.675087",
"0.67475903",
"0.6679037",
"0.6604056",
"0.6584548",
"0.65528756",
"0.65378827",
"0.65378827",
"0.6508747",
"0.6508747",
"0.65055364",
"0.64816844",
"0.6449852",
"0.64162695",
"0.6387252",
"0.6377644",
"0.6373751",
"0.6361079",
"0.63281816",
"0.6322857",
"0.63042545",
"0.63002944",
"0.628278",
"0.62696224",
"0.6235507",
"0.622359",
"0.6200808",
"0.61911243",
"0.61866534",
"0.6173935",
"0.6173723",
"0.6172202",
"0.6168457",
"0.6145215",
"0.6143937",
"0.61351293",
"0.61315936",
"0.6125681",
"0.6125681",
"0.6125681",
"0.61144847",
"0.6113178",
"0.6102073",
"0.6101246",
"0.6097987",
"0.6094942",
"0.6094917",
"0.6080885",
"0.6078376",
"0.60544884",
"0.603834",
"0.6036837",
"0.6036837",
"0.6033161",
"0.6031713",
"0.602709",
"0.6021745",
"0.6020306",
"0.59983134",
"0.59940904",
"0.5992627",
"0.59899795",
"0.5979275",
"0.5973486",
"0.59728485",
"0.5972624",
"0.5965975",
"0.5962925",
"0.5956722",
"0.59530157",
"0.5948753",
"0.59460306",
"0.59456307",
"0.5944174",
"0.59376514",
"0.59311014",
"0.5924427",
"0.5922779",
"0.5920475",
"0.5918945",
"0.591482",
"0.59088147",
"0.59038043",
"0.5902384",
"0.5901445",
"0.58942485",
"0.5892722",
"0.58868366",
"0.588348"
] | 0.6247995 | 35 |
MCP ONLY Get all the translations for a category, and optionally return only a specific lang_id. | public function get_translations($cat_id = FALSE, $group_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $lang_id = FALSE)
{
if ( !$cat_id)
{
show_error('$cat_id is required. publisher_category.php->get_translations()');
}
if ( !$group_id)
{
show_error('$group_id is required. publisher_category.php->get_translations()');
}
$categories = array();
$translations = array();
$where = array(
'publisher_status' => $status,
'cat_id' => $cat_id,
'site_id' => ee()->publisher_lib->site_id
);
$qry = ee()->db->from('publisher_categories')
->where($where)
->get();
foreach ($qry->result() as $row)
{
$categories[$row->publisher_lang_id] = $row;
}
if ($lang_id)
{
$translations[$lang_id] = isset($categories[$lang_id]) ? $categories[$lang_id] : $categories[ee()->publisher_lib->default_lang_id];
}
else
{
$fields = $this->get_custom_fields($group_id);
$field_select_default = array();
foreach ($fields as $name => $field)
{
if (preg_match('/field_id_(\d+)/', $name, $matches))
{
$field_select_default[] = 'cfd.'. $name;
}
}
foreach ($this->get_enabled_languages() as $lid => $language)
{
// If we have existing category data
if (isset($categories[$lid]))
{
$translations[$lid] = $categories[$lid];
}
// If the language ID in the loop is what our current default lang is
elseif ($lid == ee()->publisher_lib->default_lang_id)
{
$default_qry = ee()->db->select('c.*, '. implode(',', $field_select_default))
->from('categories AS c')
->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')
->where('c.cat_id', $cat_id)
->where('c.site_id', ee()->publisher_lib->site_id)
->get();
$default_category = (object) array();
// Kind of silly, but NULL values in the DB don't work when accessing
// the property value, e.g. $category->$field_name will throw an error.
foreach ($default_qry->row() as $field => $value)
{
$default_category->$field = $value === NULL ? '' : $value;
}
$translations[$lid] = $default_category;
}
// The category has not been translated yet, so create the vars
// with an empty translation value so the view doesn't bomb.
else
{
$categories[$lid] = new stdClass();
// Make sure our object has the same properties, but blank,
// as a translated entry.
foreach ($fields as $file_name => $field_data)
{
$categories[$lid]->$file_name = '';
}
$categories[$lid]->cat_id = $cat_id;
$categories[$lid]->publisher_lang_id = $lid;
$translations[$lid] = $categories[$lid];
}
$translations[$lid]->text_direction = $this->get_language($lid, 'direction');
}
}
return $translations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllTranslationByLanguage();",
"public function getLanguages($category_id = NULL, $language_name = NULL)\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n if (is_null($language_name) && is_null($category_id))\n {\n $query = 'SELECT field_name, experience, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN language_categories\n ON languages.category = language_categories.id';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no languages found.';\n }\n }\n else if (is_null($language_name) && !is_null($category_id))\n {\n $query = 'SELECT field_name, experience, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN language_categories\n ON languages.category = language_categories.id\n WHERE languages.category = :language_category';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute(array(':language_category' => $category_id)))\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no languages in this category.';\n }\n }\n else if (!is_null($language_name) && is_null($category_id))\n {\n $query = 'SELECT field_name, experience_level, icon, language_categories.category_name\n FROM languages\n RIGHT JOIN skills_categories\n ON languages.category = language_categories.id\n WHERE languages.field_name = :language_name';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute(array(':language_name' => $language_name)))\n {\n return $sth->fetch();\n }\n else\n {\n return 'Oops, there\\'s no language with that name';\n }\n }\n else\n {\n return 'There\\'s an error with your code. We don\\'t expect you to pass both $category_id and $language_name';\n }\n }",
"public function getTranslations( ?string $category = null ) : array;",
"public function getMultilingual();",
"public function getLanguageCategories()\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n $query = 'SELECT id, category_name\n FROM language_categories';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no language categories found in the database.';\n }\n }",
"public static function getAll($aCat, $aLang = 'MA') {\n $lRet = array();\n \n $lSql = 'SELECT a.`content_id`, a.`parent_id`, b.`content`, b.`tokens`, b.`format`, b.`status`, c.`category`, a.`language`, a.`maxver` as ver ';\n $lSql.= 'FROM (SELECT `content_id`, `parent_id`, max(`version`) AS maxver, `language` ';\n $lSql.= 'FROM `al_cms_ref_lang` WHERE `language`='.esc($aLang).' GROUP BY `parent_id`,`language`) as a ';\n //$lSql.= 'INNER JOIN `al_cms_ref_lang` b ON (a.`parent_id`=b.`parent_id` AND a.`maxver`=b.`version` AND a.`language`=b.`language`) ';\n $lSql.= 'INNER JOIN (SELECT * FROM `al_cms_content` WHERE `mand`='.intval(MID).') as b ON (a.`content_id`=b.`content_id`) ';\n $lSql.= 'INNER JOIN `al_cms_ref_category` as c ON (a.`content_id`=c.`content_id`) ';\n if(!empty($aCat)) {\n $lCat = explode('_', $aCat);\n $lCat = $lCat[0];\n $lSql.= 'WHERE c.`category`='.esc($lCat).' ';\n }\n $lSql.= 'ORDER BY b.`parent_id`, b.`content` ASC';\n $lQry = new CCor_Qry($lSql);\n foreach ($lQry as $lRow) {\n $lCid = intval($lRow['content_id']);\n $lArr = array(\n \t'content_id' => $lCid,\n \t'parent_id' => intval($lRow['parent_id']),\n \t'content' => strip_tags($lRow['content']),\n \t'tokens' => $lRow['tokens'],\n 'format' => $lRow['format'],\n \t'status' => $lRow['status'],\n \t'language' => $lRow['language'],\n \t'version' => $lRow['ver'],\n \t'categories' => $lRow['category']\n );\n\n $lArr['metadata'] = self::getMetadata($lCid);\n $lArr['jobs'] = self::getJobs($lCid);\n \n if($lArr['language'] == 'MA'){\n $lRet[] = $lArr;\n }\n }\n \n return $lRet;\n }",
"public function get($cat_id = FALSE, $status = PUBLISHER_STATUS_OPEN, $translations = FALSE)\n {\n if ( !$cat_id)\n {\n show_error('$cat_id is required. publisher_category.php->get()');\n }\n\n if ($translations)\n {\n // TODO: turns out I never used this... Doesn't exist.\n return $this->get_category_translations($cat_id);\n }\n else\n {\n $qry = ee()->db->select('c.*, uc.*, c.cat_id as cat_id')\n ->from('publisher_categories AS uc')\n ->join('categories AS c', 'c.cat_id = uc.cat_id')\n ->where('c.cat_id', $cat_id)\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n return $qry->row() ?: FALSE;\n }\n }",
"protected abstract function getTranslations();",
"public function getTranslationsForLanguage($language);",
"public function translations($language = '') {\n if ($language == '') {\n $language = app()->getLocale();\n }\n return $this->hasMany(AdditionalFieldTranslation::class)\n ->whereIn('language', array($language, Config::get('app.fallback_locale')));\n }",
"protected function loadMessages($category, $language)\r\n {\r\n if ($this->cachingDuration > 0 && $this->cacheID !== false && ($cache = Yii::app()->getComponent($this->cacheID)) !== null) {\r\n $key = self::CACHE_KEY_PREFIX . '.messages.' . $category . '.' . $language;\r\n if (($data = $cache->get($key)) !== false)\r\n return unserialize($data);\r\n }\r\n\r\n $messages = $this->loadMessagesFromDb($category, $language);\r\n\r\n if (isset($cache))\r\n $cache->set($key, serialize($messages), $this->cachingDuration);\r\n\r\n return $messages;\r\n }",
"protected function loadMessages($category,$language)\n\t{\n\t\tif($this->cachingDuration>0 && $this->cacheID!==false && ($cache=Yii::app()->getComponent($this->cacheID))!==null)\n\t\t{\n\t\t\t$key=self::CACHE_KEY_PREFIX.'.messages.'.$category.'.'.$language;\n\t\t\tif(($data=$cache->get($key))!==false)\n\t\t\t\treturn unserialize($data);\n\t\t}\n\n\t\t$messages=$this->loadMessagesFromDb($category,$language);\n\n\t\tif(isset($cache))\n\t\t\t$cache->set($key,serialize($messages),$this->cachingDuration);\n\n\t\treturn $messages;\n\t}",
"public function loadLanguage($lang, $category)\n\t{\n\t\t//see if we have the language saved in the db\n\t\t$messages = $this->getConfigValue('messages');\n\t\t\n\t\tif(empty($messages)) //no language is saved, so revert to the file one\n\t\t{\n\t\t\t$messages = SyC::loadFileLanguage($lang,$category);\n\t\t}\n\t\t\n\t\t//make sure we have an array for this variable\n\t\tif(!is_array($messages)) $messages=array();\n\t\t\n\t\treturn $messages;\n\t}",
"protected function loadMessages($category, $language)\n {\n return resolve([]);\n }",
"protected function loadMessagesFromDb($category,$language)\n\t{\n\t\t$sql=<<<EOD\nSELECT t1.message AS message, t2.translation AS translation\nFROM {$this->sourceMessageTable} t1, {$this->translatedMessageTable} t2\nWHERE t1.id=t2.id AND t1.category=:category AND t2.language=:language\nEOD;\n\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t$command->bindValue(':category',$category);\n\t\t$command->bindValue(':language',$language);\n\t\t$messages=array();\n\t\tforeach($command->queryAll() as $row)\n\t\t\t$messages[$row['message']]=$row['translation'];\n\n\t\treturn $messages;\n\t}",
"public static function getBasicInfo($category_id=0, $language_id = 0)\n\t{\n\t\t$db = DataAccess::getInstance();\n\t\tif (!$category_id){\n\t\t\t//TODO: get this text from the DB somewhere...\n\t\t\treturn array('category_name' => \"Main\");\n\t\t}\n\t\tif (!$language_id){\n\t\t\t$language_id = $db->getLanguage();\n\t\t}\n\t\tif (isset(self::$_getInfoCache[$category_id][$language_id])){\n\t\t\treturn self::$_getInfoCache[$category_id][$language_id];\n\t\t}\n\t\t\n\t\t$sql = \"SELECT `category_name`,`category_cache`,`cache_expire`,`description` FROM \".geoTables::categories_languages_table.\" WHERE `category_id` = ? and language_id = ? LIMIT 1\";\n\t\t$result = $db->Execute($sql, array($category_id, $language_id));\n\t\tif (!$result || $result->RecordCount() == 0)\n\t\t{\n\t\t\ttrigger_error('ERROR CATEGORY SQL: Cat not found for id: '.$category_id.', Sql: '.$sql.' Error Msg: '.$db->ErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\t$show = $result->FetchRow();\n\t\t$show['category_name'] = geoString::fromDB($show['category_name']);\n\t\t$show['description'] = geoString::fromDB($show['description']);\n\t\t//save it, so we don't query the db a bunch\n\t\tself::$_getInfoCache[$category_id][$language_id] = $show;\n\t\treturn $show;\n\t}",
"public static function get_language_translation( $lang_id ) {\n\n\t\tstatic $translation;\n\n\t\t// from cache (used for multilingual)\n\t\tif ( ! is_null( $translation ) && isset( $translation[ $lang_id ] ) ) {\n\t\t\treturn $translation[ $lang_id ];\n\t\t}\n\n\t\t$languages = publisher_translation()->get_languages();\n\n\t\tif ( ! isset( $languages[ $lang_id ] ) ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation for selected language not found!', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\t\t// translation data from core\n\t\tif ( $languages[ $lang_id ]['type'] === 'core' && class_exists( 'BetterFramework_Oculus' ) ) {\n\n\t\t\t$core_translation = BetterFramework_Oculus::request( 'get-translation', array(\n\t\t\t\t'group' => 'translation',\n\t\t\t\t'json_assoc' => true,\n\t\t\t\t'data' => array(\n\t\t\t\t\t'code' => $lang_id\n\t\t\t\t)\n\t\t\t) );\n\n\t\t\tif ( is_wp_error( $core_translation ) ) {\n\t\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t\t'status' => 'Error',\n\t\t\t\t\t'error_code' => $core_translation->get_error_code(),\n\t\t\t\t\t'error_message' => $core_translation->get_error_message(),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! empty( $core_translation['success'] ) && ! empty( $core_translation['translation']['translation'] ) ) {\n\t\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'translation' => json_decode( $core_translation['translation']['translation'], true ),\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\n\t\t// url is not found for online\n\t\tif ( ! isset( $languages[ $lang_id ]['url'] ) ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation for selected language not found!', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\n\t\t/**\n\t\t * Filter translation file url\n\t\t *\n\t\t * @since 1.0.0\n\t\t */\n\t\t$translation_url = apply_filters( 'publisher-theme-core/translation/change-translation/file-url', $languages[ $lang_id ]['url'] );\n\n\t\t// Read translation json file\n\t\t$translation_options_data = wp_remote_get( $translation_url );\n\t\tif ( is_wp_error( $translation_options_data ) ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'Error',\n\t\t\t\t'error_code' => $translation_options_data->get_error_code(),\n\t\t\t\t'error_message' => $translation_options_data->get_error_message(),\n\t\t\t);\n\t\t}\n\n\t\t// request is not 200\n\t\t$http_code = wp_remote_retrieve_response_code( $translation_options_data );\n\t\tif ( $http_code !== 200 ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'error_code' => 'http-code-error',\n\t\t\t\t'error_message' => sprintf( __( 'Http request code was %s', 'publisher' ), $http_code ),\n\t\t\t);\n\t\t}\n\n\t\t// file body is not valid\n\t\t$translation_options_data = wp_remote_retrieve_body( $translation_options_data );\n\t\tif ( ! $translation_options_data ) {\n\t\t\treturn $translation[ $lang_id ] = array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation file for selected language not found!', 'publisher' ),\n\t\t\t);\n\t\t}\n\n\t\treturn $translation[ $lang_id ] = array(\n\t\t\t'status' => 'success',\n\t\t\t'translation' => json_decode( $translation_options_data, true ),\n\t\t);\n\n\t}",
"public function getTranslationCategories()\n {\n try {\n $model = $this->getTranslationModel();\n if ($model instanceof ActiveRecord) {\n $list = $model::find()->groupBy('category')->all();\n return ArrayHelper::getColumn($list, 'category');\n }\n } catch (\\Exception $ex) {\n Yii::error($ex->getMessage(), 'translations');\n }\n return [];\n }",
"protected function loadMessagesFromDb($category, $language)\r\n {\r\n $sql = \"SELECT message, translation_\" . $language . \" AS translation\r\n FROM {{translate_message}}\r\n WHERE category=:category\";\r\n $command = Yii::app()->db->createCommand($sql);\r\n $command->bindValue(':category', $category);\r\n $messages = array();\r\n foreach ($command->queryAll() as $row)\r\n $messages[$row['message']] = $row['translation'];\r\n\r\n return $messages;\r\n }",
"function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}",
"public function get_current($by_group = FALSE)\n {\n if ( !ee()->publisher_setting->enabled())\n {\n return array();\n }\n\n // @todo - cache\n if(FALSE)\n {\n\n }\n else if (isset(ee()->session->cache['publisher']['all_categories']))\n {\n if ($by_group)\n {\n return ee()->session->cache['publisher']['all_categories'][$by_group];\n }\n else\n {\n return ee()->session->cache['publisher']['all_categories'];\n }\n }\n else\n {\n // Grab the custom fields. We don't need field_id_N in our templates\n $fields = $this->get_custom_fields();\n\n $field_select_default = array();\n $field_select_custom = array();\n\n foreach ($fields as $name => $field)\n {\n if (preg_match('/field_id_(\\d+)/', $name, $matches))\n {\n $field_select_default[] = 'cfd.'. $name .' AS \\''. $field->field_name.'\\'';\n $field_select_custom[] = $name .' AS \\''. $field->field_name.'\\'';\n }\n }\n\n $qry = ee()->db->select('c.*, '. implode(',', $field_select_default))\n ->from('categories AS c')\n ->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')\n ->where('c.site_id', ee()->publisher_lib->site_id)\n ->get();\n\n ee()->session->cache['publisher']['all_categories'] = array();\n ee()->session->cache['publisher']['translated_categories'] = array();\n\n foreach ($qry->result_array() as $category)\n {\n ee()->session->cache['publisher']['all_categories'][$category['group_id']][$category['cat_id']] = $category;\n }\n\n $where = array(\n 'publisher_lang_id' => ee()->publisher_lib->lang_id,\n 'publisher_status' => ee()->publisher_lib->status,\n 'site_id' => ee()->publisher_lib->site_id\n );\n\n $qry = ee()->db->select('*, '. implode(',', $field_select_custom))\n ->from('publisher_categories')\n ->where($where)\n ->get();\n\n foreach ($qry->result_array() as $category)\n {\n ee()->session->cache['publisher']['translated_categories'][$category['group_id']][$category['cat_id']] = $category;\n }\n\n foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)\n {\n foreach ($group as $cat_id => $category)\n {\n if (isset(ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id]))\n {\n foreach (ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id] as $field_name => $field_value)\n {\n if ($field_value != '')\n {\n ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][$field_name] = $field_value;\n }\n }\n }\n }\n }\n\n foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)\n {\n foreach ($group as $cat_id => $category)\n {\n foreach ($category as $field => $value)\n {\n ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][str_replace('cat_', 'category_', $field)] = $value;\n }\n }\n }\n\n if ($by_group)\n {\n return ee()->session->cache['publisher']['all_categories'][$by_group];\n }\n else\n {\n return ee()->session->cache['publisher']['all_categories'];\n }\n }\n }",
"public function getTranslations( $language )\n\t{\n\t\t$sql = <<<TRANSLATIONS\nSELECT\n\t*\nFROM\n\t`i18n_messages` m\nLEFT JOIN\n\ti18n_translations t ON m.id=t.id_message AND lang =?\nORDER BY\n\tt.translation ASC, m.message ASC\nTRANSLATIONS;\n\n\treturn $this->GetArray( $sql, array( $language, 'tag' => 'Get all translations for current language' ) );\n\t}",
"public function getCategories($language = null) {\n global $db, $langval;\n if ($language === null) $language = $langval;\n $arCategories = $db->fetch_table(\"SELECT el.*, s.T1, s.V1, s.V2 FROM `kat` el\n LEFT JOIN `string_kat` s ON s.S_TABLE='kat' AND s.FK=el.ID_KAT\n AND s.BF_LANG=if(el.BF_LANG_KAT & \".$language.\", \".$language.\", 1 << floor(log(el.BF_LANG_KAT+0.5)/log(2)))\n WHERE ROOT=1 AND B_VIS=1 AND KAT_TABLE='\".$this->tableName.\"'\n ORDER BY el.ORDER_FIELD\");\n return $arCategories;\n }",
"protected function loadMessages($category, $language)\n {\n $messages = $this->_loadFromDb($category, $language);\n return $messages;\n }",
"public function getById($id){\n\t\t$url = WEBSERVICE. \"languages/getById/\" . $id;\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, true);\n\t}",
"public function getCategoriesAndParents() {\n\t\t$cats = array();\n\t\tif ($this->categories) {\n\t\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['camaliga']);\n\t\t\t$catMode = intval($configuration[\"categoryMode\"]);\n\t\t\t$lang = intval($GLOBALS['TSFE']->config['config']['sys_language_uid']);\n\t\t\t// Step 1: select all categories of the current language\n\t\t\t$categoriesUtility = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('\\quizpalme\\Camaliga\\Utility\\AllCategories');\n\t\t\t$all_cats = $categoriesUtility->getCategoriesarrayComplete();\n\t\t\t// Step 2: aktuelle orig_uid herausfinden\n\t\t\t$orig_uid = intval($this->getUid());\t// ist immer die original uid (nicht vom übersetzten Element!)\n\t\t\tif ($lang > 0 && $catMode == 0) {\n\t\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid',\n\t\t\t\t\t\t'tx_camaliga_domain_model_content',\n\t\t\t\t\t\t'deleted=0 AND hidden=0 AND sys_language_uid=' . $lang . ' AND t3_origuid=' . $orig_uid);\n\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4))\n\t\t\t\t\t\tif ($row['uid']) {\n\t\t\t\t\t\t\t$orig_uid = intval($row['uid']);\t// uid of the translated element\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t\t}\n\t\t\t// Step 3: get the mm-categories of the current element (from the original or translated element)\n\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_local',\n\t\t\t\t'sys_category_record_mm',\n\t\t\t\t\"tablenames='tx_camaliga_domain_model_content' AND uid_foreign=\" . $orig_uid);\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4)){\n\t\t\t\t\t$uid = $row['uid_local'];\n\t\t\t\t\tif (!isset($all_cats[$uid]['parent'])) continue;\n\t\t\t\t\t$parent = (int) $all_cats[$uid]['parent'];\n\t\t\t\t\t//if (!$all_cats[$parent]['title'])\tcontinue;\n\t\t\t\t\tif (!isset($cats[$parent])) {\n\t\t\t\t\t\t$cats[$parent] = array();\n\t\t\t\t\t\t$cats[$parent]['childs'] = array();\n\t\t\t\t\t\t$cats[$parent]['title'] = $all_cats[$parent]['title'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($all_cats[$uid]['title'])\n\t\t\t\t\t\t$cats[$parent]['childs'][$uid] = $all_cats[$uid]['title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t}\n\t\treturn $cats;\n\t}",
"protected function _loadFromDb($category, $language)\n {\n $criteria = new \\EMongoCriteria();\n $criteria\n ->addCond('category', '==', $category)\n ->addCond('language', '==', $language);\n $itemList = Item::model()->findAll($criteria);\n\n $messages = array();\n foreach ($itemList as $item) {\n $messages[$item->message] = $item->translation;\n }\n\n return $messages;\n }",
"public function getAll(){\n\t\t$url = WEBSERVICE. \"languages/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, false);\n\t}",
"function product_categories($lang = 'en_us')\n\t{\n\t\t$lang = str_replace('_', '-', $lang);\n\t\t\n\t\t$content = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t\t<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\t\t\t\t<soap:Header>\n\t\t\t\t\t<ServiceAuthHeader xmlns=\"http://tempuri.org/\">\n\t\t\t\t\t\t<UserName>' . $this->username . '</UserName>\n\t\t\t\t\t\t<Password>' . $this->password . '</Password>\n\t\t\t\t\t</ServiceAuthHeader>\n\t\t\t\t</soap:Header>\n\t\t\t\t<soap:Body>\n\t\t\t\t\t<product_categories xmlns=\"http://tempuri.org/\">\n\t\t\t\t\t\t<lang>'.$lang.'</lang>\n\t\t\t\t\t</product_categories>\n\t\t\t\t</soap:Body>\n\t\t\t</soap:Envelope>';\n\t\t\n\t\t$headers = array( \n\t\t\t'POST /redactedapiservice.asmx HTTP/1.1',\n\t\t\t'Host: 000.00.000.185',\n\t\t\t'Content-Type: text/xml; charset=utf-8',\n\t\t\t'Content-Length: ' . strlen($content),\n\t\t\t'SOAPAction: \"http://tempuri.org/product_categories\"',\n\t\t);\n\t\t\n\t\treturn $this->_init_curl($content, $this->url, $headers);\n\t\n\t}",
"function GetLocalizedTextsByLanguageId($languageId)\n\t{\n\t\t$result = $this->sendRequest(\"GetLocalizedTextsByLanguageId\", array(\"LanguageId\"=>$languageId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public static function getTranslationHelperObjects($clang_id, $type)\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang '\n .'WHERE clang_id = '. $clang_id .\" AND translation_needs_update = 'yes' \"\n .'ORDER BY name';\n if ('missing' === $type) {\n $query = 'SELECT main.category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories AS main '\n .'LEFT JOIN '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang AS target_lang '\n .'ON main.category_id = target_lang.category_id AND target_lang.clang_id = '. $clang_id .' '\n .'LEFT JOIN '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang AS default_lang '\n .'ON main.category_id = default_lang.category_id AND default_lang.clang_id = '. \\rex_config::get('d2u_helper', 'default_lang') .' '\n .'WHERE target_lang.category_id IS NULL '\n .'ORDER BY default_lang.name';\n $clang_id = (int) \\rex_config::get('d2u_helper', 'default_lang');\n }\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $objects = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $objects[] = new self((int) $result->getValue('category_id'), $clang_id);\n $result->next();\n }\n\n return $objects;\n }",
"function extras_translated_data($lang, $id) {\r\n\t\t\t\t$this->db->where('trans_extras_id', $id);\r\n\t\t\t\t$this->db->where('trans_lang', $lang);\r\n\t\t\t\treturn $this->db->get('pt_extras_translation')->result();\r\n\t\t}",
"public function languageWhere() {}",
"public function languageWhere() {}",
"function attachCategoryToMeal($meal, $lang){\n \n $category_array = [];\n $category = Category::findOrFail($meal->category_id);\n $translation = CategoryTranslations::all()\n ->where('category_id',$meal->category_id)\n ->where('locale',$lang)\n ->first();\n \n $category_array['id'] = $category->id;\n $category_array['title'] = $translation->title;\n $category_array['slug'] = $category->slug;\n \n \n\n return $category_array;\n\n\n }",
"public function getLanguageList();",
"public function get($id) {\r\n\t\t$sql = \"Select * From #languages Where id = $id\";\r\n\t\t$result = $this->_get($sql);\r\n\t\treturn $result;\r\n\t}",
"function getLanguageById ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/languages/{$id}.json\");\n return $this->createResponse($result,'get Language','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"function getLangById($langId=0) {\n\t\tglobal $vsLang;\n\n\t\t$this->result['status'] = true;\n\t\t$this->language->setId($langId);\n\n\t\tif(!isset($this->arrayLang[$this->language->getId()])) {\n\t\t\t$this->result['status'] = false;\n\t\t\t$this->result['message'] = $vsLang->getWords('lang_no_id','There is no item with specified ID!');\n\t\t\treturn;\n\t\t}\n//\t\tprint \"<pre>\";\n//\t\tprint_r($this->language->getId());\n//\t\tprint \"</pre>\";\n//print \"<pre>\";\n//print_r($this->arrayLang);\n//print \"</pre>\";\n\t\treturn $this->arrayLang[$this->language->getId()];\n\t}",
"public function getAllByIdLang($id, $lang_id = 1)\r\n {\r\n $data = $this->select()\r\n ->from($this->_name)\r\n ->where('package_id = ?', $id)\r\n ->where('language_id = ?', $lang_id);\r\n return $this->fetchAll($data);\r\n }",
"public function getListLanguage()\n\t{\n\t\t$params = [\n\t\t\t'verify' => false,\n\t\t\t'query' => [\n\t\t\t\t'output' => Config::get( 'response.format' )\n\t\t\t]\n\t\t];\n\n\t\t$baseUrl = sprintf( Config::get( 'endpoints.base_url' ), Config::get( 'settings.api' ) ) . Config::get( 'endpoints.general_list_language' );\n\n\t\ttry {\n\t\t\t$response = parent::send( 'GET', $baseUrl, $params );\n\t\t} catch (TiketException $e) {\n\t\t\tthrow parent::convertException( $e );\n\t\t}\n\n\t\treturn $response;\n\t}",
"function getCourseCategoryByCategoryId($id){\n\n $select=$this->select()->where(\" categoryid = ?\",$id);\n return $this->fetchAll($select)->toArray();\n }",
"public function getLanguagesTranslations(Request $request, $lang)\n {\n $totalData = 0;\n $columns = array(\n 0 => '#',\n 1 => 'id',\n 2 => 'lang_key',\n 3 => 'lang_value',\n 4 => 'action'\n );\n $limit = $request->input('length');\n $start = $request->input('start');\n $start = $start ? $start / $limit : 0;\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n $translations = Translation::where('lang', $lang)->orderBy($order, $dir);\n $totalData = $translations->count();\n\n if (!empty($request->input('search.value'))) {\n $search = $request->input('search.value');\n $translations = $translations->where('id', 'LIKE', \"%{$search}%\")\n ->orWhere('lang_key', 'LIKE', \"%{$search}%\");\n }\n $translations = $translations->paginate($limit, ['*'], 'page', $start + 1);\n $totalFiltered = $translations->total();\n $data = array();\n if (!empty($translations)) {\n foreach ($translations as $key => $language_translation) {\n $nestedData['#'] = '<input type=\"checkbox\" name=\"bulk_delete[]\" class=\"checkboxes\" value=\"' . $language_translation->id . '\" />';\n $nestedData['id'] = ($start * $limit) + $key + 1;\n $nestedData['lang_key'] = $language_translation->lang_key;\n $nestedData['lang_value'] = '<input type=\"text\" class=\"form-control\" name=\"values[' . $language_translation->lang_key . ']\" value=\"' . $language_translation->lang_value . '\" />';\n $delete = route('languages_trans.destroy', encrypt($language_translation->id));\n $exist = $language_translation;\n $comp = true;\n $nestedData['action'] = view('language.partials.translation-action', compact('exist', 'delete', 'language_translation'))->render();\n $data[] = $nestedData;\n }\n }\n $json_data = array(\n \"draw\" => intval($request->input('draw')),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data\n );\n return json_encode($json_data);\n }",
"function GetWPContentByLang($Lang,&$wpHeader,&$nWP) { // id, wp_Name, get1, get2, get3, lang\n\t\t$SQLStrQuery=\"CALL GetWPContentByLang('$Lang')\"; // \"SELECT * FROM WPSContent WHERE lang='\".$Lang.\"' ORDER BY id_wph, sec\";\n\t\tSQLQuery($rPointer,$nWP,$SQLStrQuery,true);\n\t\tConvertPointerToArray($rPointer,$wpHeader,$nWP,6);\n\t}",
"public function get_desired_languages();",
"function fetch_languages( $module_id = false )\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id',$module_id );\n\t\t}\n\t\t$query=$this->db->get( 'languages' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}",
"public function get($id, $lang= NULL) {\n static $l= NULL;\n \n if (NULL == $lang) $lang= $this->lang;\n if ($l != $lang) {\n $l= $lang;\n $this->setLanguage($lang);\n }\n return _($id);\n }",
"public function languages_get() {\n $languages = $this->api_model->languages_get();\n $this->set_response($languages, REST_Controller::HTTP_OK);\n }",
"public function getTranslationID($lang = false)\n {\n }",
"function get_all_courses_category_wise($category)\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.seo_url', $category);\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n // return $this->db->last_query();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }",
"public function findlanguage_itemsById($id)\n\t{\n\t\treturn language_items::find($id);\n\t}",
"public function index(){\n\n $default_lang = get_default_language(); // get the default language\n $categories = Category::where('translation_lang',$default_lang)-> selection() -> get();\n return view('admin.categories.index',compact('categories'));\n }",
"protected function getLanguages() {}",
"public function translations() {\n return $this->client->get(self::$apiName, array());\n }",
"public function allLanguageContents()\n {\n $ref = defined('static::REF_KEY') ? static::REF_KEY : ($this->table??'data');\n return $this->hasMany('App\\\\Models\\\\MultiLanguageContent', 'ref_id', 'id')->where('ref', $ref);\n }",
"function get_my_languages(){\n $creds = $this->auth_model->getUserCredentials();\n if($creds->intid != ''){\n $query = $this->db->query('SELECT DISTINCT language_code, language FROM interpreters WHERE iid = ' . $creds->intid . ';');\n return $query->result();\n } else{\n return FALSE;\n }\n }",
"public function getById($id, $language = false, $noTranslation = false){\n $result = $this->getAll($language,$noTranslation,false,false,$id);\n if(!is_array($id) && is_array($result)){\n $result = current($result);\n }\n return $result;\n }",
"public function index()\n {\n $categories = QueryBuilder::for(Category::class)\n ->select('categories.*', 'category_translations.name')\n ->join('category_translations', 'categories.id', '=', 'category_translations.category_id')\n ->where('category_translations.locale', '=', app()->getLocale())\n ->allowedSorts(['name', 'created_at'])\n ->allowedIncludes(['posts', 'translations'])\n ->jsonPaginate();\n// dd(new CategoriesCollection($categories));\n return new CategoriesCollection($categories);\n }",
"public function getAllByLang($lang_id = 1)\r\n {\r\n $data = $this->select()\r\n ->from($this->_name)\r\n ->where('language_id = ?', $lang_id);\r\n return $this->fetchAll($data);\r\n }",
"public function getLanguage($book_id);",
"public function getLanguage(int $id)\n {\n $endpoint = $this->endpoints['getLanguage'];\n $uri = str_replace(\"{id}\", $id, $endpoint['uri']);\n return $this->sendRequest($endpoint['method'], $uri);\n }",
"function getCategory($id_category){\n $db = db();\n $db->begin();\n $data = $db->exec('SELECT * FROM m_song WHERE fk_id_category = '.$id_category);\n\n return $data;\n }",
"public function actionIndex($language = \"en\")\n { \n Yii::$app->language = $language;\n $request = Yii::$app->request;\n $model = new $this->modelClass;\n\n // check last update\n $cacheData = Lastupdate::checkUpdate('category_key', $request->get('category_key')); \n $cache = 1; // new entries \n $current_key = Lastupdate::getKey('category_key');\n $key = $current_key['category_key']; // current key \n \n /* Generate cache key */\n if($cacheData == 1)\n { \n $cache = 0; \n $categories = (Object)[]; \n }\n else\n {\n $categories = $model->find()\n ->select(['category_id', 'IFNULL(parent_category_id, 0) as parent_category_id', 'category_name_en', 'category_name_ar', 'category_vendors_filterable_by_area'])\n ->where(['status' => 1])\n ->orderBy('{{%category}}.category_id DESC')\n ->asArray()\n ->all(); \n }\n \n if($categories)\n return ['code' => parent::STATUS_SUCCESS, 'message' => Yii::t(\"api\", \"testing\"), 'data' => ['categories' => $categories, 'key' => $key, 'cache' => $cache]];\n else\n return ['code' => parent::STATUS_FAILURE, 'message' => Yii::t(\"api\", \"testing\"), 'data' => (Object)[]];\n }",
"public function getLanguage($controller);",
"public function category_wise_course_get() {\n $category_id = $_GET['category_id'];\n $courses = $this->api_model->category_wise_course_get($category_id);\n $this->set_response($courses, REST_Controller::HTTP_OK);\n }",
"public function get_sitemap()\n\t{\n $this->db->select('*');\n $this->db->join($this->_table_name.'_lang', $this->_table_name.'.id = '.$this->_table_name.'_lang.category_id');\n $categories = parent::get();\n \n return $categories;\n\t}",
"public function get($category_id);",
"public function getTranslations()\n {\n return $this->hasMany(NewsItemLang::class, ['news_item_id' => 'id']);\n }",
"public function get_no_parents($lang_id=1)\n\t{\n $this->db->select('*');\n $this->db->where('parent_id', 0);\n $this->db->join($this->_table_name.'_lang', $this->_table_name.'.id = '.$this->_table_name.'_lang.category_id');\n $this->db->where('language_id', $lang_id);\n $categories = parent::get();\n \n // Return key => value pair array\n $array = array(0 => 'Select');\n //$array = array(0 => lang('No parent'));\n if(count($categories))\n {\n foreach($categories as $n)\n {\n $array[$n->id] = $n->title;\n }\n }\n \n return $array;\n\t}",
"public function translationsAll()\n {\n return $this->hasMany($this->translatableModel, 'source_id');\n }",
"public function getLanguages() {}",
"public function getLangById($id){\n\t\t$query = $this->db->get_where(\"languages\", array(\"id\" => $id));\n\t\tif($query->num_rows()==1)\n\t\t\treturn $query->row();\n\t\treturn false;\n\t}",
"public function getLang();",
"public function getPagesByLanguageIdAction(){\n\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $chapId = Zend_Auth::getInstance()->getIdentity()->id;\n $language = $this->_request->getParam('language');\n\n $menuModel = new Pbo_Model_WlPages();\n $pages = $menuModel->getPagesByLanguageId($chapId, $language);\n\n echo json_encode($pages->toArray());\n\n }",
"public function getLanguages();",
"public function getAllWithCategory();",
"public function getTranslations()\n {\n return $this->language;\n }",
"public function languages()\n {\n return $this->belongsToMany(Language::class, ItemTranslations::getTableName(), 'source_id');\n }",
"public function getTranslationsForKey($key);",
"function get_localization($language_name)\n {\n return $this->db->get_where('localization',array('language_name'=>$language_name))->row_array();\n }",
"public function getAllLangue(){\n\n global $conn;\n \n $request_all = \"SELECT * FROM `langue`\";\n $get_all_langue = $conn->query($request_all);\n\n return $get_all_langue;\n }",
"function loadTranslation($language = 'en')\n{\n $content = json_decode(file_get_contents(TRANSLATIONS_FOLDER . DS . $language . '.json'), true);\n if ($content && count($content)) {\n return $content;\n } else {\n return $language == 'en' ? array() : loadTranslation('en');\n }\n}",
"public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }",
"public function getBaseCategory($languageId = null) \n\t{\t\n\t\t$baseCategory = $this->getTableFields('category');\n\t\tunset($baseCategory['category_id']);\t\t\n\n\t\t$baseCategoryDescription = $this->getTableFields('category_description');\n\t\tunset($baseCategoryDescription['category_id']);\n\t\t\n\t\tif ($languageId == null) {\n\t\t\t$languageId = $this->config->get('config_language_id');\n\t\t}\n\t\t$baseCategory['category_description'] = array();\n\t\t$baseCategory['category_description'][$languageId] = $baseCategoryDescription;\n\t\t\n\t\treturn $baseCategory;\t\n\t}",
"public function allTranslationsFor($language)\n {\n return Collection::make([\n 'group' => $this->getGroupTranslationsFor($language),\n 'single' => $this->getSingleTranslationsFor($language),\n ]);\n }",
"public function getLanguages($book_id);",
"static function get_category_by_id($category){\n\t\treturn self::$db->where('id',$category)->get('categories')->results();\n\t}",
"public function category_wise_course_get($category_id) {\n\t\t$category_details = $this->crud_model->get_category_details_by_id($category_id)->row_array();\n\n\t\tif ($category_details['parent'] > 0) {\n\t\t\t$this->db->where('sub_category_id', $category_id);\n\t\t}else {\n\t\t\t$this->db->where('category_id', $category_id);\n\t\t}\n\t\t$this->db->where('status', 'active');\n\t\t$courses = $this->db->get('course')->result_array();\n\n\t\t// This block of codes return the required data of courses\n\t\t$result = array();\n\t\t$result = $this->course_data($courses);\n\t\treturn $result;\n\t}",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getLanguage();",
"public function getTranslations()\n {\n }",
"public function getLanguage() {}",
"public function getTranslationsById()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n if (!$trans->getId()) {\n continue;\n }\n $out[$trans->getId()] = $trans;\n }\n\n return$out;\n }",
"public static function change_translation( $lang_id, $multilingual = null ) {\n\n\t\tif ( $multilingual === 'en_US' || $multilingual === 'none' || empty( $multilingual ) ) {\n\t\t\t$_multilingual = '';\n\t\t} else {\n\t\t\t$_multilingual = '_' . $multilingual;\n\t\t}\n\n\t\t// Don't download file for \"en_US\"\n\t\tif ( $lang_id === 'en_US' ) {\n\n\t\t\t// empty panel -> data will be come from STD\n\t\t\t$panel_data = array(\n\t\t\t\t'lang-id' => $lang_id\n\t\t\t);\n\n\t\t\tupdate_option( publisher_translation()->option_panel_id . $_multilingual, $panel_data, ! empty( $_multilingual ) ? 'no' : 'yes' );\n\t\t\tpublisher_translation()->set_current_lang( $lang_id, $multilingual );\n\n\t\t\t$result = array(\n\t\t\t\t'status' => 'succeed',\n\t\t\t\t'msg' => sprintf( __( 'Theme translation changed to \"%s\"', 'publisher' ), __( 'English - US', 'publisher' ) ),\n\t\t\t\t'refresh' => true\n\t\t\t);\n\n\t\t\t// Add admin notice\n\t\t\tBetter_Framework()->admin_notices()->add_notice( array(\n\t\t\t\t'msg' => $result['msg'],\n\t\t\t\t'thumbnail' => publisher_translation()->notice_icon,\n\t\t\t\t'product' => 'theme:publisher',\n\t\t\t) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t$languages = publisher_translation()->get_languages();\n\n\t\t/**\n\t\t * Fires before changing translation\n\t\t *\n\t\t * @param string $lang_id Selected translation id for change\n\t\t * @param array $translations All active translations list\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t */\n\t\tdo_action( 'publisher-theme-core/translation/change-translation/before', $lang_id, $languages );\n\n\t\t$translation = self::get_language_translation( $lang_id );\n\n\t\tif ( $translation['status'] === 'error' ) {\n\t\t\t$translation['refresh'] = false;\n\n\t\t\treturn $translation;\n\t\t}\n\n\t\t/**\n\t\t * Filter translation data\n\t\t *\n\t\t * @since 1.0.0\n\t\t */\n\t\t$data = apply_filters( 'publisher-theme-core/translation/change-translation/data', $translation['translation'] );\n\n\n\t\t// Validate translation file data\n\t\tif ( ! isset( $data['panel-id'] ) || empty( $data['panel-id'] ) || ! isset( $data['panel-data'] ) ) {\n\n\t\t\treturn array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'msg' => __( 'Translation file for selected language is not valid!', 'publisher' ),\n\t\t\t\t'refresh' => false\n\t\t\t);\n\n\t\t}\n\n\t\t// Validate translation panel id\n\t\tif ( $data['panel-id'] !== publisher_translation()->option_panel_id ) {\n\n\t\t\treturn array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'error_code' => 'invalid-translation',\n\t\t\t\t'msg' => sprintf( __( 'Translation file is not valid for \"%s\"', 'publisher' ), publisher_translation()->publisher ),\n\t\t\t\t'refresh' => false\n\t\t\t);\n\n\t\t}\n\n\t\t// Save translation and update current lang\n\t\tupdate_option( publisher_translation()->option_panel_id . $_multilingual, $data['panel-data'], ! empty( $_multilingual ) ? 'no' : 'yes' );\n\t\tpublisher_translation()->set_current_lang( $lang_id, $multilingual );\n\n\t\t$result = array(\n\t\t\t'status' => 'succeed',\n\t\t\t'msg' => sprintf( __( 'Theme translation changed to \"%s\"', 'publisher' ), $languages[ $lang_id ]['name'] ),\n\t\t\t'refresh' => true\n\t\t);\n\n\t\t// Add admin notice\n\t\tBetter_Framework()->admin_notices()->add_notice( array(\n\t\t\t'msg' => $result['msg'],\n\t\t\t'thumbnail' => publisher_translation()->notice_icon,\n\t\t\t'product' => 'theme:publisher',\n\t\t) );\n\n\t\treturn $result;\n\t}",
"public function preloadMessages($category, $languages = [])\n {\n if ($category === '*') {\n $categoriesFind = $this->findAllCategories();\n } else {\n $categoriesFind = strpos($category, '*') > 0 ? $this->findCategoriesByPattern($category) : resolve([$category]);\n }\n return $categoriesFind\n ->otherwise(function() { return []; })\n ->then(function($categories) use ($languages) {\n $promises = [];\n foreach ($categories as $category) {\n foreach ($languages as $language) {\n $key = $language . '/' . $category;\n $promises[$key] = $this->loadMessages($category, $language);\n }\n }\n if (empty($promises)) {\n return [];\n }\n return all($promises)\n ->then(function($results) {\n $this->_messages = Reaction\\Helpers\\ArrayHelper::merge($this->_messages, $results);\n return $results;\n });\n });\n }",
"public function fetchAll(int $langId) : array\n {\n return $this->createEntitySelect($this->getColumns())\n ->whereEquals(RoomCategoryTranslationMapper::column('lang_id'), $langId)\n ->orderBy($this->getPk())\n ->desc()\n ->queryAll();\n }"
] | [
"0.687502",
"0.6645714",
"0.65657455",
"0.6527444",
"0.63609296",
"0.60629493",
"0.6013262",
"0.5933166",
"0.5875027",
"0.57991856",
"0.57625335",
"0.575892",
"0.57574594",
"0.5754433",
"0.5742737",
"0.57411486",
"0.57222575",
"0.5719788",
"0.5713194",
"0.57118034",
"0.5704997",
"0.5698633",
"0.56455743",
"0.5633233",
"0.559215",
"0.55880773",
"0.555467",
"0.55439407",
"0.5531204",
"0.5525005",
"0.55215067",
"0.5510497",
"0.55004966",
"0.55004966",
"0.5490515",
"0.5490242",
"0.5488116",
"0.547344",
"0.5473159",
"0.5465736",
"0.54255956",
"0.5423654",
"0.542106",
"0.5412372",
"0.54047805",
"0.5391701",
"0.53853047",
"0.5384579",
"0.53766215",
"0.5370807",
"0.53621465",
"0.536103",
"0.53586584",
"0.5355237",
"0.5352166",
"0.5345952",
"0.53299606",
"0.53238237",
"0.5313305",
"0.5312714",
"0.531213",
"0.53060466",
"0.5305976",
"0.52932674",
"0.5289807",
"0.52799684",
"0.5262631",
"0.5259196",
"0.525847",
"0.5254708",
"0.5247032",
"0.5240944",
"0.5239553",
"0.5231507",
"0.5226758",
"0.52204484",
"0.5198493",
"0.5194965",
"0.5194625",
"0.5193888",
"0.5192264",
"0.519122",
"0.51902866",
"0.51899266",
"0.5189823",
"0.5189149",
"0.5178748",
"0.5171144",
"0.516722",
"0.516722",
"0.516722",
"0.516722",
"0.516722",
"0.516722",
"0.5162182",
"0.51590663",
"0.5158804",
"0.5146893",
"0.5144405",
"0.51422626"
] | 0.71551293 | 0 |
Get the categories for the current language | public function get_current($by_group = FALSE)
{
if ( !ee()->publisher_setting->enabled())
{
return array();
}
// @todo - cache
if(FALSE)
{
}
else if (isset(ee()->session->cache['publisher']['all_categories']))
{
if ($by_group)
{
return ee()->session->cache['publisher']['all_categories'][$by_group];
}
else
{
return ee()->session->cache['publisher']['all_categories'];
}
}
else
{
// Grab the custom fields. We don't need field_id_N in our templates
$fields = $this->get_custom_fields();
$field_select_default = array();
$field_select_custom = array();
foreach ($fields as $name => $field)
{
if (preg_match('/field_id_(\d+)/', $name, $matches))
{
$field_select_default[] = 'cfd.'. $name .' AS \''. $field->field_name.'\'';
$field_select_custom[] = $name .' AS \''. $field->field_name.'\'';
}
}
$qry = ee()->db->select('c.*, '. implode(',', $field_select_default))
->from('categories AS c')
->join('category_field_data AS cfd', 'cfd.cat_id = c.cat_id', 'left')
->where('c.site_id', ee()->publisher_lib->site_id)
->get();
ee()->session->cache['publisher']['all_categories'] = array();
ee()->session->cache['publisher']['translated_categories'] = array();
foreach ($qry->result_array() as $category)
{
ee()->session->cache['publisher']['all_categories'][$category['group_id']][$category['cat_id']] = $category;
}
$where = array(
'publisher_lang_id' => ee()->publisher_lib->lang_id,
'publisher_status' => ee()->publisher_lib->status,
'site_id' => ee()->publisher_lib->site_id
);
$qry = ee()->db->select('*, '. implode(',', $field_select_custom))
->from('publisher_categories')
->where($where)
->get();
foreach ($qry->result_array() as $category)
{
ee()->session->cache['publisher']['translated_categories'][$category['group_id']][$category['cat_id']] = $category;
}
foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)
{
foreach ($group as $cat_id => $category)
{
if (isset(ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id]))
{
foreach (ee()->session->cache['publisher']['translated_categories'][$group_id][$cat_id] as $field_name => $field_value)
{
if ($field_value != '')
{
ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][$field_name] = $field_value;
}
}
}
}
}
foreach (ee()->session->cache['publisher']['all_categories'] as $group_id => $group)
{
foreach ($group as $cat_id => $category)
{
foreach ($category as $field => $value)
{
ee()->session->cache['publisher']['all_categories'][$group_id][$cat_id][str_replace('cat_', 'category_', $field)] = $value;
}
}
}
if ($by_group)
{
return ee()->session->cache['publisher']['all_categories'][$by_group];
}
else
{
return ee()->session->cache['publisher']['all_categories'];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_categories() {\n\t\treturn array( 'listeo' );\n\t}",
"public function getCategories();",
"public function getCategories();",
"public function categories() {\n\t\treturn $this->terms('category');\n\t}",
"public function get_categories() {\n\t\treturn $this->terms('category');\n\t}",
"public function get_categories() {\n\t\treturn [ 'general' ];\n\t}",
"public function get_categories() {\n\t\treturn [ 'general' ];\n\t}",
"public function get_categories() {\n\t\treturn [ 'general' ];\n\t}",
"public function getLanguageCategories()\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n $query = 'SELECT id, category_name\n FROM language_categories';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n return $sth->fetchAll();\n }\n else\n {\n return 'Oops, no language categories found in the database.';\n }\n }",
"public function getCategories($language = null) {\n global $db, $langval;\n if ($language === null) $language = $langval;\n $arCategories = $db->fetch_table(\"SELECT el.*, s.T1, s.V1, s.V2 FROM `kat` el\n LEFT JOIN `string_kat` s ON s.S_TABLE='kat' AND s.FK=el.ID_KAT\n AND s.BF_LANG=if(el.BF_LANG_KAT & \".$language.\", \".$language.\", 1 << floor(log(el.BF_LANG_KAT+0.5)/log(2)))\n WHERE ROOT=1 AND B_VIS=1 AND KAT_TABLE='\".$this->tableName.\"'\n ORDER BY el.ORDER_FIELD\");\n return $arCategories;\n }",
"public function get_categories()\n\t{\n\t\treturn array('general');\n\t}",
"public function get_categories() {\n\t\treturn array( 'general' );\n\t}",
"public function get_categories() {\n return array ( 'general' );\n }",
"public function getCategories()\n {\n return $this->request(\"core_course_get_categories\");\n }",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"public function get_categories()\n {\n return ['general'];\n }",
"public function get_categories()\n {\n return ['general'];\n }",
"public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}",
"public function getTranslationCategories()\n {\n try {\n $model = $this->getTranslationModel();\n if ($model instanceof ActiveRecord) {\n $list = $model::find()->groupBy('category')->all();\n return ArrayHelper::getColumn($list, 'category');\n }\n } catch (\\Exception $ex) {\n Yii::error($ex->getMessage(), 'translations');\n }\n return [];\n }",
"public function getAllCategories();",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"function get_categories()\n\t\t{\n\t\t\t$categories = $this->manage_content->getValue('vertical_navbar','menu_name');\n\t\t\treturn $categories;\n\t\t}",
"public function get_categories () {\n\t\treturn Category::all();\n\t}",
"public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }",
"public function getCategories() : array;",
"public function getCategoriesAndParents() {\n\t\t$cats = array();\n\t\tif ($this->categories) {\n\t\t\t$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['camaliga']);\n\t\t\t$catMode = intval($configuration[\"categoryMode\"]);\n\t\t\t$lang = intval($GLOBALS['TSFE']->config['config']['sys_language_uid']);\n\t\t\t// Step 1: select all categories of the current language\n\t\t\t$categoriesUtility = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('\\quizpalme\\Camaliga\\Utility\\AllCategories');\n\t\t\t$all_cats = $categoriesUtility->getCategoriesarrayComplete();\n\t\t\t// Step 2: aktuelle orig_uid herausfinden\n\t\t\t$orig_uid = intval($this->getUid());\t// ist immer die original uid (nicht vom übersetzten Element!)\n\t\t\tif ($lang > 0 && $catMode == 0) {\n\t\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'uid',\n\t\t\t\t\t\t'tx_camaliga_domain_model_content',\n\t\t\t\t\t\t'deleted=0 AND hidden=0 AND sys_language_uid=' . $lang . ' AND t3_origuid=' . $orig_uid);\n\t\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4))\n\t\t\t\t\t\tif ($row['uid']) {\n\t\t\t\t\t\t\t$orig_uid = intval($row['uid']);\t// uid of the translated element\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t\t}\n\t\t\t// Step 3: get the mm-categories of the current element (from the original or translated element)\n\t\t\t$res4 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'uid_local',\n\t\t\t\t'sys_category_record_mm',\n\t\t\t\t\"tablenames='tx_camaliga_domain_model_content' AND uid_foreign=\" . $orig_uid);\n\t\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res4) > 0) {\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res4)){\n\t\t\t\t\t$uid = $row['uid_local'];\n\t\t\t\t\tif (!isset($all_cats[$uid]['parent'])) continue;\n\t\t\t\t\t$parent = (int) $all_cats[$uid]['parent'];\n\t\t\t\t\t//if (!$all_cats[$parent]['title'])\tcontinue;\n\t\t\t\t\tif (!isset($cats[$parent])) {\n\t\t\t\t\t\t$cats[$parent] = array();\n\t\t\t\t\t\t$cats[$parent]['childs'] = array();\n\t\t\t\t\t\t$cats[$parent]['title'] = $all_cats[$parent]['title'];\n\t\t\t\t\t}\n\t\t\t\t\tif ($all_cats[$uid]['title'])\n\t\t\t\t\t\t$cats[$parent]['childs'][$uid] = $all_cats[$uid]['title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res4);\n\t\t}\n\t\treturn $cats;\n\t}",
"static function get_all_available_categories()\n {\n //moduli primari\n $modules_root = new Dir(DS.ModuleUtils::get_modules_path());\n\n $all_folders = $modules_root->listFolders();\n\n $result = array();\n\n foreach ($all_folders as $cat)\n {\n if ($cat->isDir())\n {\n $result[] = $cat->getName();\n }\n }\n\n //aggiungo la categoria framework se non è presente.\n if (!ArrayUtils::has_value($result, ModuleUtils::FRAMEWORK_CATEGORY_NAME))\n $result[] = ModuleUtils::FRAMEWORK_CATEGORY_NAME;\n //ok\n\n return $result;\n }",
"public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}",
"public function getCategoriesList() {\n return $this->_get(16);\n }",
"public function get_categories()\n {\n return ['hsblog'];\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return $this->categories;\n }",
"public function getCategories()\n {\n return [ 'categories' => self::CATEGORIES ];\n }",
"public static function getActiveCategories(){}",
"public static function getCategoriesForDropdown()\n {\n return (array) BackendModel::getContainer()->get('database')->getPairs(\n 'SELECT i.id, i.title\n FROM slideshow_categories AS i\n WHERE i.language = ?\n ORDER BY i.sequence ASC',\n array(BL::getWorkingLanguage())\n );\n }",
"public function get_categories() {\n return [ 'Alita-elements' ];\n }",
"public function get_categories() {\n return [ 'Alita-elements' ];\n }",
"public function get_categories() {\n\t\treturn [ 'basic' ];\n\t}",
"public static function getCategories()\n {\n $app = App::getInstance();\n\n $manager = BaseManager::build('FelixOnline\\Core\\Category', 'category');\n\n try {\n $values = $manager->filter('hidden = 0')\n ->filter('deleted = 0')\n ->filter('id > 0')\n ->order('order', 'ASC')\n ->values();\n\n return $values;\n } catch (\\Exception $e) {\n return array();\n }\n }",
"public static function getAllCategories()\n\t{\n\t\t$categories= Category::all();\n\t\treturn $categories;\n\t}",
"public static function getCategoriesForDropdown()\n\t{\n\t\treturn (array) BackendModel::getDB()->getPairs(\n\t\t\t'SELECT i.id, i.name\n\t\t\t FROM faq_categories AS i\n\t\t\t WHERE i.language = ?\n\t\t\t ORDER BY i.sequence ASC',\n\t\t\tarray(BL::getWorkingLanguage())\n\t\t);\n\t}",
"function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function getCategories() {\n\t\t$db = $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtsms_categories', 'a'));\n\n\t\t$query->where($db->quoteName('a.published').' = 1');\n\n\t\t$query->group($db->quoteName('a.id'));\n\t\t$query->order($db->quoteName('a.name'));\n\n\t\t$db->setQuery($query);\n\n\t\t\n\t\t$categories = array();\n\t\t$categories[0]\t= JText::_('COM_GTSMS_UNCATEGORIZED');\n\n\t\tforeach ($db->loadObjectList('id') as $k => $item) {\n\t\t\t$categories[$k] = $item->name;\n\t\t}\n\n\t\treturn $categories;\n\t}",
"public function getCategories()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('categories');\n }",
"public function allCategories()\n {\n return Category::all();\n }",
"public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}",
"public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}",
"function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }",
"public function getCategories()\n {\n return Category::all();\n }",
"function getCategories() {\n\t\t$answers = $this->getAnswers();\n\t\t$categories = array();\n\t\t\n\t\tforeach((array) $answers as $answer) {\n\t\t\t$question = $answer->getQuestion();\n\t\t\t$category = $question->getCategory();\n\t\t\t$categories[$category->getUID()] = $category;\n\t\t}\n\t\t\n\t\treturn $categories;\n\t}",
"function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}",
"public static function getCategories(){\n $categories = Category::all()->toArray();\n\n return $categories;\n }",
"public function getCategories() {\n return $this->categories;\n }",
"public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }",
"public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }",
"public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getCategories(){\n return Category::get();\n }",
"public function getCategories()\n\t{\n\t\treturn $this->categories;\n\t}",
"function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}",
"public function get_categories() {\n global $DB;\n $categories = array();\n $results = $DB->get_records('course_categories', array('parent' => '0', 'visible' => '1', 'depth' => '1'));\n if (!empty($results)) {\n foreach ($results as $value) {\n $categories[$value->id] = $value->name;\n }\n }\n return $categories;\n }",
"public function get_categories()\n\t{\n\t\treturn $this->_categories;\n\t}",
"public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}",
"function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }",
"public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }",
"public function get_categories() {\n return array( 'apr-core' );\n }",
"public static function getAllCategories() {\n\t\t\t$db = Db::getInstance();\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description\n\t\t\t\t\t\t\t\t\t\t\t FROM categories\n\t\t\t\t\t\t\t\t\t\t ORDER BY location\n\t\t\t\t\t\t\t\t\t\t');\n\t\t\t\t$categoryQuery->execute();\n\t\t\t$allCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allCategories;\n\t\t}",
"public function getWikiCategories() {\n\t\t$categories = [];\n\t\tforeach ( $this->gpml->Comment as $comment ) {\n\t\t\tif ( $comment['Source'] == COMMENT_WP_CATEGORY ) {\n\t\t\t\t$cat = trim( (string)$comment );\n\t\t\t\tif ( $cat ) {\n\t\t\t\t\t// Ignore empty category comments\n\t\t\t\t\tarray_push( $categories, $cat );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $categories;\n\t}",
"static function categories()\n {\n $category = \\SOE\\DB\\Category::where('parent_id', '0')\n ->orderBy('category_order')\n ->get();\n $return = array();\n foreach($categories as $cat)\n {\n $return[$cat->id] = $cat->slug;\n }\n return $return;\n }",
"public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }",
"public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}",
"public function getCategories(){\n\t\n\t\tglobal $wpdb;\n\t\t\n\t\t$allcategories = array();\n\t\t \n\t\t// geta all categories\t\t\n\t\t$categories = $wpdb->get_results('SELECT * FROM '.$this->categories_table.'');\n\t\t\n\t foreach($categories as $cat)\n\t\t{ \n\t\t $allcategories[$cat->term_id][] = $cat->name;\n\t\t\t$allcategories[$cat->term_id][] = $cat->name_de;\n\t\t\t$allcategories[$cat->term_id][] = $cat->name_it;\t\n\t\t}\n\t\t\n\t\treturn $allcategories;\n\t\t\t\n\t}",
"public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}",
"public function getParentCategories()\n {\n return [\n 1 => [\n 'ru' => 'Готовые наборы для аэрографии',\n 'uk' => 'Готові набори для аерографії',\n 'en' => 'Ready-made airbrush kits',\n ],\n 2 => [\n 'ru' => 'Дополнительное оборудование и аксессуары для аэрографии',\n 'uk' => 'Додаткове обладнання та аксесуари для аерографії',\n 'en' => 'Additional equipment and accessories for airbrushing'\n ],\n 3 => [\n 'ru' => 'Аэрографы и компрессоры Fengda',\n 'uk' => 'Аерографи і компресори Fengda',\n 'en' => 'Fengda Airbrushes and Compressors',\n ],\n 4 => [\n 'ru' => 'Товары для аэрографии на ногтях (nail art)',\n 'uk' => 'Товари для аерографії на нігтях (nail art)',\n 'en' => 'Goods for airbrushing on nails (nail art)',\n ],\n 6 => [\n 'ru' => 'Товары для аэрографии визажистов, гримеров и др.',\n 'uk' => 'Товари для аерографії візажистів, гримерів і ін.',\n 'en' => 'Goods for aerography of make-up artists, make-up artists, etc.',\n ],\n 5 => [\n 'ru' => 'Товары для аэрографии на кондитерских изделиях',\n 'uk' => 'Товари для аерографії на кондитерських виробах',\n 'en' => 'Goods for airbrushing confectionery products',\n ],\n 7 => [\n 'ru' => 'Краски для аэрографии Createx и Wicked Colors',\n 'uk' => 'Фарби для аерографії Createx і Wicked Colors',\n 'en' => 'Paints for airbrushing Createx and Wicked Colors',\n 'not_active' => true\n ],\n 8 => [\n 'ru' => 'Краски для аэрографии Auto Air Colors',\n 'uk' => 'Фарби для аерографії Auto Air Colors',\n 'en' => 'Paints for airbrushing Auto Air Colors',\n 'not_active' => true\n ],\n 9 => [\n 'ru' => 'Аэрографы и запчасти H&S/Hansa',\n 'uk' => 'Аерографи і запчастини H&S/Hansa',\n 'en' => 'Airbrushes and spare parts H&S/Hansa',\n ]\n ];\n }",
"public function get_categories()\n {\n return ['super-cat'];\n }",
"function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}",
"public function get_categories()\n {\n return ['basic'];\n }",
"public function get_categories()\n {\n $param = array(\n 'delete_flg' => $this->config->item('not_deleted','common_config')\n );\n $groups = $this->get_tag_group();\n\n if (empty($groups)) return array();\n\n $group_id = array_column($groups, 'tag_group_id');\n $param = array_merge($param, array('group_id' => $group_id));\n\n $tags = $this->Logic_tag->get_list($param);\n\n return $this->_generate_categories_param($groups, $tags);\n }",
"public static function getCategories()\n {\n \t$query = \"SELECT * FROM categories\";\n \t$result = DB::select($query);\n\n \treturn $result;\n }",
"public function categories() : array\n {\n return $this->categories;\n }",
"public function getCategory();",
"public function getCategory();",
"public static function getAllCategories()\n {\n $return = (array) FrontendModel::get('database')->getRecords(\n 'SELECT c.id, c.title AS label, COUNT(c.id) AS total\n FROM menu_categories AS c\n INNER JOIN menu_alacarte AS i ON c.id = i.category_id AND c.language = i.language\n GROUP BY c.id\n ORDER BY c.sequence ASC',\n array(), 'id'\n );\n\n // loop items and unserialize\n foreach ($return as &$row) {\n if (isset($row['meta_data'])) {\n $row['meta_data'] = @unserialize($row['meta_data']);\n }\n }\n\n return $return;\n }",
"public function categories(): array\n {\n return $this->categories;\n }",
"public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}",
"function getCategories() {\n\t\treturn $this->enumerateBySymbolic(CATEGORY_SYMBOLIC, 0, 0);\n\t}",
"public function getAllCategoryNames();",
"public function categories($assignableOnly = true, $language = '') {\n\n $cacheKey = 'gdata_you_tube_categories';\n\n if ($assignableOnly) {\n $cacheKey .= '_assignable';\n }\n\n $categories = Cache::read($cacheKey);\n\n if ($categories != false) {\n return $categories;\n }\n \n $categories = array();\n\n // Load the categories into an XML doc\n $xml = new SimpleXMLElement(self::YOU_TUBE_CATEGORY_DOCUMENT_URI, null, true);\n\n $xpath = '/app:categories/atom:category';\n\n // Only fetch assignable categories\n if ($assignableOnly) {\n $xpath .= '/yt:assignable/..';\n }\n\n $categoryObjects = $xml->xpath($xpath);\n\n foreach ($categoryObjects as $categoryObject) {\n $categories[(string)$categoryObject['term']] = (string)$categoryObject['label'];\n }\n\n Cache::write($cacheKey, $categories);\n\n return $categories;\n \n }",
"function getCategories()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('alias') . ',' .\n\t\t\t$this->db->nameQuote('id') . ',' .\n\t\t\t$this->db->nameQuote('name') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') .\n\t\t\t' WHERE ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' AND ' . $this->db->nameQuote('id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('trash') . ' = ' . $this->db->quote('0') .\n\t\t\t' ORDER BY ' . $this->db->nameQuote('ordering') . ' ASC';\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObjectList();\n\t}",
"function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getCategory() {}",
"public function get_categories() {\n return [ 'yx-super-cat' ];\n }",
"public function getLanguages();"
] | [
"0.76523465",
"0.7600018",
"0.7600018",
"0.7546649",
"0.75337875",
"0.75304896",
"0.75304896",
"0.75304896",
"0.75152665",
"0.7503382",
"0.74649966",
"0.7422397",
"0.7393241",
"0.7376749",
"0.7356804",
"0.73505765",
"0.73505765",
"0.7322605",
"0.7317796",
"0.7301508",
"0.72994345",
"0.7241998",
"0.7186761",
"0.71739656",
"0.7157305",
"0.7123296",
"0.7102172",
"0.7095777",
"0.709374",
"0.7076658",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.7055916",
"0.70444584",
"0.7043681",
"0.7042378",
"0.70319617",
"0.70319617",
"0.7019287",
"0.7018413",
"0.70156175",
"0.70133156",
"0.70128125",
"0.70059246",
"0.7004196",
"0.7000457",
"0.6989301",
"0.6989301",
"0.6988849",
"0.69856083",
"0.6981286",
"0.69805497",
"0.69769555",
"0.69748205",
"0.6974397",
"0.6968032",
"0.6966903",
"0.69661975",
"0.69633615",
"0.6952583",
"0.69479674",
"0.6947423",
"0.69379187",
"0.6932",
"0.69203746",
"0.69065756",
"0.6905254",
"0.6897602",
"0.6891755",
"0.6882887",
"0.687054",
"0.6868778",
"0.6862447",
"0.6859226",
"0.68585694",
"0.68546253",
"0.6845205",
"0.6843163",
"0.68341625",
"0.6832842",
"0.6829638",
"0.68243796",
"0.68243796",
"0.68148607",
"0.68115264",
"0.6809216",
"0.6801434",
"0.6799577",
"0.6797573",
"0.6759604",
"0.6752914",
"0.6747675",
"0.6744164",
"0.6733704"
] | 0.0 | -1 |
Get first category group | public function get_first_group()
{
return ee()->db->select('MIN(group_id) AS group_id')
->get('category_groups')
->row('group_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getFirstCategory() {\r\n\t\treturn $this->newsItem->getFirstCategory()->getTitle();\r\n\t}",
"private function _getFirstCategoryLevel()\n\t{\n\t\tif (!$this->_firstCategoryLevel) {\n\t\t\t$this->_firstCategoryLevel = intval($this->getVar('category_first_level', 1));\n\t\t}\n\t\treturn $this->_firstCategoryLevel;\n\t}",
"function get_first_category_ID() {\n\t$category = get_the_category(); \n\t$category_parent_id = $category[0]->category_parent;\n\t\n\tif ( $category_parent_id != 0 ) {\n\t\t$category_parent = get_term( $category_parent_id, 'category' );\n\t\t$css_slug = $category_parent->slug;\n\t} else {\n\t\t$css_slug = $category[0]->slug;\n\t}\n\n\treturn $css_slug;\n}",
"function get_first_category_link($post_id) {\n $category = get_the_category($post_id);\n if ($category[0]) {\n return get_category_link($category[0]->term_id);\n }\n}",
"public function getCategory1()\n {\n if (array_key_exists(\"category1\", $this->_propDict)) {\n return $this->_propDict[\"category1\"];\n } else {\n return null;\n }\n }",
"function get_category_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_category_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_category_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"function get_first_category_name($post_id) {\n $category = get_the_category($post_id);\n if ($category[0]) {\n return $category[0]->cat_name;\n }\n}",
"public function get_cat_one()\n {\n $select = $this->db->get('category_one');\n $cat_one = $select->result();\n return $cat_one;\n }",
"function get_first_row(){\n global $db;\n $query = \n ' SELECT cat_categoryID\n FROM categories\n LIMIT 1';\n $statement = $db->prepare($query);\n $statement->execute();\n $categories = $statement->fetchAll();\n $statement->closeCursor();\n foreach($categories as $category){ \n return $category['cat_categoryID'];\n }\n}",
"public function getGroup() {\n \tif(count($this->groups))\n \t return $this->groups[0]->getName();\n \telse\n \t return null;\n }",
"function getGroup() {\n \n return null;\n \n }",
"public function getDefaultGroup()\n {\n return $this->defaultGroup;\n }",
"function achieve_get_main_category()\r\n{\r\n global $sql;\r\n\r\n $main_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, Name FROM achievement_category WHERE ParentID=-1 and ID<>1 ORDER BY `GroupID` ASC\");\r\n while ($main_cat[] = $sql[\"dbc\"]->fetch_assoc($result));\r\n return $main_cat;\r\n}",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"public function getDefaultGroup(): string;",
"private function isFirstLevel($category)\n {\n return $category->getData('level') == 2 ? true : false;\n }",
"private function getSingleGroup()\n {\n if (!$this->result) {\n throw new \\Exception('This adapter must have a result set on it before being accessed');\n }\n $grouping = $this->result->getGrouping();\n $groups = reset($grouping);\n $group = reset($groups);\n\n return $group;\n }",
"public function getDefaultPricingGroup()\n {\n if ($this->pricingGroups[0]->isDefault()) return $this->pricingGroups[0]; // normally because of self::setPricingGroupsBubbleDefaultToTop\n\n foreach ($this->pricingGroups as $pricingGroup) {\n if ($pricingGroup->isDefault()) return $pricingGroup;\n }\n\n return null;\n }",
"public function get_default_category() {\n return $this->defaultcategory;\n }",
"public function getPostFirstCategory($post)\r\n {\r\n /** @var \\Mageplaza\\Blog\\Model\\ResourceModel\\Category\\Collection $collection */\r\n $collection = $this->getCategoryCollection($post->getCategoryIds());\r\n\r\n return $collection->getFirstItem();\r\n }",
"function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }",
"public function getGroupObject() {\n return $this->groups[0];\n }",
"public function get_category()\n {\n return $this->primary_category();\n }",
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"public function getGroup();",
"public function getGroup();",
"public function getGroup();",
"function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}",
"public function getFirstPage($group = 'default') {\n $this->ensureGroup($group);\n\n // @todo determine based on a 'surroundCount' value\n return 1;\n }",
"private function retrieve_primary_category() {\n\t\t$primary_category = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$wpseo_primary_category = new WPSEO_Primary_Term( 'category', $this->args->ID );\n\n\t\t\t$term_id = $wpseo_primary_category->get_primary_term();\n\t\t\t$term = get_term( $term_id );\n\n\t\t\tif ( ! is_wp_error( $term ) && ! empty( $term ) ) {\n\t\t\t\t$primary_category = $term->name;\n\t\t\t}\n\t\t}\n\n\t\treturn $primary_category;\n\t}",
"function getGroup() ;",
"public function getCategoriesGroup() {\n\t\t$imageTypes = $this->getImagesTypes();\n\t\t$categories = $this->getCollection()\n\t\t\t\t->addFieldToFilter('status',1);\n\t\t$arrayOptions = array();\n\t\t$i = 1;\n\t\tforeach($imageTypes as $key => $imageType)\n\t\t{\n\t\t\tif($key == 'uncategorized')\n\t\t\t{\n\t\t\t\t$arrayOptions[0] = 'Uncategorized';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$arrayValue = array();\n\t\t\tforeach($categories as $category)\n\t\t\t{\n\t\t\t\tif($category->getImageTypes() == $key)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$arrayValue[] = array('value'=>$category->getId(),'label'=>$category->getTitle());\n\t\t\t\t}\n\t\t\t}\n\t\t\t$arrayOptions[$i]['value'] = $arrayValue;\n\t\t\t$arrayOptions[$i]['label'] = $imageType;\n\t\t\t$i++;\n\t\t}\n\t\treturn $arrayOptions;\n\t}",
"public function group()\n {\n return null;\n }",
"public function getGroup() {}",
"public function getGroup() {}",
"public function getGroup() {}",
"public function getGroup() {}",
"public function primaryGroup() : ?Model\n {\n if ($this->userPrimaryGroup !== null) {\n return $this->userPrimaryGroup;\n }\n\n $usergroups = $this->usergroups;\n\n foreach ($usergroups as $id => $usergroup) {\n if ($usergroup->primary) {\n return $this->userPrimaryGroup = $usergroup->group;\n }\n }\n\n return $this->userPrimaryGroup = $usergroups[0]->group;\n }",
"public function getIdCategoryDefault(){\n\n /*TODO refactor*/ \n $idDefault = '3';\n\n $rootCategoryId = Mage::app()->getStore(\"default\")->getRootCategoryId() ;\n\n if(isset($rootCategoryId) && $rootCategoryId > 0)\n $idDefault = $rootCategoryId + 1 ;\n\n return $idDefault ;\n }",
"public function getGroup()\n {\n //Note: group parts are not \"named\" so it's all or nothing\n return $this->_get('_group');\n }",
"public function getDefaultCategory(): string|null;",
"public function getCategory() {}",
"function SqlFirstGroupField() {\n\t\treturn \"\";\n\t}",
"function SqlFirstGroupField() {\n\t\treturn \"\";\n\t}",
"public function getCurrentCat()\n {\n if (empty($this->multifilterSession->getTopCategory()) && empty($this->multifilterSession->getCategories())) {\n $currentCat = $this->coreRegistry->registry('current_category');\n return $currentCat->getId();\n } else {\n return $this->multifilterSession->getTopCategory();\n }\n }",
"function pixelgrade_get_main_category( $post_ID = null ) {\n\n\t// Use the current post ID is none given\n\tif ( empty( $post_ID ) ) {\n\t\t$post_ID = get_the_ID();\n\t}\n\n\t// Obviously pages don't have categories\n\tif ( 'page' == get_post_type( $post_ID ) ) {\n\t\treturn false;\n\t}\n\n\t$categories = get_the_category();\n\n\tif ( empty( $categories ) ) {\n\t\treturn false;\n\t}\n\n\t// We need to sort the categories like this: first categories with no parent, and secondly ordered DESC by post count\n\t// Thus parent categories take precedence and categories with more posts take precedence\n\tusort( $categories, '_pixelgrade_special_category_order' );\n\n\t// The first category should be the one we are after\n\t// We allow others to filter this (Yoast primary category maybe?)\n\treturn apply_filters( 'pixelgrade_get_main_category', $categories[0], $post_ID );\n}",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }",
"private function groupByCategory(){\n \n $searchResults = null;\n $items = $this->items; \n \n foreach($items as $item){\n foreach($item->categories as $category_tmp){ \n $searchResults[$category_tmp][] = $item;\n } \n }\n \n return $searchResults;\n }",
"function random_category($category)\n {\n return \\Infoexam\\Eloquent\\Models\\Category::getCategories($category)->random()->getKey();\n }",
"function thecategory() {\n global $categories_index, $category, $categories;\n $category = $categories[$categories_index - 1];\n return $category;\n}",
"public function get_category(){\n\t\treturn $this->category;\n\t}",
"function get_categories_by_group()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('group_id'));\n\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_group_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_category_by_group($vars['group_id'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_group_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public function getCategory(){\r\n return Mage::registry('current_category');\r\n }",
"function get_primary_category($id = 0) {\n\t\n\t$category = get_the_terms($id, 'category');\t\t\n\t$parent_cat = \"\";\n\t\n\tforeach((array) $category as $term) {\n\t\tif($term->slug == \"featured\" || $term->slug == \"spotlight-featured\" || $term->slug == \"spotlight-left\" || $term->slug == \"spotlight-right\") { continue; }\n\t\t\n\t\t// if the first term is parent, return it\n\t\tif($term->parent == 0) {\n\t\t\t$parent_cat = $term;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t// if the category isn't the parent, find the parent\n\t\t\t$parent_cat = get_parent_of_category($term->term_id); \n\t\t}\n\t}\n\t\t\n\treturn $parent_cat;\t\t\n}",
"public function getCategory();",
"public function getCategory();",
"function get_first_term( $post_id = 0, $key = '' ) {\n\n\t// First check for terms.\n\t$terms = get_the_terms( $post_id, 'category' );\n\n\t// If we have no terms for the post, use the default.\n\tif ( empty( $terms ) || is_wp_error( $terms ) ) {\n\n\t\t// Get the default category.\n\t\t$defcat = get_option( 'default_category', '1' );\n\n\t\t// Set the term data.\n\t\t$deftrm = get_term( $defcat, 'category', ARRAY_A );\n\n\t\t// Return the entire thing if we didn't include a key\n\t\tif ( empty( $key ) ) {\n\t\t\treturn $deftrm;\n\t\t}\n\n\t\t// Return a single portion of the data.\n\t\treturn isset( $deftrm[ $key ] ) ? $deftrm[ $key ] : false;\n\t}\n\n\t// Reset array so we can pull easily.\n\t$terms = array_values( $terms );\n\n\t// Pull out the first one.\n\t$term = (array) $terms[0];\n\n\t// Bail without a term.\n\tif ( empty( $term ) ) {\n\t\treturn false;\n\t}\n\n\t// Return the entire thing if we didn't include a key\n\tif ( empty( $key ) ) {\n\t\treturn $term;\n\t}\n\n\t// Return a single portion of the data.\n\treturn isset( $term[ $key ] ) ? $term[ $key ] : false;\n}",
"public function getProductCollectionFromCategoryLeft() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $not_in_array = array_merge($not_in_array_left, $not_in_array_parent);\n\t $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(10)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \t}",
"private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }",
"protected function getCategoryPreAgg()\n {\n // Get our category aggregations\n $nestedAggBefore = new NestedAggregation(\n 'categories_before',\n 'departments'\n );\n\n $childAgg = new \\Elastica\\Aggregation\\Terms('categories_before_inner');\n $childAgg->setField('departments.id');\n\n $nestedAggBefore->addAggregation($childAgg);\n\n return $nestedAggBefore;\n }",
"public abstract function getGroup();",
"public function currentGroup();",
"function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}",
"public function get_real_primarygroup()\n {\n return $this->_real_primarygroup;\n }",
"public function getFirst();",
"function matchFirstCategory( $menuname, $categories ) {\n # First load and parse the template page \n $content = loadTemplate( $menuname );\n \n # Navigation list\n $breadcrumb = '';\n preg_match_all( \"`<li>\\s*?(.*?)\\s*</li>`\", $content, $matches, PREG_PATTERN_ORDER );\n \n # Look for the first matching category or a default string\n foreach ( $matches[1] as $nav ) {\n $pos = strpos( $nav, DELIM ); // End of category\n if ( $pos !== false ) {\n $cat = trim( substr($nav, 0, $pos) );\n $crumb = trim( substr($nav, $pos + 1) );\n // Is there a match for any of our page's categories? \n if ( $cat == 'default' ) {\n $breadcrumb = $crumb;\n }\n else if ( in_array( $cat, $categories ) ) {\n $breadcrumb = $crumb;\n break;\n }\n }\n }\n \n return normalizeParameters( $breadcrumb, DELIM, 3 );\n}",
"public function getCategory() {\n return $this->category;\n }",
"public function get_group_category( $group_category = '', $list_id = '' ) {\n $groups = $this->get_group_categories( $list_id );\n if ( empty( $groups ) || empty( $group_category ) ) {\n return false;\n }\n foreach ( $groups as $group ) {\n if ( $group_category == $group->id || $group_category == $group->title ) {\n return $group;\n }\n }\n return false;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getFirstItem();",
"public function getCategory()\n {\n if (!$this->_category) {\n $this->_category = Mage::registry('current_category');\n }\n return $this->_category;\n }",
"function my_separate_category() {\n return 1;\n }",
"function fetchDefaultPrimaryGroup(){\n try {\n global $db_table_prefix;\n\n $db = pdoConnect();\n\n $query = \"SELECT\n id,\n name,\n is_default,\n can_delete,\n home_page_id\n FROM \".$db_table_prefix.\"groups\n WHERE\n is_default = '2'\n LIMIT 1\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute()){\n // Error\n return false;\n }\n\n if (!($results = $stmt->fetch(PDO::FETCH_ASSOC)))\n return false;\n\n $stmt = null;\n\n return $results;\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}",
"function tkno_get_top_category_slug( $return_slug=false, $cat_id=false ) {\n global $post;\n $curr_cat = ( $cat_id ) ? get_category_parents( $cat_id, false, '/', true ) : get_the_category_list( '/' , 'multiple', $post->ID );\n $valid_cats = ( is_outdoors() ) ? array( 'spring', 'summer', 'fall', 'winter', 'trips', 'outdoors' ) : array( 'music', 'food', 'drink', 'things-to-do', 'arts' );\n $curr_cat = explode( '/', $curr_cat );\n $return_cat = array();\n foreach ( $curr_cat as $current ) {\n $current = sanitize_title( strtolower( $current ) );\n if ( in_array( $current, $valid_cats ) ) {\n $return_cat['slug'] = $current;\n if ( $return_slug ) { \n return $current;\n }\n break;\n }\n }\n if ( ! empty( $return_cat['slug'] ) ) { \n $cat_for_name = get_category_by_slug( $return_cat['slug'] );\n $return_cat['cat_name'] = $cat_for_name->name;\n $return_cat['term_id'] = $cat_for_name->term_id;\n return (object) $return_cat;\n } else {\n return false;\n }\n}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->_category;\n }",
"public function first() {\n return $this->nth( 0 );\n }",
"function first()\n\t{\n\t\treturn array_values($this->_data)[0];\n\t}",
"final public function getFirst() {\n\t\treturn null;\n\t}",
"public function getCategory() {\n return $this->category;\n }",
"public function getFirst()\n {\n return $this->first;\n }",
"public function getFirst()\n {\n return $this->first;\n }",
"function getCategory() \n {\n return $this->instance->getCategory();\n }",
"public function getGroup ()\n {\n return $this->getObject();\n }"
] | [
"0.6992908",
"0.65998644",
"0.6392275",
"0.6311134",
"0.62993157",
"0.6292467",
"0.6182475",
"0.6125688",
"0.60287684",
"0.60007143",
"0.5900196",
"0.58980006",
"0.5866777",
"0.5863748",
"0.5858644",
"0.58394516",
"0.58335835",
"0.58314127",
"0.58232695",
"0.57744443",
"0.5766075",
"0.5764646",
"0.57635784",
"0.5685904",
"0.5682851",
"0.5682851",
"0.5682851",
"0.5668625",
"0.5626301",
"0.56163114",
"0.5614944",
"0.5593879",
"0.55703205",
"0.5567726",
"0.5567726",
"0.5567726",
"0.5567726",
"0.5564197",
"0.55523777",
"0.5551553",
"0.5548898",
"0.5539933",
"0.5522419",
"0.5522419",
"0.5510728",
"0.55068374",
"0.55065775",
"0.54733",
"0.54665464",
"0.54558194",
"0.54552543",
"0.5452109",
"0.54510784",
"0.54477125",
"0.5439789",
"0.5439789",
"0.54345554",
"0.54324424",
"0.54273605",
"0.5406995",
"0.5406408",
"0.5406351",
"0.5387499",
"0.53857327",
"0.5383601",
"0.53811496",
"0.53805506",
"0.5375874",
"0.5375544",
"0.5375544",
"0.5361729",
"0.5360113",
"0.53582937",
"0.53490543",
"0.5348873",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.53440315",
"0.5340746",
"0.53330904",
"0.5324247",
"0.5316942",
"0.53141737",
"0.5313653",
"0.5313653",
"0.5310677",
"0.5304766"
] | 0.8117068 | 0 |
Grab all the custom fields for a category | public function get_custom_fields($group_id = FALSE)
{
// Default fields
$fields = array(
// Return the Image field first so we can float it in the view.
'cat_image' => (object) array(
'field_name' => 'cat_image',
'field_label' => 'Image'
),
'cat_name' => (object) array(
'field_name' => 'cat_name',
'field_label' => 'Name'
),
'cat_description' => (object) array(
'field_name' => 'cat_description',
'field_label' => 'Description'
),
'cat_url_title' => (object) array(
'field_name' => 'cat_url_title',
'field_label' => 'URL Title'
),
);
// Grab the columns from the table
$columns = $this->get_table_columns($this->data_table);
// Grab the custom field data
$field_data = array();
if ($group_id)
{
ee()->db->where('group_id', $group_id);
}
$qry = ee()->db->get('category_fields');
foreach ($qry->result() as $row)
{
$field_data[$row->field_id] = $row;
}
foreach ($columns as $column_name)
{
if (substr($column_name, 0, 9) == 'field_id_')
{
$id = preg_replace('/field_id_(\d+)/', "$1", $column_name);
if (array_key_exists($id, $field_data))
{
$fields[$column_name] = $field_data[$id];
}
}
}
return $fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllCustomFields()\n\t{\n\t\t$fields = $this->CustomFields->indexBy('field_name');\n\n\t\t$cache_key = \"ChannelFieldGroups/{$this->getId()}/\";\n\t\tif (($field_groups = ee()->session->cache(__CLASS__, $cache_key, FALSE)) == FALSE)\n\t\t{\n\t\t\t$field_groups = $this->FieldGroups;\n\t\t}\n\n\t\tforeach ($field_groups as $field_group)\n\t\t{\n\t\t\tforeach($field_group->ChannelFields as $field)\n\t\t\t{\n\t\t\t\t$fields[$field->field_name] = $field;\n\t\t\t}\n\t\t}\n\n\t\tee()->session->set_cache(__CLASS__, $cache_key, $field_groups);\n\n\t\treturn new Collection($fields);\n\t}",
"public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.dealcategory.fields'\n );\n return $fullResult;\n }",
"public function getCustomFields()\n\t{\n\t\t$all_customs = array();\n\t\t$results = $this->grApiInstance->getCustomFields();\n\t\tif ( !empty($results))\n\t\t{\n\t\t\tforeach ($results as $ac)\n\t\t\t{\n\t\t\t\tif (isset($ac->name) && isset($ac->customFieldId)) {\n\t\t\t\t\t$all_customs[$ac->name] = $ac->customFieldId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $all_customs;\n\t}",
"function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}",
"public function get_fields() {\n\t\treturn apply_filters( 'wpcd_get_custom_fields', $this->custom_fields );\n\t}",
"public function custom_fields_for_feed_setting() {\n\t\t\n\t\t$fields = array();\n\t\t\n\t\t/* If iContact API credentials are invalid, return the fields array. */\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\n\t\t/* Get available iContact fields. */\n\t\t$icontact_fields = $this->api->get_custom_fields();\n\t\t\n\t\t/* If no iContact fields exist, return the fields array. */\n\t\tif ( empty( $icontact_fields ) || is_wp_error( $icontact_fields ) || ! is_array( $icontact_fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\t\n\t\t/* Add iContact fields to the fields array. */\n\t\tforeach ( $icontact_fields as $field ) {\n\t\t\t\n\t\t\t$fields[] = array(\n\t\t\t\t'label' => $field['publicName'],\n\t\t\t\t'value' => $field['customFieldId']\n\t\t\t);\n\t\t\t\n\t\t}\n\n\t\t/* Add new custom fields to the fields array. */\n\t\tif ( ! empty( $this->_new_custom_fields ) ) {\n\t\t\t\n\t\t\tforeach ( $this->_new_custom_fields as $new_field ) {\n\t\t\t\t\n\t\t\t\t$found_custom_field = false;\n\t\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t\t\n\t\t\t\t\tif ( $field['value'] == $new_field['value'] )\n\t\t\t\t\t\t$found_custom_field = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( ! $found_custom_field )\n\t\t\t\t\t$fields[] = array(\n\t\t\t\t\t\t'label' => $new_field['label'],\n\t\t\t\t\t\t'value' => $new_field['value']\t\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif ( empty( $fields ) ) {\n\t\t\treturn $fields;\n\t\t}\n\t\t\t\t\t\t\n\t\t/* Add \"Add Custom Field\" to array. */\n\t\t$fields[] = array(\n\t\t\t'label' => esc_html__( 'Add Custom Field', 'gravityformsicontact' ),\n\t\t\t'value' => 'gf_custom'\t\n\t\t);\n\t\t\n\t\treturn $fields;\n\t\t\n\t}",
"public function getFormCustomFields(){\n\t}",
"public function getCustomFields() {\n }",
"public function getCustomFields() {\n }",
"public function getCustomFields()\n {\n return $this->customFields;\n }",
"public function getCustomFields()\n {\n return $this->customFields;\n }",
"public function getAllCustomFields() : array\n {\n return $this->getAll();\n }",
"public function get_custom_fields() {\n\t\treturn apply_filters( 'dev_get_custom_fields', $this->options );\n\t}",
"private static function _get_custom_fields($content_type)\n\t{\n\t\t$data = get_option( CCTM::db_key );\n\t\tif (isset($data[$content_type]['custom_fields']))\n\t\t{\n\t\t\treturn $data[$content_type]['custom_fields'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t}",
"public function getCustomFields() {\n return Doctrine::getTable('ArticleCustomFieldValue')->getCustomFields($this);\n }",
"private function addCustomFields() {\n if (function_exists('get_fields')) {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'fields', [\n 'get_callback' => function ($post) {\n if (is_object($post)) {\n return get_fields($post->id);\n } elseif (is_array($post) && array_key_exists('id', $post)) {\n return get_fields($post['id']);\n }\n },\n ]);\n }\n }\n }",
"public function getCategoryFormElements($category) {\n //TYPE\n //DEFAULT ELEMENTS\n //Category ELEMENTS\n \n }",
"public static function custom_fields()\r\n {/*{{{*/\r\n $f = array();\r\n\t $file = self::custom_fields_file();\r\n\t if(!file_exists($file)) \r\n return false;\r\n\r\n\t $data = getXML($file);\r\n\t $items = $data->item;\r\n\t if(count($items) <= 0) \r\n\t return false;\r\n\t foreach($items as $item) \r\n\t {\r\n\t\t $cf = array();\r\n\t\t $cf['key'] = (string)$item->desc;\r\n\t\t $cf['label'] = (string)$item->label;\r\n\t\t $cf['type'] = (string)$item->type;\r\n\t\t $cf['value'] = (string)$item->value;\r\n\t\t if($cf['type'] == 'dropdown') \r\n\t\t {\r\n\t\t $cf['options'] = array();\r\n\t\t\t foreach ($item->option as $option) \r\n\t\t\t\t $cf['options'][] = (string)$option;\r\n\t\t }\r\n\t\t $f[] = $cf;\r\n\t }\r\n return $f;\r\n }",
"public function getCustomFields($page=null, $per_page=null){\n\t\treturn CustomField::all($page, $per_page);\n\t\t\n }",
"public function saveCustomFields($fields, $category) {\n // usuwanie dotychczasowych powiazan\n if($this->getPrimaryKey()) {\n $q = Doctrine_Query::create()\n ->delete('ArticleCustomFieldValue acfv')\n ->where('acfv.article_id = ?', $this->getPrimaryKey());\n\n $q->execute();\n }\n\n // pobranie dozwolonych pol na podstawie kategorii\n $q = Doctrine::getTable('ArticleCustomFields2ArtCategories')\n ->createQuery('cf2ac')\n ->leftJoin('cf2ac.ArticleCustomField acf')\n// ->where('artcategory_id = ?', $category);\n ->andWhereIn('artcategory_id', array_keys(Doctrine::getTable('ArtCategories')->find($category)->getAncestorsArrayByIds(true)));\n\n $validFields = $q->execute();\n\n foreach($validFields as $validField) {\n\n foreach($fields as $field => $value) {\n\n if($field == $validField->ArticleCustomField->getName()) {\n $this->setCustomField($field, $value);\n }\n }\n }\n }",
"public function getCustomFields()\n {\n return $this->_customFields ?: array();\n }",
"function getForumCategoryFields() {\n return array(\n 'nom',\n 'image',\n 'niveau',\n 'ordre'\n );\n}",
"function details_field_collection()\r\n{\r\n\tglobal $wpdb,$post,$htmlvar_name;\r\n\tremove_all_actions('posts_where');\r\n\tremove_all_actions('posts_orderby');\r\n\t$cus_post_type = get_post_type();\r\n\t$args = \r\n\tarray( 'post_type' => 'custom_fields',\r\n\t'posts_per_page' => -1\t,\r\n\t'post_status' => array('publish'),\r\n\t'meta_query' => array(\r\n\t 'relation' => 'AND',\r\n\t\tarray(\r\n\t\t\t'key' => 'post_type_'.$cus_post_type.'',\r\n\t\t\t'value' => $cus_post_type,\r\n\t\t\t'compare' => '=',\r\n\t\t\t'type'=> 'text'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_page',\r\n\t\t\t'value' => array('user_side','both_side'),\r\n\t\t\t'compare' => 'IN'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'is_active',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_detail',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t)\r\n\t),\r\n\t\t'meta_key' => 'sort_order',\r\n\t\t'orderby' => 'meta_value_num',\r\n\t\t'meta_value_num'=>'sort_order',\r\n\t\t'order' => 'ASC'\r\n\t);\r\n\t$post_meta_info = null;\r\n\tadd_filter('posts_join', 'custom_field_posts_where_filter');\r\n\t$post_meta_info = new WP_Query($args);\r\n\tremove_filter('posts_join', 'custom_field_posts_where_filter');\r\n\treturn $post_meta_info;\r\n}",
"public function getCMSFields() {\n\t\t$shopConfig = ShopConfig::current_shop_config();\n\t\t$fields = parent::getCMSFields();\n\n\t\t$categories = ProductCategory::getAllCategories();\n\t\tif($categories){\n\t\t\t// Product fields\n\t\t\t$fields->addFieldsToTab('Root.Main', array(\n\t\t\t\tTextField::create('SKU', 'SKU Code'),\n\t\t\t\tPriceField::create('Price', 'Standard Price'),\n\t\t\t\tPriceField::create('SpecialPrice', 'Special Price')->setRightTitle('If price set to 0.00 the product will not be on special')\n\t\t\t), 'Content');\n\n\t\t\t// Replace URL Segment field\n\t\t\t/*\n\t\t\t$urlsegment = SiteTreeURLSegmentField::create(\"URLSegment\", 'URLSegment');\n\t\t\t$baseLink = Controller::join_links(Director::absoluteURL(), 'product/');\n\t\t\t$url = (strlen($baseLink) > 36) ? \"...\" . substr($baseLink, -32) : $baseLink;\n\t\t\t$urlsegment->setURLPrefix($url);\n\t\t\t$fields->replaceField('URLSegment', $urlsegment);\n\t\t\t*/\n\n\t\t\t// Categories Fields\n\t\t\tarsort($categories);\n\t\t\t$fields->addFieldsToTab(\n\t\t\t\t'Root.Main',\n\t\t\t\tarray(\n\t\t\t\t\tDropDownField::create('MainCategoryID', 'Select main category', $categories)->setEmptyString('Select a category'),\n\t\t\t\t\tListboxField::create('ProductCategories', 'Categories')->setMultiple(true)->setSource($categories)->setAttribute('data-placeholder', 'Add categories')\n\t\t\t\t),\n\t\t\t\t'Content'\n\t\t\t);\n\n\t\t\t// Short Description\n\t\t\t$fields->addFieldToTab('Root.Main', TextareaField::create('ShortDescription', 'Short Description'), 'Content');\n\n\t\t\t// Product images\n\t\t\t$prodimgconf = GridFieldConfig_RelationEditor::create(10)->addComponent(new GridFieldSortableRows('SortOrder'));\n\t\t\t$fields->addFieldToTab('Root.Images', new GridField('Images', 'Images', $this->Images(), $prodimgconf));\n\n\t\t\t//Product variations\n\t\t\t$attributes = $shopConfig->Attributes();//$this->Attributes();\n\t\t\tif ($attributes && $attributes->exists()) {\n\t\t\t\t$variationFieldList = array();\n\t\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\t\t$variationFieldList['AttributeValue_'.$attribute->ID] = $attribute->Title;\n\t\t\t\t}\n\t\t\t\t$variationFieldList = array_merge($variationFieldList, singleton('Variation')->summaryFields());\n\n\t\t\t\t$config = GridFieldConfig_HasManyRelationEditor::create();\n\t\t\t\t$dataColumns = $config->getComponentByType('GridFieldDataColumns');\n\t\t\t\t$dataColumns->setDisplayFields($variationFieldList);\n\n\t\t\t\tif($this->OnSpecial() && $shopConfig->config()->HideVariationsOnSpecial){\n\t\t\t\t\t$listField = new LiteralField('','<h3>Variations can only be added when a product is not on special.</h3>');\n\t\t\t\t} else {\n\t\t\t\t\t$listField = new GridField(\n\t\t\t\t\t\t'Variations',\n\t\t\t\t\t\t'Variations',\n\t\t\t\t\t\t$this->Variations(),\n\t\t\t\t\t\t$config\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$fields->addFieldToTab('Root.Variations', $listField);\n\t\t\t}\n\n\t\t\t// Stock level\n\t\t\tif($shopConfig->StockCheck){\n\t\t\t\tif(!$this->Variations()){\n\t\t\t\t\t$fields->addFieldToTab('Root.Main', TextField::create('Stock', 'Stock level'), 'MainCategoryID');\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$fields->addFieldToTab('Root.Main', new LiteralField('CategoryWarning',\n\t\t\t\t'<p class=\"message warning\">Please create a category before creating products.</p>'\n\t\t\t), 'Title');\n\t\t}\n\n\t\t//Ability to edit fields added to CMS here\n\t\t$this->extend('updateProductCMSFields', $fields);\n\n\t\tif ($warning = ShopConfig::base_currency_warning()) {\n\t\t\t$fields->addFieldToTab('Root.Main', new LiteralField('BaseCurrencyWarning',\n\t\t\t\t'<p class=\"message warning\">'.$warning.'</p>'\n\t\t\t), 'Title');\n\t\t}\n\n\t\treturn $fields;\n\t}",
"function ywccp_get_all_custom_fields(){\r\n\t\t\r\n\t\t$fields = array();\r\n\t\t// get billing\r\n\t\t$fields['billing'] = ywccp_get_custom_fields('billing');\r\n\t\t// get shipping\r\n\t\t$fields['shipping'] = ywccp_get_custom_fields('shipping');\r\n\t\t// get additional\r\n\t\t$fields['additional'] = ywccp_get_custom_fields('additional');\r\n\t\t\r\n\t\treturn $fields;\r\n\t}",
"function create_custom_fields() {\n // Get all components to be listed\n $this->get_components();\n // Add components meta box\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'wpnext', 'WPNext Builder', array( &$this, 'display_custom_fields' ), $postType, 'normal', 'high' );\n }\n }\n }",
"function _arc_meta_category_meta($event, $step, $data, $rs)\n{\n // category types).\n if ($rs['type']!='article') {\n return $data;\n }\n\n // Get the existing meta data for this category.\n $meta = _arc_meta('category', $rs['name'], true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_title\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_image\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_image'), 'label', ' for=\"arc_meta_image\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('number', 'arc_meta_image', $meta['image'], '', '', '', '32', '', 'arc_meta_image') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_robots\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots') . '</div>';\n $form .= '</div>';\n\n return $data . $form;\n}",
"function listing_fields_collection()\r\n{\r\n\tglobal $wpdb,$post;\r\n\tremove_all_actions('posts_where');\r\n\t$cus_post_type = get_post_type();\r\n\t$args = \r\n\tarray( 'post_type' => 'custom_fields',\r\n\t'posts_per_page' => -1\t,\r\n\t'post_status' => array('publish'),\r\n\t'meta_query' => array(\r\n\t 'relation' => 'AND',\r\n\t\tarray(\r\n\t\t\t'key' => 'post_type_'.$cus_post_type.'',\r\n\t\t\t'value' => $cus_post_type,\r\n\t\t\t'compare' => '=',\r\n\t\t\t'type'=> 'text'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_page',\r\n\t\t\t'value' => array('user_side','both_side'),\r\n\t\t\t'compare' => 'IN'\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'is_active',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'key' => 'show_on_listing',\r\n\t\t\t'value' => '1',\r\n\t\t\t'compare' => '='\r\n\t\t)\r\n\t),\r\n\t\t'meta_key' => 'sort_order',\r\n\t\t'orderby' => 'meta_value',\r\n\t\t'order' => 'ASC'\r\n\t);\r\n\t$post_query = null;\r\n\tadd_filter('posts_join', 'custom_field_posts_where_filter');\r\n\t$post_query = new WP_Query($args);\r\n\tremove_filter('posts_join', 'custom_field_posts_where_filter');\r\n\treturn $post_query;\r\n}",
"public static function get_custom_fields() {\n\n\t\t$custom_fields = [];\n\t\t$fields = self::get_meta_keys_alt();\n\n\t\tforeach ( $fields as $field ) {\n\t\t\t$custom_fields[$field] = ucfirst( str_replace( '_', ' ', $field ) );\n\t\t}\n\n\t\treturn $custom_fields;\n\n\t}",
"public function extraFields()\n {\n return ['categoria'];\n }",
"public function getFrontendFields();",
"function extra_category_fields( $tag ) {\n\n\t// Get term id\n\t$tag_id\t\t= $tag->term_id;\n\t$term_meta\t= get_option( \"category_$tag_id\");\n\n\t// Category Style\n\t$style = isset ( $term_meta['athen_term_style'] ) ? $term_meta['athen_term_style'] : '' ; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_style\"><?php _e( 'Style', 'athen_transl' ); ?></label></th>\n\t<td>\n\t\t<select name=\"term_meta[athen_term_style]\" id=\"term_meta[term_style]\">\n\t\t\t<option value=\"\" <?php selected( $style ); ?>><?php _e( 'Default', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"large-image\" <?php selected( $style, 'large-image' ); ?>><?php _e( 'Large Image', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"thumbnail\" <?php selected( $style, 'thumbnail' ); ?>><?php _e( 'Thumbnail', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"grid\" <?php selected( $style, 'grid' ); ?>><?php _e( 'Grid', 'athen_transl' ); ?></option>\n\t\t</select>\n\t</td>\n\t</tr>\n\t\n\t<?php\n\t// Grid Columns\n\t$grid_cols = isset ( $term_meta['athen_term_grid_cols'] ) ? $term_meta['athen_term_grid_cols'] : '' ; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_grid_cols\"><?php _e( 'Grid Columns', 'athen_transl' ); ?></label></th>\n\t<td>\n\t\t<select name=\"term_meta[athen_term_grid_cols]\" id=\"term_meta[athen_term_grid_cols]\">\n\t\t\t<option value=\"\" <?php selected( $grid_cols ); ?>><?php _e( 'Default', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"4\" <?php selected( $grid_cols, 4 ) ?>>4</option>\n\t\t\t<option value=\"3\" <?php selected( $grid_cols, 3 ) ?>>3</option>\n\t\t\t<option value=\"2\" <?php selected( $grid_cols, 2 ) ?>>2</option>\n\t\t\t<option value=\"1\" <?php selected( $grid_cols, 1 ) ?>>1</option>\n\t\t</select>\n\t</td>\n\t</tr>\n\n\t<?php\n\t// Grid Style\n\t$grid_style = isset ( $term_meta['athen_term_grid_style'] ) ? $term_meta['athen_term_grid_style'] : '' ; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_grid_style\"><?php _e( 'Grid Style', 'athen_transl' ); ?></label></th>\n\t<td>\n\t\t<select name=\"term_meta[athen_term_grid_style]\" id=\"term_meta[athen_term_grid_style]\">\n\t\t\t<option value=\"\" <?php selected( $grid_style ) ?>><?php _e( 'Default', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"fit-rows\" <?php selected( $grid_style, 'fit-rows' ) ?>><?php _e( 'Fit Rows', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"masonry\" <?php selected( $grid_style, 'masonry' ) ?>><?php _e( 'Masonry', 'athen_transl' ); ?></option>\n\t\t</select>\n\t</td>\n\t</tr>\n\t\n\t<?php\n\t// Layout Style\n\t$layout = isset ( $term_meta['athen_term_layout'] ) ? $term_meta['athen_term_layout'] : '' ; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_layout\"><?php _e( 'Layout', 'athen_transl' ); ?></label></th>\n\t<td>\n\t\t<select name=\"term_meta[athen_term_layout]\" id=\"term_meta[athen_term_layout]\">\n\t\t\t<option value=\"\" <?php selected( $layout ) ?>><?php _e( 'Default', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"right-sidebar\" <?php selected( $layout, 'right-sidebar' ) ?>><?php _e( 'Right Sidebar', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"left-sidebar\" <?php selected( $layout, 'left-sidebar' ) ?>><?php _e( 'Left Sidebar', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"full-width\" <?php selected( $layout, 'full-width' ) ?>><?php _e( 'Full Width', 'athen_transl' ); ?></option>\n\t\t</select>\n\t</td>\n\t</tr>\n\t\n\t<?php\n\t// Pagination Type\n\t$pagination = isset ( $term_meta['athen_term_pagination'] ) ? $term_meta['athen_term_pagination'] : ''; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_pagination\"><?php _e( 'Pagination', 'athen_transl' ); ?></label></th>\n\t<td>\n\t\t<select name=\"term_meta[athen_term_pagination]\" id=\"term_meta[athen_term_pagination]\">\n\t\t\t<option value=\"\" <?php echo ( $pagination == \"\") ? 'selected=\"selected\"': ''; ?>><?php _e( 'Default', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"standard\" <?php selected( $pagination, 'standard' ) ?>><?php _e( 'Standard', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"infinite_scroll\" <?php selected( $pagination, 'infinite_scroll' ) ?>><?php _e( 'Inifinite Scroll', 'athen_transl' ); ?></option>\n\t\t\t<option value=\"next_prev\" <?php selected( $pagination, 'next_prev' ) ?>><?php _e( 'Next/Previous', 'athen_transl' ); ?></option>\n\t\t</select>\n\t</td>\n\t</tr>\n\t\n\t<?php\n\t// Excerpt length\n\t$excerpt_length = isset ( $term_meta['athen_term_excerpt_length'] ) ? $term_meta['athen_term_excerpt_length'] : ''; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_excerpt_length\"><?php _e( 'Excerpt Length', 'athen_transl' ); ?></label></th>\n\t\t<td>\n\t\t<input type=\"text\" name=\"term_meta[athen_term_excerpt_length]\" id=\"term_meta[athen_term_excerpt_length]\" size=\"3\" style=\"width:100px;\" value=\"<?php echo $excerpt_length; ?>\">\n\t\t</td>\n\t</tr>\n\t\n\t<?php\n\t// Posts Per Page\n\t$posts_per_page = isset ( $term_meta['athen_term_posts_per_page'] ) ? $term_meta['athen_term_posts_per_page'] : ''; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_posts_per_page\"><?php _e( 'Posts Per Page', 'athen_transl' ); ?></label></th>\n\t\t<td>\n\t\t<input type=\"text\" name=\"term_meta[athen_term_posts_per_page]\" id=\"term_meta[athen_term_posts_per_page]\" size=\"3\" style=\"width:100px;\" value=\"<?php echo $posts_per_page; ?>\">\n\t\t</td>\n\t</tr>\n\t\n\t<?php\n\t// Image Width\n\t$athen_term_image_width = isset ( $term_meta['athen_term_image_width'] ) ? $term_meta['athen_term_image_width'] : '';?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_image_width\"><?php _e( 'Image Width', 'athen_transl' ); ?></label></th>\n\t\t<td>\n\t\t<input type=\"text\" name=\"term_meta[athen_term_image_width]\" id=\"term_meta[athen_term_image_width]\" size=\"3\" style=\"width:100px;\" value=\"<?php echo $athen_term_image_width; ?>\">\n\t\t</td>\n\t</tr>\n\t\t\n\t<?php\n\t// Image Height\n\t$athen_term_image_height = isset ( $term_meta['athen_term_image_height'] ) ? $term_meta['athen_term_image_height'] : ''; ?>\n\t<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"athen_term_image_height\"><?php _e( 'Image Height', 'athen_transl' ); ?></label></th>\n\t\t<td>\n\t\t<input type=\"text\" name=\"term_meta[athen_term_image_height]\" id=\"term_meta[athen_term_image_height]\" size=\"3\" style=\"width:100px;\" value=\"<?php echo $athen_term_image_height; ?>\">\n\t\t</td>\n\t</tr>\n<?php\n}",
"public function fields()\n {\n return $this->hasManyThrough(Field::class, FieldGroup::class, 'category_id', 'group_id');\n }",
"public function fields(): array\n {\n return MyField::withSlug('name', MyField::withMeta([\n MyField::relation('categories')\n ->fromModel(ProductCategory::class, 'name')\n ->multiple(),\n MyField::uploadMedia(),\n MyField::input('price')\n ->step(0.001)\n ->required(),\n MyField::input('discount')\n ->step(0.001)\n ->required(),\n MyField::quill('body'),\n MyField::switcher('is_active')\n ->value(true)\n ]));\n }",
"function get_fields()\n\t{\n\t\trequire_code('ocf_members');\n\n\t\t$indexes=collapse_2d_complexity('i_fields','i_name',$GLOBALS['FORUM_DB']->query_select('db_meta_indices',array('i_fields','i_name'),array('i_table'=>'f_member_custom_fields'),'ORDER BY i_name'));\n\n\t\t$fields=array();\n\t\tif (has_specific_permission(get_member(),'view_profiles'))\n\t\t{\n\t\t\t$rows=ocf_get_all_custom_fields_match(NULL,1,1);\n\t\t\trequire_code('fields');\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\tif (!array_key_exists('field_'.strval($row['id']),$indexes)) continue;\n\n\t\t\t\t$ob=get_fields_hook($row['cf_type']);\n\t\t\t\t$temp=$ob->get_search_inputter($row);\n\t\t\t\tif (is_null($temp))\n\t\t\t\t{\n\t\t\t\t\t$type='_TEXT';\n\t\t\t\t\t$special=make_string_tempcode(get_param('option_'.strval($row['id']),''));\n\t\t\t\t\t$display=$row['trans_name'];\n\t\t\t\t\t$fields[]=array('NAME'=>strval($row['id']),'DISPLAY'=>$display,'TYPE'=>$type,'SPECIAL'=>$special);\n\t\t\t\t} else $fields=array_merge($fields,$temp);\n\t\t\t}\n\n\t\t\t$age_range=get_param('option__age_range',get_param('option__age_range_from','').'-'.get_param('option__age_range_to',''));\n\t\t\t$fields[]=array('NAME'=>'_age_range','DISPLAY'=>do_lang_tempcode('AGE_RANGE'),'TYPE'=>'_TEXT','SPECIAL'=>$age_range);\n\t\t}\n\n\t\t$map=has_specific_permission(get_member(),'see_hidden_groups')?array():array('g_hidden'=>0);\n\t\t$group_count=$GLOBALS['FORUM_DB']->query_value('f_groups','COUNT(*)');\n\t\tif ($group_count>300) $map['g_is_private_club']=0;\n\t\tif ($map==array()) $map=NULL;\n\t\t$rows=$GLOBALS['FORUM_DB']->query_select('f_groups',array('id','g_name'),$map,'ORDER BY g_order');\n\t\t$groups=form_input_list_entry('',true,'---');\n\t\t$default_group=get_param('option__user_group','');\n\t\t$group_titles=array();\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$row['text_original']=get_translated_text($row['g_name'],$GLOBALS['FORUM_DB']);\n\n\t\t\tif ($row['id']==db_get_first_id()) continue;\n\t\t\t$groups->attach(form_input_list_entry(strval($row['id']),strval($row['id'])==$default_group,$row['text_original']));\n\t\t\t$group_titles[$row['id']]=$row['text_original'];\n\t\t}\n\t\tif (strpos($default_group,',')!==false)\n\t\t{\n\t\t\t$bits=explode(',',$default_group);\n\t\t\t$combination=new ocp_tempcode();\n\t\t\tforeach ($bits as $bit)\n\t\t\t{\n\t\t\t\tif (!$combination->is_empty()) $combination->attach(do_lang_tempcode('LIST_SEP'));\n\t\t\t\t$combination->attach(escape_html(@$group_titles[intval($bit)]));\n\t\t\t}\n\t\t\t$groups->attach(form_input_list_entry(strval($default_group),true,do_lang_tempcode('USERGROUP_SEARCH_COMBO',escape_html($combination))));\n\t\t}\n\t\t$fields[]=array('NAME'=>'_user_group','DISPLAY'=>do_lang_tempcode('GROUP'),'TYPE'=>'_LIST','SPECIAL'=>$groups);\n\t\tif (has_specific_permission(get_member(),'see_hidden_groups'))\n// $fields[]=array('NAME'=>'_photo_thumb_url','DISPLAY'=>do_lang('PHOTO'),'TYPE'=>'','SPECIAL'=>'','CHECKED'=>false);\n\t\t{\n\t\t\t//$fields[]=array('NAME'=>'_emails_only','DISPLAY'=>do_lang_tempcode('EMAILS_ONLY'),'TYPE'=>'_TICK','SPECIAL'=>'');\tCSV export better now\n\t\t}\n\n\t\treturn $fields;\n\t}",
"function ywccp_get_custom_fields( $section = 'billing' ) {\r\n\r\n\t\t$fields = get_option( 'ywccp_fields_' . $section . '_options', array() );\r\n\r\n\t\tif( empty( $fields ) ) {\r\n\t\t\treturn array();\r\n\t\t}\r\n\r\n\t\t$default_keys = ywccp_get_default_fields_key( $section );\r\n\r\n\t\tforeach( $fields as $key => $field ) {\r\n\t\t\tif( in_array( $key, $default_keys ) ){\r\n\t\t\t\tunset( $fields[$key] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $fields;\r\n\t}",
"public function get_fields() {\n\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'type' => 'tab',\n\t\t\t\t'name' => __( 'Dribbble', 'publisher' ),\n\t\t\t\t'id' => 'dribbble',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Dribbble ID', 'publisher' ),\n\t\t\t\t'id' => 'user_id',\n\t\t\t\t'type' => 'text',\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => true,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Access Token', 'publisher' ),\n\t\t\t\t'id' => 'access_token',\n\t\t\t\t'type' => 'text',\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Number of Shots', 'publisher' ),\n\t\t\t\t'id' => 'photo_count',\n\t\t\t\t'type' => 'text',\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Columns', 'publisher' ),\n\t\t\t\t'id' => 'style',\n\t\t\t\t//\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t2 => __( '2 Column', 'publisher' ),\n\t\t\t\t\t3 => __( '3 Column', 'publisher' ),\n\t\t\t\t\t'slider' => __( 'Slider', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Retrieve heading fields from outside (our themes are defining them)\n\t\t */\n\t\t{\n\t\t\t$heading_fields = apply_filters( 'better-framework/shortcodes/heading-fields', array(), $this->id );\n\n\t\t\tif ( $heading_fields ) {\n\t\t\t\t$fields = array_merge( $fields, $heading_fields );\n\t\t\t}\n\t\t}\n\n\n\t\t/**\n\t\t * Retrieve design fields from outside (our themes are defining them)\n\t\t */\n\t\t{\n\t\t\t$design_fields = apply_filters( 'better-framework/shortcodes/design-fields', array(), $this->id );\n\n\t\t\tif ( $design_fields ) {\n\t\t\t\t$fields = array_merge( $fields, $design_fields );\n\t\t\t}\n\t\t}\n\n\t\tbf_array_insert_after(\n\t\t\t'bs-show-phone',\n\t\t\t$fields,\n\t\t\t'bs-text-color-scheme',\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Block Text Color Scheme', 'publisher' ),\n\t\t\t\t'id' => 'bs-text-color-scheme',\n\t\t\t\t//\n\t\t\t\t'type' => 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'' => __( '-- Default --', 'publisher' ),\n\t\t\t\t\t'light' => __( 'White Color Texts', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t//\n\t\t\t\t'vc_admin_label' => false,\n\t\t\t)\n\t\t);\n\n\t\treturn $fields;\n\t}",
"public function get_custom_fields(){\n $items = array();\n $success = $this->new_request( \"GET\", \"$this->account_id/custom_field_identifiers\" );\n if( ! $success ){\n return array();\n }\n $response = json_decode( $this->ironman->get_response_body(), true );\n $fields = isset( $response['custom_field_identifiers'] ) ? $response['custom_field_identifiers'] : array();\n foreach( $fields as $field ){\n $items[$field] = $field;\n }\n return $items;\n }",
"protected function get_fields() {\n\t\treturn rwmb_get_registry( 'field' )->get_by_object_type( 'post' );\n\t}",
"function plugin_add_custom_meta_boxes(){\n add_meta_box( \"vehicle_inspector\", __(\"Vehicle Inspector\", \"listings\"), \"vehicle_inspector_make_meta_box\", \"listings\", \"side\", \"core\", array(\"name\" => \"vehicle_inspector\"));\n\tadd_meta_box( \"vehicle_status\", __(\"Vehicle Status\", \"listings\"), \"vehicle_status_make_meta_box\", \"listings\", \"side\", \"core\", array(\"name\" => \"vehicle_status\"));\n add_meta_box( \"options\", __(\"Options\", \"listings\"), \"plugin_make_meta_box\", \"listings\", \"side\", \"core\", array(\"name\" => \"options\"));\n\t$listing_categories = get_listing_categories();\n\t\n\tforeach($listing_categories as $category){\t\n\t\t\t\n\t\t$sfield = str_replace(\" \", \"_\", strtolower($category['singular']));\n\t\t\t\t\n\t\t$field = $name = $category['singular'];\n\n\t\tif($category['filterable'] == 1){\n\t\t\t$field = $field . \" (\" . __(\"Filterable\", \"listings\") . \")\";\n\t\t}\n\t}\n}",
"public function get_custom_fields(){\n $real_fields = array();\n $fields = $this->service->doRequest( 'subscribers_list/getFields', array( 'hash' => $this->list_id ) )['fields'];\n if( $fields ){\n foreach( $fields as $field ){\n $real_fields[$field['hash']] = $field['tag'];\n }\n }\n return $real_fields;\n }",
"function meta_box_field_groups(){\n \n foreach($this->field_groups as $field_group){ ?>\n\n <div class=\"acf-field\">\n\n <div class=\"acf-label\">\n <label><a href=\"<?php echo admin_url(\"post.php?post={$field_group['ID']}&action=edit\"); ?>\"><?php echo $field_group['title']; ?></a></label>\n <p class=\"description\"><?php echo $field_group['key']; ?></p>\n </div>\n\n <div class=\"acf-input\">\n \n <?php if(acf_maybe_get($field_group, 'fields')){ ?>\n\n <table class=\"acf-table\">\n <thead>\n <th class=\"acf-th\" width=\"25%\"><strong>Label</strong></th>\n <th class=\"acf-th\" width=\"25%\"><strong>Name</strong></th>\n <th class=\"acf-th\" width=\"25%\"><strong>Key</strong></th>\n <th class=\"acf-th\" width=\"25%\"><strong>Type</strong></th>\n </thead>\n\n <tbody>\n <?php\n \n $array = array();\n foreach($field_group['fields'] as $field){\n \n $this->get_fields_labels_recursive($array, $field);\n \n }\n \n foreach($array as $field_key => $field_label){\n \n $field = acf_get_field($field_key);\n $type = acf_get_field_type($field['type']);\n $type_label = '-';\n if(isset($type->label))\n $type_label = $type->label;\n ?>\n\n <tr class=\"acf-row\">\n <td width=\"25%\"><?php echo $field_label; ?></td>\n <td width=\"25%\"><code style=\"font-size:12px;\"><?php echo $field['name']; ?></code></td>\n <td width=\"25%\"><code style=\"font-size:12px;\"><?php echo $field_key; ?></code></td>\n <td width=\"25%\"><?php echo $type_label; ?></td>\n </tr>\n \n <?php } ?>\n </tbody>\n </table>\n \n <?php } ?>\n </div>\n\n </div>\n \n <?php } ?>\n\n <script type=\"text/javascript\">\n if(typeof acf !== 'undefined'){\n\n acf.newPostbox(<?php echo wp_json_encode(array(\n 'id' => 'acfe-form-details',\n 'key' => '',\n 'style' => 'default',\n 'label' => 'left',\n 'edit' => false\n )); ?>);\n\n }\n </script>\n <?php\n \n }",
"private function _build_a_custom_fields($filter_custom_fields)\n {\n $query = $this->_db->getQuery(true);\n $query->select('`custom_title`');\n $query->select('`virtuemart_custom_id`');\n $query->from('#__virtuemart_customs');\n $query->where('`virtuemart_custom_id` IN ('.implode(', ',$filter_custom_fields).')');\n $this->_db->setQuery((string)$query);\n return $this->_db->loadAssocList();\n \n }",
"function classiera_my_category_fields($tag) {\r\n $tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t$category_icon_code = isset( $tag_extra_fields[$tag->term_id]['category_icon_code'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['category_icon_code'] ) : '';\r\n\t$category_image = isset( $tag_extra_fields[$tag->term_id]['category_image'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['category_image'] ) : '';\r\n $category_icon_color = isset( $tag_extra_fields[$tag->term_id]['category_icon_color'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['category_icon_color'] ) : '';\r\n $your_image_url = isset( $tag_extra_fields[$tag->term_id]['your_image_url'] ) ? esc_attr( $tag_extra_fields[$tag->term_id]['your_image_url'] ) : '';\r\n ?>\r\n\r\n<div class=\"form-field\">\t\r\n<table class=\"form-table\">\r\n <tr class=\"form-field\">\r\n \t<th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Icon Code', 'classiera' ); ?></label></th>\r\n \t<td>\r\n\r\n\t\t\t\t<input id=\"category_icon_code\" type=\"text\" size=\"36\" name=\"category_icon_code\" value=\"<?php $category_icon = stripslashes($category_icon_code); echo esc_attr($category_icon); ?>\" />\r\n <p class=\"description\"><?php esc_html_e( 'AwesomeFont code', 'classiera' ); ?>: <a href=\"http://fontawesome.io/icons/\" target=\"_blank\">fontawesome.io/icons</a> Ex: fa fa-desktop</p>\r\n\r\n\t\t\t</td>\r\n </tr>\r\n\t\t<tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Category Image', 'classiera' ); ?> Size:370x200px:</label></th>\r\n <td>\r\n <?php \r\n\r\n if(!empty($category_image)) {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"category_image_img\" src=\"'. $category_image .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"category_image\" type=\"text\" size=\"36\" name=\"category_image\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$category_image.'\" />';\r\n echo '<input id=\"category_image_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"category_image_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Upload Image\" /> </br>'; \r\n\r\n } else {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"category_image_img\" src=\"'. $category_image .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"category_image\" type=\"text\" size=\"36\" name=\"category_image\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$category_image.'\" />';\r\n echo '<input id=\"category_image_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"category_image_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Upload Image\" /> </br>';\r\n\r\n }\r\n\r\n ?>\r\n </td>\r\n\t\t\t\r\n <script>\r\n var image_custom_uploader;\r\n jQuery('#category_image_button').click(function(e) {\r\n e.preventDefault();\r\n\r\n //If the uploader object has already been created, reopen the dialog\r\n if (image_custom_uploader) {\r\n image_custom_uploader.open();\r\n return;\r\n }\r\n\r\n //Extend the wp.media object\r\n image_custom_uploader = wp.media.frames.file_frame = wp.media({\r\n title: 'Choose Image',\r\n button: {\r\n text: 'Choose Image'\r\n },\r\n multiple: false\r\n });\r\n\r\n //When a file is selected, grab the URL and set it as the text field's value\r\n image_custom_uploader.on('select', function() {\r\n attachment = image_custom_uploader.state().get('selection').first().toJSON();\r\n var url = '';\r\n url = attachment['url'];\r\n jQuery('#category_image').val(url);\r\n jQuery( \"img#category_image_img\" ).attr({\r\n src: url\r\n });\r\n jQuery(\"#category_image_button\").css(\"display\", \"none\");\r\n jQuery(\"#category_image_button_remove\").css(\"display\", \"block\");\r\n });\r\n\r\n //Open the uploader dialog\r\n image_custom_uploader.open();\r\n });\r\n\r\n jQuery('#category_image_button_remove').click(function(e) {\r\n jQuery('#category_image').val('');\r\n jQuery( \"img#category_image_img\" ).attr({\r\n src: ''\r\n });\r\n jQuery(\"#category_image_button\").css(\"display\", \"block\");\r\n jQuery(\"#category_image_button_remove\").css(\"display\", \"none\");\r\n });\r\n </script>\r\n </tr>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Icon Background Color', 'classiera' ); ?></label></th>\r\n <td>\r\n\r\n <link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"<?php echo get_template_directory_uri() ?>/inc/color-picker/css/colorpicker.css\" />\r\n <script type=\"text/javascript\" src=\"<?php echo get_template_directory_uri() ?>/inc/color-picker/js/colorpicker.js\"></script>\r\n <script type=\"text/javascript\">\r\n jQuery.noConflict();\r\n jQuery(document).ready(function(){\r\n jQuery('#colorpickerHolder').ColorPicker({color: '<?php echo $category_icon_color; ?>', flat: true, onChange: function (hsb, hex, rgb) { jQuery('#category_icon_color').val('#' + hex); }});\r\n });\r\n </script>\r\n\r\n <p id=\"colorpickerHolder\"></p>\r\n\r\n <input id=\"category_icon_color\" type=\"text\" size=\"36\" name=\"category_icon_color\" value=\"<?php echo $category_icon_color; ?>\" style=\"margin-top: 20px; max-width: 90px; visibility: hidden;\" />\r\n\r\n </td>\r\n </tr>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"category-page-slider\"><?php esc_html_e( 'Map Pin', 'classiera' ); ?> Size:70x70px:</label></th>\r\n <td>\r\n <?php \r\n\r\n if(!empty($your_image_url)) {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"your_image_url_img\" src=\"'. $your_image_url .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"your_image_url\" type=\"text\" size=\"36\" name=\"your_image_url\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$your_image_url.'\" />';\r\n echo '<input id=\"your_image_url_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"your_image_url_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Upload Image\" /> </br>'; \r\n\r\n } else {\r\n\r\n echo '<div style=\"width: 100%; float: left;\"><img id=\"your_image_url_img\" src=\"'. $your_image_url .'\" style=\"float: left; margin-bottom: 20px;\" /> </div>';\r\n echo '<input id=\"your_image_url\" type=\"text\" size=\"36\" name=\"your_image_url\" style=\"max-width: 200px; float: left; margin-top: 10px; display: none;\" value=\"'.$your_image_url.'\" />';\r\n echo '<input id=\"your_image_url_button_remove\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px; display: none;\" value=\"Remove\" /> </br>';\r\n echo '<input id=\"your_image_url_button\" class=\"button\" type=\"button\" style=\"max-width: 140px; float: left; margin-top: 10px;\" value=\"Upload Image\" /> </br>';\r\n\r\n }\r\n\r\n ?>\r\n </td>\r\n\r\n <script>\r\n var image_custom_uploader2;\r\n jQuery('#your_image_url_button').click(function(e) {\r\n e.preventDefault();\r\n\r\n //If the uploader object has already been created, reopen the dialog\r\n if (image_custom_uploader2) {\r\n image_custom_uploader2.open();\r\n return;\r\n }\r\n\r\n //Extend the wp.media object\r\n image_custom_uploader2 = wp.media.frames.file_frame = wp.media({\r\n title: 'Choose Image',\r\n button: {\r\n text: 'Choose Image'\r\n },\r\n multiple: false\r\n });\r\n\r\n //When a file is selected, grab the URL and set it as the text field's value\r\n image_custom_uploader2.on('select', function() {\r\n attachment = image_custom_uploader2.state().get('selection').first().toJSON();\r\n var url = '';\r\n url = attachment['url'];\r\n jQuery('#your_image_url').val(url);\r\n jQuery( \"img#your_image_url_img\" ).attr({\r\n src: url\r\n });\r\n jQuery(\"#your_image_url_button\").css(\"display\", \"none\");\r\n jQuery(\"#your_image_url_button_remove\").css(\"display\", \"block\");\r\n });\r\n\r\n //Open the uploader dialog\r\n image_custom_uploader2.open();\r\n });\r\n\r\n jQuery('#your_image_url_button_remove').click(function(e) {\r\n jQuery('#your_image_url').val('');\r\n jQuery( \"img#your_image_url_img\" ).attr({\r\n src: ''\r\n });\r\n jQuery(\"#your_image_url_button\").css(\"display\", \"block\");\r\n jQuery(\"#your_image_url_button_remove\").css(\"display\", \"none\");\r\n });\r\n </script>\r\n </tr>\r\n</table>\r\n</div>\r\n\r\n <?php\r\n}",
"protected function getSchemaFieldsForCustomFields()\n {\n $schemaPartialForCustomFields = [];\n foreach ($this->getWrapper()->getCustomFieldsCached() as $customField) {\n $dataTypeClassName = end(explode('\\\\', get_class($customField->getDataType())));\n $schemaPartialForCustomFields[$customField->apiName] = $dataTypeClassName;\n }\n return $schemaPartialForCustomFields;\n }",
"function extra_category_fields( $tag ) { //check for existing featured ID\n $t_id = $tag->term_id;\n $cat_meta = get_option( \"category_$t_id\");\n\n require_once ('includes/admin-category-extra-fields.php');\n}",
"public function get_fields()\n {\n $catalogue_name = get_param_string('catalogue_name', '');\n if ($catalogue_name == '') {\n return array();\n }\n return $this->_get_fields($catalogue_name);\n }",
"public function getcategorydata($account_id, $category_id) {\n\n\n $this->db->select('*,count(custom_fields.field_name) as fields');\n $this->db->where('categories.account_id', $account_id);\n $this->db->where('categories.id', $category_id);\n $this->db->where('categories.archive', 1);\n $this->db->from('categories');\n $this->db->join('custom_fields', 'custom_fields.account_id=categories.account_id');\n $res = $this->db->get();\n $result = $res->result_array();\n if ($result) {\n foreach ($result as $key => $value) {\n $arrCustomFields = json_decode($value['custom_fields']);\n if ($arrCustomFields) {\n\n $this->db->where_in('id', $arrCustomFields);\n $query = $this->db->get('custom_fields');\n $my_arr = $query->result();\n } else {\n $my_arr = array();\n }\n\n foreach ($my_arr as $record) {\n $result[$key][$record->field_name] = 'YES';\n }\n }\n\n return $result[0];\n } else {\n return FALSE;\n }\n }",
"function extra_category_fields( $tag ) { //check for existing featured ID\n $t_id = $tag->term_id;\n $cat_meta = get_option( \"category_$t_id\");\n\t?>\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\"><label for=\"cat_Image_url\"><?php _e('Category Url'); ?></label></th>\n\t\t<td><input type=\"text\" name=\"Cat_meta[cat_url]\" id=\"Cat_meta[img]\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $cat_meta['cat_url'] ? $cat_meta['cat_url'] : ''; ?>\"><br />\n\t <span class=\"description\"><?php _e('Url for category'); ?></span>\n\t\t</td>\n\t</tr>\n\t<?php\n}",
"public function getAll() : array\n {\n if (!empty($listOfCustomFields = $this->getAllFromRedis())) {\n return $listOfCustomFields;\n }\n\n $companyId = $this->companies_id ?? 0;\n\n $result = Di::getDefault()->get('db')->prepare('\n SELECT name, value \n FROM apps_custom_fields\n WHERE\n companies_id = ?\n AND model_name = ?\n AND entity_id = ?\n ');\n\n $result->execute([\n $companyId,\n get_class($this),\n $this->getId()\n ]);\n\n $listOfCustomFields = [];\n\n while ($row = $result->fetch()) {\n $listOfCustomFields[$row['name']] = Str::jsonToArray($row['value']);\n }\n\n return $listOfCustomFields;\n }",
"public function getCategoryFieds() {\n\t\t$result = $fields = array();\n\t\n\t\t$query = $this->db->query('DESCRIBE '. DB_PREFIX . 'category_description');\n\t\t$result = $query->rows;\n\t\t\n\t\tforeach ($result as $row) {\n\t\t\tif ($row['Field'] == 'product_id' || $row['Field'] == 'language_id') { continue; }\n\t\t\t$field = $row['Field'];\n\t\t\t$fields[$field] = $field;\n\t\t}\n\t\treturn $fields;\n\t}",
"public function CustomFields()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = product_id, localKey = id)\n \treturn $this->hasMany(CustomFields::class);\n }",
"public function initSubFields() {\n $post = $this->getData('post');\n switch ($post['custom_type']) {\n case 'shop_customer':\n case 'import_users':\n $optionName = 'wpcf-usermeta';\n break;\n case 'taxonomies':\n $optionName = 'wpcf-termmeta';\n break;\n default:\n $optionName = 'wpcf-field';\n break;\n }\n\n $this->fieldsData = wpcf_admin_fields_get_fields_by_group(\n $this->groupPost->ID,\n 'slug',\n false,\n false,\n false,\n TYPES_CUSTOM_FIELD_GROUP_CPT_NAME,\n $optionName,\n true\n );\n\n foreach ($this->getFieldsData() as $fieldData) {\n $field = FieldFactory::create($fieldData, $post, $this->getFieldName(), $this);\n $this->subFields[] = $field;\n }\n }",
"public function get_customer_meta_fields()\n {\n\n $show_fields = apply_filters('wc_pos_customer_meta_fields', array(\n 'outlet_filds' => array(\n 'title' => __('Point of Sale', 'wc_point_of_sale'),\n 'fields' => array(\n 'outlet' => array(\n 'label' => __('Outlet', 'wc_point_of_sale'),\n 'type' => 'select',\n 'name' => 'outlet[]',\n 'multiple' => true,\n 'options' => WC_POS()->outlet()->get_data_names(),\n 'description' => __('Ensure the user is logged out before changing the outlet.', 'wc_point_of_sale')\n ),\n 'discount' => array(\n 'label' => __('Discount', 'wc_point_of_sale'),\n 'type' => 'select',\n 'options' => array(\n 'enable' => 'Enable',\n 'disable' => 'Disable'\n ),\n 'description' => ''\n ),\n )\n ),\n ));\n\n if ( get_option( 'wc_pos_enable_user_card', 'no' ) == 'yes' ) {\n $show_fields['outlet_filds']['fields']['user_card_number'] = array(\n 'label' => __( 'Card Number', 'wc_point_of_sale' ),\n 'type' => 'input',\n 'description' => 'Enter the number of the card to associate this customer with.'\n );\n $show_fields['outlet_filds']['fields']['user_card_number_print'] = array(\n 'label' => __( 'Print Customer Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['user_card_number_scan'] = array(\n 'label' => __( 'Load Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n }\n $show_fields['outlet_filds']['fields']['disable_pos_payment'] = array(\n 'label' => __( 'Tendering', 'wc_point_of_sale' ),\n 'desc' => 'Disable tendering ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['approve_refunds'] = array(\n 'label' => __( 'Refunds', 'wc_point_of_sale' ),\n 'desc' => 'Enable refund ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n return $show_fields;\n }",
"public function buildCustomFieldsList() {\n\n\t\t$parsed = array();\n\n\t\tforeach ( $this->get_all_custom_fields( false ) as $list_id => $merge_field ) {\n\t\t\tarray_map(\n\t\t\t\tfunction ( $var ) use ( &$parsed, $list_id ) {\n\t\t\t\t\t$parsed[ $list_id ][ $var['id'] ] = $var['name'];\n\t\t\t\t},\n\t\t\t\t$merge_field\n\t\t\t);\n\t\t}\n\n\t\treturn $parsed;\n\t}",
"function acf_get_fields($parent)\n{\n}",
"function gmw_search_form_custom_fields( $gmw ) {\r\n\t\techo gmw_get_search_form_custom_fields( $gmw );\r\n\t}",
"function simply_add_custom_general_fields()\n{\n // You can create text, textarea, select, checkbox and custom fields\n global $woocommerce, $post;\n // Custom fields will be created here...\n ?>\n <div class=\"options_group\">\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_family_code\"><?php echo __('Family Code', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n $family_code = get_post_meta($post->ID, 'family_code', true);\n\n echo $family_code;\n\n ?>\n\n </p>\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_mpartname\"><?php echo __('Mpartname', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n\t\t$mpartname = get_post_meta($post->ID, 'mpartname', true);\n\n\t\techo $mpartname;\n\n\t\t?>\n\n </p>\n </div>\n <?php\n}",
"protected function get_registered_fields()\n {\n }",
"public function register_meta_fields() \n {\n $coupon_fields = new_cmb2_box([\n 'id' => $this->cpt_prefix . '_metabox',\n 'title' => __( 'Coupon Details', 'ash' ),\n 'object_types' => [$this->cpt_prefix],\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_type',\n 'name' => __( 'Type', 'ash' ),\n 'type' => 'select',\n 'options' => [\n 'flat' => __('Flat Discount', 'ash'),\n 'percent' => __('Percentage Discount', 'ash'),\n ],\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_amount',\n 'name' => __( 'Amount', 'ash' ),\n 'type' => 'text_small',\n 'attributes' => [\n 'type' => 'number',\n 'pattern' => '\\d*',\n ],\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_start_date',\n 'name' => __( 'Start Date', 'ash' ),\n 'type' => 'text_date',\n 'date_format' => __( 'd/m/Y', 'ash' ),\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_end_date',\n 'name' => __( 'End Date', 'ash' ),\n 'type' => 'text_date',\n 'date_format' => __( 'd/m/Y', 'ash' ),\n ]);\n }",
"public function get_custom_fields($post_id)\n {\n }",
"public function getControlFields()\n {\n $fields = array();\n $query = 'response > record > marcRecord > controlfield';\n $controlFields = $this->domCrawler->filter($query)->each(function(Crawler $node) {\n return new ControlField($node);\n });\n\n\n return $controlFields;\n }",
"function portal_load_meta_fields() {\n\tif(function_exists(\"register_field_group\")) {\n\n\t\t// Load the fields via portal_load_field_template so users can import their own\n\n\t\tportal_load_field_template( 'overview' );\n\t\tportal_load_field_template( 'milestones' );\n\t\tportal_load_field_template( 'phases' );\n\t\tportal_load_field_template( 'teams' );\n\n\t}\n\n}",
"function get_fields( $custom_field_set , $custom_field_item )\n\t{\t\n\t\t$post_type_fields = include( get_template_directory().'/module/'.$custom_field_set.'/'.$custom_field_item.'/config.fields.php' );\n\t\treturn $post_type_fields;\n\t}",
"function acf_get_grouped_field_types()\n{\n}",
"public function getContactDataFields();",
"public function getCMSFields()\n {\n // Obtain Field Objects (from parent):\n \n $fields = parent::getCMSFields();\n \n // Create Options Fields:\n \n $fields->addFieldsToTab(\n 'Root.Options',\n [\n FieldSection::create(\n 'GalleryOptions',\n $this->fieldLabel('Gallery'),\n [\n CheckboxField::create(\n 'ShowImageCounts',\n $this->fieldLabel('ShowImageCounts')\n )\n ]\n )\n ]\n );\n \n // Answer Field Objects:\n \n return $fields;\n }",
"public static function get_track_custom_fields() {\n global $DB;\n\n if (static::require_elis_dependencies() === true) {\n // Get custom fields.\n $sql = 'SELECT shortname, name, datatype, multivalued\n FROM {'.field::TABLE.'} f\n JOIN {'.field_contextlevel::TABLE.'} fctx ON f.id = fctx.fieldid AND fctx.contextlevel = ?';\n $sqlparams = array(CONTEXT_ELIS_TRACK);\n return $DB->get_records_sql($sql, $sqlparams);\n } else {\n return array();\n }\n }",
"public function get_fields()\n {\n return [\n \"isys_catg_invoice_list__denotation\" => \"LC__CMDB__CATG__TITLE\",\n \"isys_catg_invoice_list__amount\" => \"LC__CMDB__CATG__INVOICE__AMOUNT\",\n \"isys_catg_invoice_list__date\" => \"LC__CMDB__CATG__INVOICE__DATE\",\n \"isys_catg_invoice_list__edited\" => \"LC__CMDB__CATG__INVOICE__EDITED\",\n \"isys_catg_invoice_list__financial_accounting_delivery\" => \"LC__CMDB__CATG__INVOICE__FINANCIAL_ACCOUNTING_DELIVERY\",\n \"isys_catg_invoice_list__charged\" => \"LC__CMDB__CATG__INVOICE__CHARGED\",\n ];\n }",
"public function get_fields()\n {\n $l_table = $this->m_cat_dao->get_table();\n $l_properties = $this->m_cat_dao->get_properties();\n\n return [\n $l_table . '__id' => 'ID',\n $l_table . '__key' => $l_properties['key'][C__PROPERTY__INFO][C__PROPERTY__INFO__TITLE],\n $l_table . '__value' => $l_properties['value'][C__PROPERTY__INFO][C__PROPERTY__INFO__TITLE],\n $l_table . '__group' => $l_properties['group'][C__PROPERTY__INFO][C__PROPERTY__INFO__TITLE],\n 'isys_catg_identifier_type__title' => $l_properties['type'][C__PROPERTY__INFO][C__PROPERTY__INFO__TITLE]\n ];\n }",
"public function getEcommerceFieldsForCMS()\n {\n $fields = new CompositeField();\n $memberTitle = HTMLReadonlyField::create('MemberTitle', _t('Member.TITLE', 'Name'), '<p>' . $this->owner->getTitle() . '</p>');\n $fields->push($memberTitle);\n $memberEmail = HTMLReadonlyField::create('MemberEmail', _t('Member.EMAIL', 'Email'), '<p><a href=\"mailto:' . $this->owner->Email . '\">' . $this->owner->Email . '</a></p>');\n $fields->push($memberEmail);\n $lastLogin = HTMLReadonlyField::create('MemberLastLogin', _t('Member.LASTLOGIN', 'Last Login'), '<p>' . $this->owner->dbObject('LastVisited') . '</p>');\n $fields->push($lastLogin);\n $group = self::get_customer_group();\n if (! $group) {\n $group = new Group();\n }\n $headerField = HeaderField::create('MemberLinkFieldHeader', _t('Member.EDIT_CUSTOMER', 'Edit Customer'));\n $linkField1 = EcommerceCMSButtonField::create(\n 'MemberLinkFieldEditThisCustomer',\n $this->owner->CMSEditLink(),\n _t('Member.EDIT', 'Edit') . ' <i>' . $this->owner->getTitle() . '</i>'\n );\n $fields->push($headerField);\n $fields->push($linkField1);\n\n if (EcommerceRole::current_member_can_process_orders(Security::getCurrentUser())) {\n $linkField2 = EcommerceCMSButtonField::create(\n 'MemberLinkFieldEditAllCustomers',\n CMSEditLinkAPI::find_edit_link_for_object($group),\n _t('Member.EDIT_ALL_CUSTOMERS', 'Edit All ' . $group->Title)\n );\n $fields->push($linkField2);\n }\n\n return $fields;\n }",
"public function getAllFields() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"function acadp_get_custom_field_types() {\n\n\t$types = array(\n\t\t'text' => __( 'Text', 'advanced-classifieds-and-directory-pro' ),\n\t\t'textarea' => __( 'Text Area', 'advanced-classifieds-and-directory-pro' ),\n\t\t'select' => __( 'Select', 'advanced-classifieds-and-directory-pro' ),\n\t\t'checkbox' => __( 'Checkbox', 'advanced-classifieds-and-directory-pro' ),\n\t\t'radio' => __( 'Radio Button', 'advanced-classifieds-and-directory-pro' ),\n\t\t'url' => __( 'URL', 'advanced-classifieds-and-directory-pro' )\n\t);\n\n\t// Return\n\treturn apply_filters( 'acadp_custom_field_types', $types );\n\n}",
"private function _get_channel_fields()\n\t{\n\t\tif ( ! ($this->fields = low_get_cache('channel', 'custom_channel_fields')))\n\t\t{\n\t\t\t$this->_log('Fetching channel fields from API');\n\n\t\t\t$this->EE->load->library('api');\n\t\t\t$this->EE->api->instantiate('channel_fields');\n\n\t\t\t$fields = $this->EE->api_channel_fields->fetch_custom_channel_fields();\n\n\t\t\tforeach ($fields AS $key => $val)\n\t\t\t{\n\t\t\t\tlow_set_cache('channel', $key, $val);\n\t\t\t}\n\n\t\t\t$this->fields = $fields['custom_channel_fields'];\n\t\t}\n\t}",
"protected function addFields()\n {\n $groupCustomOptionsName = CustomOptions::GROUP_CUSTOM_OPTIONS_NAME;\n $optionContainerName = CustomOptions::CONTAINER_OPTION;\n $commonOptionContainerName = CustomOptions::CONTAINER_COMMON_NAME;\n\n // Add fields to the option\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'] = array_replace_recursive(\n $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n [$optionContainerName]['children'][$commonOptionContainerName]['children'],\n $this->getOptionFieldsConfig()\n );\n\n // Add fields to the values\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'] = array_replace_recursive(\n // $this->meta[$groupCustomOptionsName]['children']['options']['children']['record']['children']\n // [$optionContainerName]['children']['values']['children']['record']['children'],\n // $this->getValueFieldsConfig()\n // );\n }",
"public function add_custom_fields($custom_fields, $category_id, $product_id)\n {\n foreach ($custom_fields as $key => $val) {\n if($val) {\n $key = str_replace(['house_', 'job_', 'description_'], ['', '', ''], $key);\n $field_id = $this->get_field_id($key, $category_id);\n $data = array(\n 'field_id' => $field_id,\n 'product_id' => $product_id,\n 'product_filter_key' => strtolower($key),\n 'field_value' => $val,\n );\n $this->db->insert('custom_fields_product', $data);\n }\n }\n }",
"public function form_fields() {\n\t\treturn apply_filters( \"appthemes_{$this->box_id}_metabox_fields\", $this->form() );\n\t}",
"function acf_get_raw_field_groups()\n{\n}",
"public static function set_fields() {\r\n if ( ! function_exists( 'acf_add_local_field_group' ) ) {\r\n return;\r\n }\r\n $options = get_option( 'myhome_redux' );\r\n $fields = array(\r\n /*\r\n * General tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_general',\r\n 'label' => esc_html__( 'General', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'top',\r\n 'wrapper' => array (\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ),\r\n ),\r\n // Featured\r\n array(\r\n 'key' => 'myhome_estate_featured',\r\n 'label' => esc_html__( 'Featured', 'myhome-core' ),\r\n 'name' => 'estate_featured',\r\n 'type' => 'true_false',\r\n 'default_value' => false,\r\n 'wrapper' => array(\r\n 'class' => 'acf-1of3'\r\n ),\r\n ),\r\n );\r\n\r\n foreach ( My_Home_Attribute::get_attributes() as $attr ) {\r\n if ( $attr->get_type() != 'field' ) {\r\n continue;\r\n }\r\n\r\n $name = $attr->get_name();\r\n $display_after = $attr->get_display_after();\r\n if ( ! empty( $display_after ) ) {\r\n $name .= ' (' . $display_after . ')';\r\n }\r\n\r\n array_push( $fields, array(\r\n 'key' => 'myhome_estate_attr_' . $attr->get_slug(),\r\n 'label' => $name,\r\n 'name' => 'estate_attr_' . $attr->get_slug(),\r\n 'type' => 'text',\r\n 'default_value' => '',\r\n 'wrapper' => array(\r\n 'class' => 'acf-1of3'\r\n ),\r\n ) );\r\n }\r\n\r\n\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Location tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_location',\r\n 'label' => esc_html__( 'Location', 'myhome-core' ),\r\n 'type' => 'tab',\r\n ),\r\n // Location\r\n array(\r\n 'key' => 'myhome_estate_location',\r\n 'label' => esc_html__( 'Location', 'myhome-core' ),\r\n 'name' => 'estate_location',\r\n 'type' => 'google_map',\r\n ),\r\n /*\r\n * Gallery tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_gallery',\r\n 'label' => 'Gallery',\r\n 'instructions' => 'Click \"Add to gallery\" below to upload files',\r\n 'type' => 'tab',\r\n ),\r\n // Gallery\r\n array(\r\n 'key' => 'myhome_estate_gallery',\r\n 'label' => 'Gallery',\r\n 'name' => 'estate_gallery',\r\n 'type' => 'gallery',\r\n 'preview_size' => 'thumbnail',\r\n 'library' => 'all',\r\n )\r\n ) );\r\n\r\n if ( isset( $options['mh-estate_plans'] ) && $options['mh-estate_plans'] ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Plans tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_plans',\r\n 'label' => esc_html__( 'Plans', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Plan\r\n array(\r\n 'key' => 'myhome_estate_plans',\r\n 'label' => esc_html__( 'Plans', 'myhome-core' ),\r\n 'name' => 'estate_plans',\r\n 'type' => 'repeater',\r\n 'button_label' => esc_html__( 'Add plan', 'myhome-core' ),\r\n 'sub_fields' => array(\r\n // Name\r\n array(\r\n 'key' => 'myhome_estate_plans_name',\r\n 'label' => esc_html__( 'Name', 'myhome-core' ),\r\n 'name' => 'estate_plans_name',\r\n 'type' => 'text',\r\n ),\r\n // Image\r\n array(\r\n 'key' => 'myhome_estate_plans_image',\r\n 'label' => esc_html__( 'Image', 'myhome-core' ),\r\n 'name' => 'estate_plans_image',\r\n 'type' => 'image',\r\n ),\r\n ),\r\n )\r\n ) );\r\n }\r\n\r\n if ( ! empty( $options['mh-estate_video'] ) ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Video tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_video',\r\n 'label' => esc_html__( 'Video', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Video\r\n array(\r\n 'key' => 'myhome_estate_video',\r\n 'label' => esc_html__( 'Video link (Youtube / Vimeo / Facebook / Twitter / Instagram / link to .mp4)', 'myhome-core' ),\r\n 'name' => 'estate_video',\r\n 'type' => 'oembed',\r\n )\r\n ) );\r\n }\r\n\r\n if ( ! empty( $options['mh-estate_virtual_tour'] ) ) {\r\n $fields = array_merge( $fields, array(\r\n /*\r\n * Virtual tour tab\r\n */\r\n array(\r\n 'key' => 'myhome_estate_tab_virtual_tour',\r\n 'label' => esc_html__( 'Virtual tour', 'myhome-core' ),\r\n 'type' => 'tab',\r\n 'placement' => 'left',\r\n ),\r\n // Virtual tour\r\n array(\r\n 'key' => 'myhome_estate_virtual_tour',\r\n 'label' => esc_html__( 'Add embed code', 'myhome-core' ),\r\n 'name' => 'virtual_tour',\r\n 'type' => 'text',\r\n )\r\n ) );\r\n }\r\n\r\n acf_add_local_field_group(\r\n array(\r\n 'key' => 'myhome_estate',\r\n 'title' => '<span class=\"dashicons dashicons-admin-home\"></span> ' . esc_html__( 'Property details', 'myhome-core' ),\r\n 'fields' => $fields,\r\n 'menu_order' => 10,\r\n 'location' => array(\r\n array(\r\n array(\r\n 'param' => 'post_type',\r\n 'operator' => '==',\r\n 'value' => 'estate',\r\n ),\r\n ),\r\n ),\r\n )\r\n );\r\n }",
"public function customFields()\n {\n return $this->morphMany('App\\Models\\MemberCustomFields', 'fieldable');\n }",
"function qode_lms_include_taxonomy_custom_fields() {\n\t\tif ( qode_lms_theme_installed() ) {\n\t\t\tforeach ( glob( QODE_LMS_CPT_PATH . '/*/admin/taxonomy-meta-fields/*.php' ) as $global_options ) {\n\t\t\t\tinclude_once $global_options;\n\t\t\t}\n\t\t}\n\t}",
"public function get_all_custom_fields( $force ) {\n\n\t\t$custom_data = array();\n\n\t\t// Serve from cache if exists and requested\n\t\t$cached_data = $this->get_cached_custom_fields();\n\t\tif ( false === $force && ! empty( $cached_data ) ) {\n\t\t\treturn $cached_data;\n\t\t}\n\n\t\t// Build custom fields for every list\n\t\t$lists = $this->get_lists( $force );\n\n\t\tforeach ( $lists as $list ) {\n\t\t\tif ( ! empty( $list['id'] ) ) {\n\t\t\t\t$custom_data[ $list['id'] ] = $this->get_custom_fields_for_list( $list['id'] );\n\t\t\t}\n\t\t}\n\n\t\t$this->_save_custom_fields( $custom_data );\n\n\t\treturn $custom_data;\n\t}",
"public function load_wp_fields() {\n\t global $WCPc;\n\t if ( ! class_exists( 'DC_WP_Fields' ) )\n\t require_once ($this->php_lib_path . 'class-dc-wp-fields.php');\n\t $DC_WP_Fields = new DC_WP_Fields(); \n\t return $DC_WP_Fields;\n\t}",
"function ks_include_custom_acf_field_types() {\n include_once(get_template_directory() . '/includes/acf-custom/fields/acf-gf-select.php'); // add Gravity Form field type\n}",
"function gmw_get_search_form_custom_fields( $gmw = array() ) {\r\n\r\n\tif ( empty( $gmw['search_form']['custom_fields'] ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t$picker_enabled = false;\r\n\t$output = '';\r\n\r\n\tforeach ( $gmw['search_form']['custom_fields'] as $value ) {\r\n\r\n\t\t$fdouble = 0;\r\n\t\t$fdouble_class = '';\r\n\r\n\t\tif ( $value['compare'] == 'BETWEEN' || $value['compare'] == 'NOT BETWEEN' ) {\r\n\t\t\t$fdouble = true;\r\n\t\t\t$fdouble_class = ' double';\r\n\t\t}\r\n\r\n\t\t$args = array(\r\n\t\t\t'id'\t => $gmw['ID'], \r\n\t\t\t'name' \t => $value['name'],\r\n\t\t\t'type'\t => $value['type'],\r\n\t\t\t'date_type' => $value['date_type'],\r\n\t\t\t'compare' => $value['compare'],\r\n\t\t\t'label'\t => isset( $value['label'] ) ? $value['label'] : '',\r\n\t\t\t'placeholder' => isset( $value['placeholder'] ) ? $value['placeholder'] : '',\r\n\t\t\t'double'\t => $fdouble\r\n\t\t);\r\n\r\n\t\t$output .= '<div class=\"gmw-form-field-wrapper custom-field '.esc_attr( $value['name'] ).' '.esc_attr( $value['type'] ).$fdouble_class.'\">';\r\n\t\t$output .= gmw_get_search_form_custom_field( $args, $gmw );\r\n\t\t$output .= '</div>';\r\n\t} \r\n\r\n\treturn $output;\r\n}",
"function getFields();",
"public function getCustomFieldsByItem($item_id) {\n $this->load->model('items_model');\n $cat_id = $this->items_model->getCategoryFor($item_id);\n $this->db->select('*');\n $this->db->where(array('item_id' => $item_id, 'custom_fields_content.account_id' => $this->session->userdata('objSystemUser')->accountid, 'custom_fields_content.category_id' => $cat_id));\n $this->db->join('custom_fields_content', 'custom_fields.id = custom_fields_content.custom_field_id');\n $query = $this->db->get('custom_fields');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }",
"function getcategorys_list(){\n \n global $wpdb;\n\n$post_per_page = (isset($_REQUEST['post_per_page'])) ? $_REQUEST['post_per_page'] : 1; \n\n$offset = $post_per_page * ($_REQUEST['page'] - 1);\n// Setup the arguments to pass in\n$args = array(\n'offset' => $offset,\n'number' => $post_per_page,\n'order' => 'DESC',\n'hide_empty'=>0\n);\n// Gather the series\n$mycategory = get_terms( 'products', $args );\n\n\n\n if(!empty($mycategory)){\n foreach($mycategory as $post)\n {\n\n \n $im = $post->taxonomy.'_'. $post->term_id; \n $collection_image = get_field('category_image',$im); \n\n $title = $collection_image['title'];\n $url = get_term_link($post);\n $medium= get_image_url($collection_image['id'],'medium');\n\n if(empty($medium)){\n $medium = (get_template_directory_uri().\"/images/no-image.png\"); \n }\n \n\n printf('<div class=\"col-lg-3 col-md-4 col-sm-4 col-xs-6\">\n <div class=\"product_info\"><a href=\"'.$url.'\" title=\"\" class=\"overly\"><span><img src=\"'.$medium.'\" alt=\"\" title=\"\"></span></a>\n <h4>'.$post->name.'</h4>\n <a href=\"'.$url.'\" title=\"View More\" class=\"link\">View More</a> </div>\n </div>');\n\n\n }\n }\n die();\n}",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function getFields();",
"public function addCustomFields()\n {\n if (!($enabled_custom_fields = $this->getDataManager()->getOption('custom_fields'))) {\n $enabled_custom_fields = array();\n }\n if (!($enabled_profile_fields = $this->getDataManager()->getOption('custom_fields_additional'))) {\n $enabled_profile_fields = array();\n }\n ?>\n <fieldset data-rm-target=\"#custom-fields .custom-field-select option\" id=\"profile-fields\" class=\"checkbox-list rm-ctrl syncstate\"<?php echo !$this->getDataManager()->getOption('enable_sync') ? ' disabled=\"disabled\"' : '' ?>>\n <?php foreach ($this->custom_fields as $custom_field): ?>\n <div>\n <label>\n <input class=\"profile-field-checkbox\" type=\"checkbox\" name=\"<?php echo $this->getViewKey().'[custom_fields_additional][]' ?>\" value=\"<?php echo $custom_field->getId() ?>\"<?php echo in_array($custom_field->getId(), $enabled_profile_fields) ? ' checked=\"checked\"' : '' ?> />\n <?php echo $custom_field->getName() ?> (<?php _e('customfield.type.'.$custom_field->getFieldType(), 'mgrt-wordpress') ?>)\n </label>\n </div>\n <?php endforeach; ?>\n </fieldset>\n <p class=\"description\"><?php _e('form.sync.field.custom.more.help', 'mgrt-wordpress') ?></p>\n <?php\n }",
"function getFields( $type ) {\r\n\t\r\n\tglobal $db, $site, $gallerySettings;\r\n\t\r\n\t$fieldTitles = array( 'title' => 'Title',\r\n\t\t\t\t\t\t 'description' => 'Description',\r\n\t\t\t\t\t\t 'items_count' => 'Count Items in Category',\r\n\t\t\t\t\t\t 'category_title' => 'Category Title',\r\n\t\t\t\t\t\t 'price' => 'Price',\r\n\t\t\t\t\t\t 'quantity' => 'Quantity in Stock',\r\n\t\t\t\t\t\t 'add_to_cart' => 'Add To Cart',\r\n\t\t\t\t\t\t 'manufacturer' => 'Manufacturer' );\r\n\t\r\n\tif ( $type == 'cat_thumb' ) \r\n\t\t$fieldsToDisplay = array( 'items_count', 'category_title' );\r\n\telse\r\n\t\t$fieldsToDisplay = array( 'title', 'description' );\r\n\t\r\n\tif ( $gallerySettings['useEcommerce'] == 'yes' && $type != 'cat_thumb' ) {\r\n\t\t\r\n\t\t$fieldsToDisplay = array_append( $fieldsToDisplay, array( 'price', 'quantity', 'manufacturer', 'add_to_cart' ) );\r\n\t\t\r\n\t\t$attributes = $db->getAll( 'select a.id as a_id, a.name, a._default, d.* from '. ATTRIBUTES_TABLE. \" a left join \". DISPLAYOPTIONS_TABLE.\" d on a.id=d.field_id and d.type='$type' and d.site_key='$site' where a.site_key='$site' and a.visible=1\" );\r\n\t\t//print_r( $attributes );\r\n\t\tforeach ( $attributes as $num=>$attr ) {\r\n\t\t\tif ( $attr[id] == '' ) {\r\n\t\t\t\t$row = $db->getOne( 'select max(row) from '. DISPLAYOPTIONS_TABLE.\" where site_key='$site' and type='$type' and visible=1\" );\r\n\t\t\t\t$row++;\r\n\t\t\t\t$db->query( 'insert into '.DISPLAYOPTIONS_TABLE.\" (section, field_id, type, row, layout, style, visible, site_key) values ( 'top', '$attr[a_id]', '$type', '$row', '{\\$name}: {\\$value}', '', '0', '$site') \" );\r\n\t\t\t}\r\n\t\t\t$fieldsToDisplay[] = $attr[a_id];\r\n\t\t}\r\n\t\r\n\t}\r\n\t$fieldsToDisplay = '\\''.implode( '\\', \\'', $fieldsToDisplay ).'\\'';\r\n\t\r\n\t$items = $db->getAll( 'select 1 as canLeft, 1 as canRight, d.*, a.name from '. DISPLAYOPTIONS_TABLE.\" d left join \". ATTRIBUTES_TABLE.\" a on d.field_id=a.id where d.field_id in ($fieldsToDisplay) and d.type='$type' and d.site_key='$site' order by d.visible desc, d.section asc, d.row, d.row_position\" );\r\n\tforeach ( $items as $num=>$item ) {\r\n\t\t\r\n\t\tif ( in_array( $item['field_id'], array_keys( $fieldTitles ) ) )\r\n\t\t\t$items[$num]['name'] = $fieldTitles[$item['field_id']];\r\n\t\t\t\r\n\t\tif ( $num == 0 ) {\r\n\t\t\t$items[$num]['canLeft'] = 0;\r\n\t\t\t$prevSection = $items[$num]['section'];\r\n\t\t\t$prevRow = $items[$num]['row'];\r\n\t\t}\r\n\t\t\t\r\n\t\tif ( ($items[$num]['section'] != $prevSection || $items[$num]['row'] != $prevRow) && $num!=0 ) {\r\n\t\t\t$items[$num-1]['canRight'] = 0;\r\n\t\t\t$items[$num]['canLeft'] = 0;\r\n\t\t\t$prevSection = $items[$num]['section'];\r\n\t\t\t$prevRow = $items[$num]['row'];\r\n\t\t}\r\n\t\t\r\n\t\tif ( !$items[$num]['visible'] )\r\n\t\t\t$items[$num-1]['canRight'] = 0;\r\n\t}\r\n\t\r\n\t$items[count( $items) - 1]['canRight'] = 0;\r\n\t\r\n\treturn $items;\r\n\r\n}",
"function work_category_add_new_meta_field() {\r\n\t\t$textdomain = 'milk';\r\n\t\t?>\r\n\t \t\t<div class=\"row\">\r\n\t \t\t\t<p class=\"col-md-6 desc\" >\r\n\t \t\t\t\t<label for=\"term_meta[featured_img]\"><?php _e( \"Featured Image\", $textdomain ); ?></label>\r\n\t \t\t\t\t<br/>\r\n\t \t\t\t\t<label for=\"term_meta[featured_img]\"><?php _e( \"If you choose to show work categories on work page instead of works, you need to upload featured image for category\", $textdomain ); ?></label>\r\n\t \t\t\t</p>\r\n\t\t\t \r\n\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t<input \tclass=\"post_meta_image_upload button button-primary\" \r\n\t\t\t\t\t\tname=\"image_btn\" \r\n\t\t\t\t\t\ttype=\"button\" \r\n\t\t\t\t\t\tdata-uploader_title=<?php _e( \"Choose image\", $textdomain ); ?>\r\n\t\t\t\t\t\tdata-uploader_button_text=<?php _e( \"Select\" , $textdomain ); ?>\r\n\t\t\t\t\t\tvalue=<?php _e( \"Select images\", $textdomain ); ?>/>\r\n\t\t\t\t\t<input id=\"term_meta[featured_img]\"\r\n\t\t\t\t\t\tname=\"term_meta[featured_img]\"\r\n\t\t\t\t\t\tclass=\"img_url\" \r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tstyle=\"display:none\"\r\n\t\t\t\t\t\tvalue=\"\"/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"row\">\r\n\t\t\t \t<p class=\"col-md-6 desc\" >\r\n\t \t\t\t\t<label for=\"term_meta[work_color]\"><?php _e( \"Acent Color\", $textdomain ); ?></label>\r\n\t \t\t\t\t<br/>\r\n\t \t\t\t\t<label for=\"term_meta[work_color]\"><?php _e( \"If you choose to show work categories on work page instead of works, you need to select accent color for work categorie preview\", $textdomain ); ?></label>\r\n\t \t\t\t</p>\r\n\t \t\t\t<div class=\"col-md-6\">\r\n\t\t \t\t\t<input name=\"term_meta[work_color]\" \r\n\t\t\t\t \t\ttype=\"text\" \r\n\t\t\t\t \t\tclass=\"colorPicker\"\r\n\t\t\t\t \t\tid=\"term_meta[work_color]\" \r\n\t\t\t\t \t\tvalue=\"\"\r\n\t\t\t\t \t\tdata-default-color=\"#49b4ff\">\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t<?php }",
"public function getCMSFields()\n {\n //declare var $fields\n $fields = parent::getCMSFields();\n //create Reviews Section GridField\n $fields->addFieldToTab('Root.Reviews', GridField::create(\n 'Reviews',\n 'Client Reviews',\n $this->Reviews(),\n GridFieldConfig_RecordEditor::create()\n ));\n\n return $fields;\n }",
"public function getCMSFields()\n {\n // Obtain Field Objects (from parent):\n \n $fields = parent::getCMSFields();\n \n // Create Options Fields:\n \n $fields->addFieldsToTab(\n 'Root.Options',\n [\n FieldSection::create(\n 'FeedOptions',\n $this->fieldLabel('FeedOptions'),\n [\n ToggleGroup::create(\n 'FeedEnabled',\n $this->fieldLabel('FeedEnabled'),\n [\n TextField::create(\n 'FeedTitle',\n $this->fieldLabel('FeedTitle')\n ),\n TextField::create(\n 'FeedDescription',\n $this->fieldLabel('FeedDescription')\n ),\n NumericField::create(\n 'FeedNumberOfArticles',\n $this->fieldLabel('FeedNumberOfArticles')\n )\n ]\n )\n ]\n )\n ]\n );\n \n // Answer Field Objects:\n \n return $fields;\n }",
"abstract protected function _getFeedFields();"
] | [
"0.68171626",
"0.66885823",
"0.6568583",
"0.6500657",
"0.64871895",
"0.6476785",
"0.643758",
"0.6403181",
"0.6403181",
"0.6352187",
"0.6352187",
"0.63201135",
"0.6286337",
"0.62459534",
"0.6243046",
"0.6232388",
"0.6188691",
"0.61799073",
"0.6174262",
"0.6167261",
"0.6121792",
"0.6102491",
"0.60585433",
"0.6041173",
"0.6032209",
"0.6001477",
"0.59697014",
"0.5962762",
"0.59622896",
"0.5941475",
"0.59341735",
"0.5931267",
"0.5906335",
"0.5897322",
"0.5875874",
"0.5871772",
"0.5852434",
"0.5829312",
"0.5820486",
"0.58084",
"0.57943004",
"0.5791244",
"0.57859784",
"0.5778934",
"0.5776894",
"0.5767989",
"0.5766431",
"0.5726408",
"0.57262415",
"0.57209545",
"0.57126504",
"0.5688214",
"0.5688101",
"0.56822133",
"0.56798893",
"0.5651664",
"0.5648781",
"0.5628344",
"0.56143236",
"0.5604992",
"0.560001",
"0.55907387",
"0.5590032",
"0.5584079",
"0.55820733",
"0.557542",
"0.55668473",
"0.55577636",
"0.55504376",
"0.55469054",
"0.5539602",
"0.55335355",
"0.5526991",
"0.55251527",
"0.5512996",
"0.55114555",
"0.550571",
"0.54823834",
"0.5479472",
"0.5471819",
"0.5471155",
"0.5465952",
"0.5461621",
"0.54359984",
"0.5429885",
"0.54284126",
"0.5427462",
"0.54219174",
"0.54184777",
"0.54184777",
"0.54184777",
"0.54184777",
"0.54184777",
"0.54184777",
"0.5416396",
"0.5412524",
"0.5411662",
"0.54083484",
"0.540637",
"0.53993297"
] | 0.70938337 | 0 |
Save a category and all entered translations | public function save_translation($translation, $status)
{
// -------------------------------------------
// 'publisher_category_save_start' hook
//
if (ee()->extensions->active_hook('publisher_category_save_start'))
{
$translation = ee()->extensions->call('publisher_category_save_start', $translation, $status);
}
//
// -------------------------------------------
ee()->load->model('publisher_approval_category');
// Make sure we have custom fields first, or the update below will bomb.
$has_custom_fields = ee()->db->count_all_results($this->field_table);
foreach ($translation as $cat_id => $data)
{
$qry = ee()->db->select('group_id')
->where('cat_id', $cat_id)
->get('categories');
foreach ($data as $lang_id => $fields)
{
$default_cat_data = array();
$default_field_data = array();
$publisher_data = array(
'site_id' => ee()->publisher_lib->site_id,
'group_id' => $qry->row('group_id'),
'cat_id' => $cat_id,
'publisher_lang_id' => $lang_id,
'publisher_status' => $status,
'edit_date' => ee()->localize->now,
'edit_by' => ee()->session->userdata['member_id']
);
$where = array(
'site_id' => ee()->publisher_lib->site_id,
'cat_id' => $cat_id,
'publisher_lang_id' => $lang_id,
'publisher_status' => $status,
'site_id' => ee()->publisher_lib->site_id
);
foreach ($fields as $field_name => $field_value)
{
// cat_image field saves default of 0 if there is no image. Lame.
if ($field_name == 'cat_image' AND $field_value == '')
{
$field_value = 0;
}
$publisher_data[$field_name] = $field_value;
// Grab the default fields, should be cat_name, cat_description, and cat_image
if (substr($field_name, 0, 4) == 'cat_')
{
$default_cat_data[$field_name] = $field_value;
}
else
{
$default_field_data[$field_name] = $field_value;
}
}
$result = $this->insert_or_update($this->data_table, $publisher_data, $where, 'cat_id');
// Now update the core EE category tables, but only if we save as published/open
if ($lang_id == ee()->publisher_lib->default_lang_id)
{
if ($status == PUBLISHER_STATUS_OPEN)
{
// Remove an existing approval. If its saved as open, there is nothing to approve.
ee()->publisher_approval_category->delete($cat_id, $lang_id);
// Remove publisher columns, otherwise we get an error.
unset($where['id']);
unset($where['publisher_lang_id']);
unset($where['publisher_status']);
$this->insert_or_update('categories', $default_cat_data, $where, 'cat_id');
if ($has_custom_fields && !empty($default_field_data))
{
$this->insert_or_update($this->data_table_source, $default_field_data, $where, 'cat_id');
}
}
else
{
// If the user is not a Publisher, send approvals.
ee()->publisher_approval_category->save($cat_id, $publisher_data);
}
}
// Just like entries, save as Draft if we're syncing.
if ($status == PUBLISHER_STATUS_OPEN AND ee()->publisher_setting->sync_drafts() AND !ee()->publisher_setting->disable_drafts())
{
$where['publisher_status'] = PUBLISHER_STATUS_DRAFT;
$publisher_data['publisher_status'] = PUBLISHER_STATUS_DRAFT;
$this->insert_or_update($this->data_table, $publisher_data, $where, 'cat_id');
}
if ( !$result)
{
return $result;
}
}
}
// -------------------------------------------
// 'publisher_category_save_end' hook
//
if (ee()->extensions->active_hook('publisher_category_save_end'))
{
ee()->extensions->call('publisher_category_save_end', $translation, $status);
}
//
// -------------------------------------------
return TRUE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $category = ArticleCategories::findFirstByid($id);\n if (!$category) {\n $this->flash->error(\"category does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n }\n\n $category->id = $this->request->getPost(\"id\");\n $category->name = $this->request->getPost(\"name\");\n $category->description = $this->request->getPost(\"description\");\n \n\n if (!$category->save()) {\n\n foreach ($category->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"edit\",\n \"params\" => array($category->id)\n ));\n }\n\n $this->flash->success(\"category was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"article_categories\",\n \"action\" => \"index\"\n ));\n\n }",
"public function actionCategorySave()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $saveAction = new XenForo_Phrase('iversia_faq_category_added');\n\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n if ($category_id) {\n $dw->setExistingData($category_id);\n $saveAction = new XenForo_Phrase('iversia_faq_category_edited');\n }\n $dw->bulkSet(\n array(\n 'title' => $this->_input->filterSingle('title', XenForo_Input::STRING),\n 'display_order' => $this->_input->filterSingle('display_order', XenForo_Input::UINT),\n )\n );\n $dw->save();\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n $saveAction\n );\n }",
"public function save()\n {\n $error = true;\n\n // Save the not language specific part\n $pre_save_category = new self($this->category_id, $this->clang_id);\n\n if (0 === $this->category_id || $pre_save_category !== $this) {\n $query = rex::getTablePrefix() .'d2u_linkbox_categories SET '\n .\"name = '\". addslashes($this->name) .\"' \";\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n $result = rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = !$result->hasError();\n }\n }\n\n return $error;\n }",
"public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}",
"public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}",
"function saveTranslations()\n {\n // default language set?\n if (!isset($_POST[\"default\"]))\n {\n ilUtil::sendFailure($this->lng->txt(\"msg_no_default_language\"));\n return $this->editTranslations(true);\n }\n\n // all languages set?\n if (array_key_exists(\"\",$_POST[\"lang\"]))\n {\n ilUtil::sendFailure($this->lng->txt(\"msg_no_language_selected\"));\n return $this->editTranslations(true);\n }\n\n // no single language is selected more than once?\n if (count(array_unique($_POST[\"lang\"])) < count($_POST[\"lang\"]))\n {\n ilUtil::sendFailure($this->lng->txt(\"msg_multi_language_selected\"));\n return $this->editTranslations(true);\n }\n\n // save the stuff\n $this->ilObjectOrgUnit->removeTranslations();\n foreach($_POST[\"title\"] as $k => $v)\n {\n // update object data if default\n $is_default = ($_POST[\"default\"] == $k);\n if($is_default)\n {\n $this->ilObjectOrgUnit->setTitle(ilUtil::stripSlashes($v));\n $this->ilObjectOrgUnit->setDescription(ilUtil::stripSlashes($_POST[\"desc\"][$k]));\n $this->ilObjectOrgUnit->update();\n }\n\n $this->ilObjectOrgUnit->addTranslation(\n ilUtil::stripSlashes($v),\n ilUtil::stripSlashes($_POST[\"desc\"][$k]),\n ilUtil::stripSlashes($_POST[\"lang\"][$k]),\n $is_default);\n }\n\n ilUtil::sendSuccess($this->lng->txt(\"msg_obj_modified\"), true);\n $this->ctrl->redirect($this, \"editTranslations\");\n }",
"public function ajax_save_category()\n {\n $translation = ee()->input->post('translation');\n $status = ee()->input->post('publisher_save_status');\n\n // Stop here if false or if the array is empty\n if ( !$translation || empty($translation))\n {\n ee()->publisher_helper->send_ajax_response('failure');\n }\n\n $result = ee()->publisher_category->save_translation($translation, $status);\n\n if ($result)\n {\n ee()->publisher_helper->send_ajax_response('success');\n }\n else\n {\n ee()->publisher_helper->send_ajax_response($result);\n }\n }",
"public function save()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$post\t= JRequest::get('post');\r\n\t\t$cid \t= JRequest::getVar( 'cid', array(), 'post', 'array' );\r\n\t\tJArrayHelper::toInteger($cid);\r\n\t\t\r\n\t\t$model = $this->getModel('languages');\r\n\t\t\r\n\t\tif ($model->store($cid, $post)) {\r\n\t\t\t$msg = JText::_( 'LANGUAGES_SAVED' );\r\n\t\t} else {\r\n\t\t\t$msg = JText::_( 'Error Saving Languages:' .$model->getErrors());\r\n\t\t}\r\n\r\n\t\t// Check the table in so it can be edited.... we are done with it anyway\r\n\t\t$link = 'index.php?option=com_joomfish';\r\n\t\t$this->setRedirect($link, $msg);\r\n\t}",
"public function store(Request $request)\n {\n// $this->validate($request, [\n// 'name'=>'required|max:120|unique:page_categories'\n// ]);\n\n $category = new PageCategory();\n $category->main_page_category_id = $request->input('main_page_category_id') ? :null;\n $category->save();\n\n foreach (\\Loc::getLocales() as $locale){\n\n if($request->input('name.'.$locale->code) == \"\"){\n continue;\n }\n\n $category->setActiveLocale($locale->code);\n $category->name = $request->input('name.'.$locale->code);\n $category->slug = str_slug($request->input('name.'.$locale->code));\n $category->save();\n }\n\n return redirect()->route(\"backend.page.category.edit\", ['page_category' => $category->id])->withSuccess( __('backend.save_success') );\n }",
"public function save() {\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$this->setLast_modified($date);\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql = 'update cart_categories set ';\n\t\t} else {\n\t\t\t$sql = 'insert into cart_categories set ';\n\t\t\t$this->setDate_added($date);\n\t\t}\n\t\tif (!is_null($this->getImage())) {\n\t\t\t$sql .= '`categories_image`=\"' . e($this->getImage()->getId()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getParent_id())) {\n\t\t\t$sql .= '`parent_id`=\"' . e($this->getParent_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getSort_order())) {\n\t\t\t$sql .= '`sort_order`=\"' . e($this->getSort_order()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getDate_added())) {\n\t\t\t$sql .= '`date_added`=\"' . e($this->getDate_added()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getLast_modified())) {\n\t\t\t$sql .= '`last_modified`=\"' . e($this->getLast_modified()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getStatus())) {\n\t\t\t$sql .= '`categories_status`=\"' . e($this->getStatus()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql .= 'categories_id=\"' . e($this->getId()) . '\" where categories_id=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql = trim($sql, ', ');\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t$catId = Database::singleton()->lastInsertedID();\n\t\t$new = false;\n\t\tif (is_null($this->getId())) {\n\t\t\t$this->setId($catId);\n\t\t\t$new = true;\n\t\t\t$sql = 'insert into cart_categories_description set ';\n\t\t} else {\n\t\t\t$sql = 'update cart_categories_description set ';\n\t\t}\n\t\t$sql .= '`language_id`=\"' . 1 . '\", ';\n\t\t$sql .= '`categories_name`=\"' . e($this->getName()) . '\", ';\n\t\t$sql .= '`categories_description`=\"' . e($this->getDescription()) . '\"';\n\t\t\n\t\tif ($new) {\n\t\t\t$sql .= ', `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql .= ' where `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\tself::__construct($this->getId());\n\t}",
"public function save()\n {\n $error = false;\n\n // Save the not language specific part\n $pre_save_object = new self($this->category_id, $this->clang_id);\n\n // save priority, but only if new or changed\n if ($this->priority !== $pre_save_object->priority || 0 === $this->category_id) {\n $this->setPriority();\n }\n\n if (0 === $this->category_id || $pre_save_object !== $this) {\n $query = \\rex::getTablePrefix() .'d2u_machinery_categories SET '\n .\"parent_category_id = '\". ($this->parent_category instanceof self ? $this->parent_category->category_id : 0) .\"', \"\n .\"priority = '\". $this->priority .\"', \"\n .\"pic = '\". $this->pic .\"', \"\n .\"pic_usage = '\". $this->pic_usage .\"' \";\n if (rex_plugin::get('d2u_machinery', 'export')->isAvailable()) {\n $query .= \", export_europemachinery_category_id = '\". $this->export_europemachinery_category_id .\"', \"\n .\"export_europemachinery_category_name = '\". $this->export_europemachinery_category_name .\"', \"\n .\"export_machinerypark_category_id = '\". $this->export_machinerypark_category_id .\"', \"\n .\"export_mascus_category_name = '\". $this->export_mascus_category_name .\"' \";\n }\n if (rex_plugin::get('d2u_machinery', 'machine_agitator_extension')->isAvailable()) {\n $query .= \", show_agitators = '\". $this->show_agitators .\"' \";\n }\n\n if (\\rex_addon::get('d2u_videos') instanceof rex_addon && \\rex_addon::get('d2u_videos')->isAvailable() && count($this->videos) > 0) {\n $query .= \", video_ids = '|\". implode('|', array_keys($this->videos)) .\"|' \";\n } else {\n $query .= \", video_ids = '' \";\n }\n\n if (0 === $this->category_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE category_id = '. $this->category_id;\n }\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->category_id) {\n $this->category_id = (int) $result->getLastId();\n $error = $result->hasError();\n }\n }\n\n $regenerate_urls = false;\n if (false === $error) {\n // Save the language specific part\n $pre_save_object = new self($this->category_id, $this->clang_id);\n if ($pre_save_object !== $this) {\n $query = 'REPLACE INTO '. \\rex::getTablePrefix() .'d2u_machinery_categories_lang SET '\n .\"category_id = '\". $this->category_id .\"', \"\n .\"clang_id = '\". $this->clang_id .\"', \"\n .\"name = '\". addslashes(htmlspecialchars($this->name)) .\"', \"\n .\"description = '\". addslashes(htmlspecialchars($this->description)) .\"', \"\n .\"teaser = '\". addslashes(htmlspecialchars($this->teaser)) .\"', \"\n .\"usage_area = '\". addslashes(htmlspecialchars($this->usage_area)) .\"', \"\n .\"pic_lang = '\". $this->pic_lang .\"', \"\n .\"pdfs = '\". implode(',', $this->pdfs) .\"', \"\n .\"translation_needs_update = '\". $this->translation_needs_update .\"', \"\n .'updatedate = CURRENT_TIMESTAMP, '\n .\"updateuser = '\". (\\rex::getUser() instanceof rex_user ? \\rex::getUser()->getLogin() : '') .\"' \";\n\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n $error = $result->hasError();\n\n if (!$error && $pre_save_object->name !== $this->name) {\n $regenerate_urls = true;\n }\n }\n }\n\n // Update URLs\n if ($regenerate_urls) {\n \\d2u_addon_backend_helper::generateUrlCache('category_id');\n \\d2u_addon_backend_helper::generateUrlCache('machine_id');\n if (rex_plugin::get('d2u_machinery', 'used_machines')->isAvailable()) {\n \\d2u_addon_backend_helper::generateUrlCache('used_rent_category_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_rent_machine_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_sale_category_id');\n \\d2u_addon_backend_helper::generateUrlCache('used_sale_machine_id');\n }\n }\n\n return !$error;\n }",
"public function store()\n\t{\n\t\t$description = Input::get('description'); \n\t\t$acronym = substr($description, 0, 1);\n\t\t$category = new Category(); \n\t\t$category->language_id = Input::get('language_id'); \n\t\t$category->description = $description;\n\t\t$category->acronym = $acronym;\n\t\t$category->save(); \n\t\treturn Response::json(array('success'=>'Categoria registrada exitosamente')); \n\t}",
"public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }",
"public function saveTranslations()\n {\n /** @var ActiveRecord $translationModel */\n $translationModel = new $this->translationModelClass();\n\n $data = \\Yii::$app->request->post($translationModel->formName());\n\n if (empty($data)) return;\n\n foreach ($data as $lang => $record) {\n $translation = $this->getTranslationModel($lang);\n $translation->setAttributes(ArrayHelper::merge($record, [\n $this->translationModelRelationColumn => $this->owner->getPrimaryKey(),\n $this->translationModelLangColumn => $lang,\n ]));\n\n if (!$translation->save()) {\n Toastr::warning(\\Yii::t('admin', \"Перевод на {$lang} неполный, не сохранен\"));\n }\n }\n }",
"function save(){\n\t\t// $insert_query = 'INSERT INTO tb_categories';\n\t\t// $insert_query .= ' SET ';\n\t\t// $insert_query .= ' name = \"'.$this->name.'\"';\n\n\t\t// $this->db->query($insert_query);\n\t\t\tif($this->page_id){\n\t\t\t\t$this->update();\n\t\t\t}else{\n\t\t\t\t$this->page_id = $this->db->insert(\n\t\t\t\t\t'tb_pages',\n\t\t\t\t\tarray(\t\t\t\t\t\n\t\t\t\t\t'title' => $this->title,\n\t\t\t\t\t'content' => $this->content)\n\t\t\t\t);\n\t\t\t}\n\t\t}",
"public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}",
"public function write(string $category, string $locale, array $messages): void;",
"public function ActualizarCategorias()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codcategoria\"]) or empty($_POST[\"nomcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select nomcategoria from categorias where codcategoria != ? and nomcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codcategoria\"], $_POST[\"nomcategoria\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update categorias set \"\n\t\t\t.\" nomcategoria = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codcategoria = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $nomcategoria);\n\t\t\t$stmt->bindParam(2, $codcategoria);\n\n\t\t\t$codcategoria = strip_tags(strtoupper($_POST[\"codcategoria\"]));\n\t\t\t$nomcategoria = strip_tags(strtoupper($_POST[\"nomcategoria\"]));\n\t\t\t$stmt->execute();\n\n\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\t\techo \"<span class='fa fa-check-square-o'></span> LA CATEGORIA DE PRODUCTO FUE ACTUALIZADA EXITOSAMENTE\";\n\t\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}",
"public function store(Request $request)\n {\n $languages = Language::all();\n $validate = [];\n foreach($languages as $language){\n $validate['name'.$language->abbreviation] = 'required';\n\n }\n\n $message = [];\n foreach($languages as $language){\n $message['name'.$language->abbreviation.'.required'] = 'จำเป็นต้องระบุชื่อในภาษา'.$language->name;\n\n }\n // validate the input\n $validation = Validator::make( $request->all(),$validate, $message\n );\n\n// redirect on validation error\n if ( $validation->fails() ) {\n // change below as required\n return \\Redirect::back()->withInput()->withErrors( $validation->messages() );\n }\n else {\n $categories = new NewsCategory();\n $categories->save();\n\n\n $translation = NewsCategory::findOrFail($categories->id);\n $language = Language::all();\n foreach ($language as $language){\n $categorie_translation = new NewsCategoryTranslation(['local'=>$language->abbreviation,'name'=>$request['name'.$language->abbreviation]]);\n $translation->translationSave()->save($categorie_translation);\n }\n\n\n\n\n\n\n return redirect()->route('news-categories.index')\n ->with('flash_message',\n 'เพิ่มประเภทข่าวสารเรียบร้อยแล้ว');\n\n\n\n\n }\n }",
"public function actionCreate()\n {\n $model = new Category();\n $lang = new Language;\n $lang->getNameLanguages();\n $category;\n $id;\n foreach ($lang->languages as $value) {\n if($value['shortname'] == 'en') {\n $id = $value['id'];\n }\n }\n\n if(isset($_POST['Language'])) {\n $category = $this->encode($_POST['Language']['names'], $lang->languages);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n\n foreach ($category as $cat) {\n if($cat->language_id == $id) {\n $model->name = $cat->name;\n $model->save();\n }\n }\n\n foreach ($category as $cat) {\n $cat->category_id = $model->id;\n $cat->save();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'lang' => $lang,\n ]);\n }",
"public function store(Request $request)\n {\n $this->validate($request,[\n 'name_en' => 'required|unique:category-description,name|max:255',\n 'name_ar' => 'required|unique:category-description,name|max:255',\n 'description_en' => 'required',\n 'description_ar' => 'required',\n 'slug_en' => 'required|unique:category-description,slug|max:255',\n 'slug_ar' => 'required|unique:category-description,slug|max:255',\n 'meta_title_en'=> 'required|max:255',\n 'meta_title_ar'=> 'required|max:255',\n 'image_cover'=> 'required|image',\n 'status' => 'required'\n ]);\n\n //\n $category = new Category();\n\n $dir = public_path().'/uploads/category/';\n $file = $request->file('image_cover');\n $fileName = str_random(6).'.'.$file->getClientOriginalExtension();\n $file->move($dir , $fileName);\n\n $category->image_url = $fileName;\n $category->status = $request->status ;\n $category->save();\n\n\n\n\n $languages = Language::where('status','=','1')->get();\n\n foreach ($languages as $language){\n $categoryDescription = new CategoryDescription();\n $categoryDescription->name = $request->input('name_'.$language->label);\n $categoryDescription->description = $request->input('description_'.$language->label);\n $categoryDescription->meta_title = $request->input('meta_title_'.$language->label);\n $categoryDescription->meta_description = $request->input('meta_description_'.$language->label);\n $categoryDescription->slug = $request->input('slug_'.$language->label);\n $categoryDescription->lang_id = $language->id;\n $categoryDescription->category_id = $category->id ;\n $categoryDescription->save();\n }\n session()->flash('message' , 'new category added successfully');\n return redirect()->route('categories.index');\n\n }",
"public function store(MainCategoryRequest $request)\n {\n\n try {\n\n DB::beginTransaction();\n\n //validation\n\n if (!$request->has('is_active'))\n $request->request->add(['is_active' => 0]);\n else\n $request->request->add(['is_active' => 1]);\n\n $category = Category::create($request->except('_token'));\n\n //save translations\n $category->name = $request->name;\n $category->save();\n //dd($category);\n DB::commit();\n return redirect()->route('admin.maincategories.index')->with(['success' => 'تم ألاضافة بنجاح']);\n\n\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('admin.maincategories.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n\n }",
"public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }",
"public function apply()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$post\t= JRequest::get('post');\r\n\t\t$cid \t= JRequest::getVar( 'cid', array(), 'post', 'array' );\r\n\t\tJArrayHelper::toInteger($cid);\r\n\t\t\r\n\t\t$model = $this->getModel('languages');\r\n\t\t\r\n\t\tif ($model->store($cid, $post)) {\r\n\t\t\t$msg = JText::_( 'LANGUAGES_SAVED' );\r\n\t\t} else {\r\n\t\t\t$msg = JText::_( 'ERROR_SAVING_LANGUAGES' );\r\n\t\t}\r\n\r\n\t\t// Check the table in so it can be edited.... we are done with it anyway\r\n\t\t$link = 'index.php?option=com_joomfish&task=languages.show';\r\n\t\t$this->setRedirect($link, $msg);\r\n\t}",
"public function createAction()\n {\n if (!$this->request->isPost()) {\n return $this->response->redirect('category/list');\n }\n\n $manager = $this->getDI()->get('core_category_manager');\n $form = $manager->getForm();\n\n if ($form->isValid($this->request->getPost())) {\n try {\n $manager = $this->getDI()->get('core_category_manager');\n\n //$post_data contains an array with locales as indices.\n //Ex: $post_data['translation']['en'], $post_data['translation']['gr'] etc...\n $post_data = $this->request->getPost();\n \n\n //Add category_is_active flag to the post data. \n //Along with the translations we have all the data we need to create a category\n $data = array_merge($post_data, ['category_is_active' => 1]);\n\n /*\n Example final $data array:\n $data = array(3) {\n [\"translations\"]=>\n array(2) {\n [\"en\"]=>\n array(3) {\n [\"category_translation_name\"]=>\n string(15) \"Category name 3\"\n [\"category_translation_slug\"]=>\n string(0) \"\"\n [\"category_translation_lang\"]=>\n string(2) \"en\"\n }\n [\"gr\"]=>\n array(3) {\n [\"category_translation_name\"]=>\n string(18) \"Onoma Kathgorias 3\"\n [\"category_translation_slug\"]=>\n string(0) \"\"\n [\"category_translation_lang\"]=>\n string(2) \"gr\"\n }\n }\n [\"csrf\"]=>\n string(15) \"W0jJtkHlOEwqnDm\"\n [\"category_is_active\"]=>\n int(1)\n }\n */\n $manager->create($data);\n $this->flashSession->success('Object was created successfully');\n\n return $this->response->redirect('category/list');\n } catch (\\Exception $e) {\n $this->flash->error($e->getMessage());\n\n return $this->dispatcher->forward(['action' => 'add']);\n }\n } else {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message->getMessage());\n }\n\n return $this->dispatcher->forward(['action' => 'add', 'controller' => 'category']);\n }\n }",
"function saveCat()\n {\n //update stuff\n }",
"protected function storeCategoryIntoDatabase( &$category, &$languages, $exist_meta_title, &$layout_ids, &$available_store_ids, &$url_alias_ids ) {\n\t\t$category_id = $category['category_id'];\n\t\t$image_name = $this->db->escape($category['image']);\n\t\t$parent_id = $category['parent_id'];\n\t\t$top = $category['top'];\n\t\t$top = ((strtoupper($top)==\"TRUE\") || (strtoupper($top)==\"YES\") || (strtoupper($top)==\"ENABLED\")) ? 1 : 0;\n\t\t$columns = $category['columns'];\n\t\t$sort_order = $category['sort_order'];\n\t\t$date_added = $category['date_added'];\n\t\t$date_modified = $category['date_modified'];\n\t\t$names = $category['names'];\n\t\t$descriptions = $category['descriptions'];\n\t\tif ($exist_meta_title) {\n\t\t\t$meta_titles = $category['meta_titles'];\n\t\t}\n\t\t$meta_descriptions = $category['meta_descriptions'];\n\t\t$meta_keywords = $category['meta_keywords'];\n\t\t$seo_keyword = $category['seo_keyword'];\n\t\t$store_ids = $category['store_ids'];\n\t\t$layout = $category['layout'];\n\t\t$status = $category['status'];\n\t\t$status = ((strtoupper($status)==\"TRUE\") || (strtoupper($status)==\"YES\") || (strtoupper($status)==\"ENABLED\")) ? 1 : 0;\n\n\t\t// generate and execute SQL for inserting the category\n\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category` (`category_id`, `image`, `parent_id`, `top`, `column`, `sort_order`, `date_added`, `date_modified`, `status`) VALUES \";\n\t\t$sql .= \"( $category_id, '$image_name', $parent_id, $top, $columns, $sort_order, \";\n\t\t$sql .= ($date_added=='NOW()') ? \"$date_added,\" : \"'$date_added',\";\n\t\t$sql .= ($date_modified=='NOW()') ? \"$date_modified,\" : \"'$date_modified',\";\n\t\t$sql .= \" $status);\";\n\t\t$this->db->query( $sql );\n\t\tforeach ($languages as $language) {\n\t\t\t$language_code = $language['code'];\n\t\t\t$language_id = $language['language_id'];\n\t\t\t$name = isset($names[$language_code]) ? $this->db->escape($names[$language_code]) : '';\n\t\t\t$description = isset($descriptions[$language_code]) ? $this->db->escape($descriptions[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$meta_title = isset($meta_titles[$language_code]) ? $this->db->escape($meta_titles[$language_code]) : '';\n\t\t\t}\n\t\t\t$meta_description = isset($meta_descriptions[$language_code]) ? $this->db->escape($meta_descriptions[$language_code]) : '';\n\t\t\t$meta_keyword = isset($meta_keywords[$language_code]) ? $this->db->escape($meta_keywords[$language_code]) : '';\n\t\t\tif ($exist_meta_title) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_title`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_title', '$meta_description', '$meta_keyword' );\";\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_description` (`category_id`, `language_id`, `name`, `description`, `meta_description`, `meta_keyword`) VALUES \";\n\t\t\t\t$sql .= \"( $category_id, $language_id, '$name', '$description', '$meta_description', '$meta_keyword' );\";\n\t\t\t}\n\t\t\t$this->db->query( $sql );\n\t\t}\n\t\tif ($seo_keyword) {\n\t\t\tif (isset($url_alias_ids[$category_id])) {\n\t\t\t\t$url_alias_id = $url_alias_ids[$category_id];\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`url_alias_id`,`query`,`keyword`) VALUES ($url_alias_id,'category_id=$category_id','$seo_keyword');\";\n\t\t\t\tunset($url_alias_ids[$category_id]);\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"url_alias` (`query`,`keyword`) VALUES ('category_id=$category_id','$seo_keyword');\";\n\t\t\t}\n\t\t\t$this->db->query($sql);\n\t\t}\n\t\tforeach ($store_ids as $store_id) {\n\t\t\tif (in_array((int)$store_id,$available_store_ids)) {\n\t\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_store` (`category_id`,`store_id`) VALUES ($category_id,$store_id);\";\n\t\t\t\t$this->db->query($sql);\n\t\t\t}\n\t\t}\n\t\t$layouts = array();\n\t\tforeach ($layout as $layout_part) {\n\t\t\t$next_layout = explode(':',$layout_part);\n\t\t\tif ($next_layout===false) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t} else if (count($next_layout)==1) {\n\t\t\t\t$next_layout = array( 0, $layout_part );\n\t\t\t}\n\t\t\tif ( (count($next_layout)==2) && (in_array((int)$next_layout[0],$available_store_ids)) && (is_string($next_layout[1])) ) {\n\t\t\t\t$store_id = (int)$next_layout[0];\n\t\t\t\t$layout_name = $next_layout[1];\n\t\t\t\tif (isset($layout_ids[$layout_name])) {\n\t\t\t\t\t$layout_id = (int)$layout_ids[$layout_name];\n\t\t\t\t\tif (!isset($layouts[$store_id])) {\n\t\t\t\t\t\t$layouts[$store_id] = $layout_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($layouts as $store_id => $layout_id) {\n\t\t\t$sql = \"INSERT INTO `\".DB_PREFIX.\"category_to_layout` (`category_id`,`store_id`,`layout_id`) VALUES ($category_id,$store_id,$layout_id);\";\n\t\t\t$this->db->query($sql);\n\t\t}\n\t}",
"public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }",
"function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}",
"public function update(Request $request, DrugCategory $drugCategory)\n {\n $title_eng = $request->input('title_eng');\n $title_rus = $request->input('title_rus');\n $title_kaz = $request->input('title_kaz');\n if ($title_eng == null and $title_rus == null and $title_kaz == null){\n return redirect()->route('drug_categories.edit')->with('error','You must fill in at least one language!!!');\n }\n else{\n $drugCatLanguages = DrugCategoryLanguage::all()->where('drug_category_id',$drugCategory->id);\n if($title_eng != null){\n if ($drugCatLanguages->where('language',1)->first() == null) {\n $langEng = new DrugCategoryLanguage();\n $langEng->language = 1;\n $langEng->title = $title_eng;\n $langEng->drug_category()->associate($drugCategory);\n $langEng->save();\n }\n else{\n $drugCatLanguages->where('language',1)->first()->title = $title_eng;\n $drugCatLanguages->where('language',1)->first()->save();\n }\n }\n\n if($title_rus != null){\n if ($drugCatLanguages->where('language',2)->first() == null) {\n $langRus = new DrugCategoryLanguage();\n $langRus->language = 2;\n $langRus->title = $title_rus;\n $langRus->drug_category()->associate($drugCategory);\n $langRus->save();\n }\n else{\n $drugCatLanguages->where('language',2)->first()->title = $title_rus;\n $drugCatLanguages->where('language',2)->first()->save();\n }\n }\n\n if($title_kaz != null){\n if ($drugCatLanguages->where('language',3)->first() == null) {\n $langKaz = new DrugCategoryLanguage();\n $langKaz->language = 3;\n $langKaz->title = $title_kaz;\n $langKaz->drug_category()->associate($drugCategory);\n $langKaz->save();\n }\n else{\n $drugCatLanguages->where('language',3)->first()->title = $title_kaz;\n $drugCatLanguages->where('language',3)->first()->save();\n }\n }\n return redirect()->route('drug_categories.index')->with('success','DrugCategory is updated.');\n }\n }",
"public function SaveGroupCategory() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstGroup) $this->objGroupCategory->GroupId = $this->lstGroup->SelectedValue;\n\t\t\t\tif ($this->calDateRefreshed) $this->objGroupCategory->DateRefreshed = $this->calDateRefreshed->DateTime;\n\t\t\t\tif ($this->txtProcessTimeMs) $this->objGroupCategory->ProcessTimeMs = $this->txtProcessTimeMs->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the GroupCategory object\n\t\t\t\t$this->objGroupCategory->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public function save()\n {\n $this->user->setCulture($this->getValue('language'));\n }",
"private function saveEntry(): void\n {\n if ($this->isHeader()) {\n $this->processHeader();\n\n return;\n }\n $this->translations->add($this->translation);\n }",
"protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }",
"public function update(Request $request, PageCategory $category)\n {\n// $this->validate($request, [\n// 'name'=>'required|max:120|unique:page_categories,id,' . $category->id,\n// ]);\n\n $category->main_page_category_id = $request->input('main_page_category_id') ? :null;\n $category->save();\n\n foreach (\\Loc::getLocales() as $locale){\n\n if($request->input('name.'.$locale->code) == \"\"){\n continue;\n }\n\n $category->setActiveLocale($locale->code);\n $category->name = $request->input('name.'.$locale->code);\n $category->slug = str_slug($request->input('name.'.$locale->code));\n $category->save();\n }\n\n return redirect()->route(\"backend.page.category.edit\", ['page_category' => $category->id])->withSuccess( __('backend.save_success') );\n }",
"public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'name.*' => 'required|distinct',\n 'name' => 'unique:news_category_translations',\n 'meta_keywords.*' => 'required|distinct',\n 'meta_keywords' => 'required|unique:news_translations',\n 'meta_description.*' => 'required|distinct',\n 'meta_description' => 'required|unique:news_translations',\n ]);\n\n $newsCategory = NewsCategory::create(['parent_id'=>$request->parent_id]);\n\n $intCount = count($request->language_code);\n\n for ($i=0; $i < $intCount; $i++) {\n $strName = $request->name[$i];\n $strCode = $request->language_code[$i];\n $strMetaKey = $request->meta_keywords[$i];\n $strMetaDesc = $request->meta_description[$i];\n\n $newsCategory->categoryTranslate()->create(['language_code'=>$strCode, 'name'=>$strName, 'meta_keywords'=>$strMetaKey, 'meta_description'=>$strMetaDesc]);\n }\n\n return redirect('admin/news-category')->with('flash_message', 'NewsCategory added!');\n }",
"public function store(Request $request)\n {\n $alllangs = config('app.all_langs');\n $eqid = uniqid('CAT', true);\n\n $rowRules = [];\n foreach ($alllangs as $lang) {\n $langRules = [\n 'category_'.$lang => 'required'\n ];\n $rowRules = array_merge($rowRules, $langRules);\n }\n $this->validate($request, $rowRules);\n foreach ($alllangs as $lang) {\n $slug = str_replace(' ','-',strtolower($request->{'category_'.$lang}));\n $data = [];\n $data['category'] = $request->{'category_'.$lang};\n $data['type'] = 'product';\n $data['slug'] = $slug;\n $data['lang'] = $lang;\n $data['equal_id'] = $eqid;\n ${'category_'.$lang} = Category::create($data);\n }\n \\Session::flash('notification', ['level' => 'success', 'message' => 'Category '.${'category_'.config('app.default_locale')}->category. ' saved.']);\n return redirect()->route('config.product.index');\n }",
"private function save(): void\n {\n foreach ($this->dataToSave as $file => $data) {\n $this->langFilesManager->fillKeys($file, $data);\n }\n }",
"public function store(Request $request)\n {\n\n $this->validate($request, [\n 'translations.*.name' => 'required|max:255'\n ]);\n //create category image path if isset or attach default no-image\n if($request->hasFile('image')){\n $image = $request->image;\n $imageName = time() . '_' .$request->image->getClientOriginalName().'.png';\n $image->move('images/categories', $imageName);\n $imagePath = '/images/categories/'.$imageName;\n }else {\n $imagePath = '/images/categories/no_image.png';\n }\n //save new category with image path and translations fields\n $category = Category::create();\n $category->fill(['image'=>$imagePath]);\n $category->fill($request->translations);\n $category->save();\n return redirect(route('product-categories.index'))->with('success', \"The category <strong>$category->name</strong> has successfully been created.\");\n }",
"public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }",
"public function store()\n {\n $rules = [\n 'name'=>'required|max:80',\n\n ];\n $data = $this->validate(request(),$rules,[],[\n 'name'=>trans('admin.name'),\n\n ]);\n\t\t\n Category::create($data); \n\n session()->flash('success',trans('admin.added'));\n return redirect(aurl('categories'));\n }",
"public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }",
"public function postStore()\n\t{\n\t\t$response['status'] = 'error';\n\t\t$response['message'] = trans('categories.not_created');\n\n\t\tif ( ! empty($_POST))\n\t\t{\n\t\t\t$error = FALSE;\n\n\t\t\tif (empty(trim(Input::get('title'))))\n\t\t\t{\n\t\t\t\t$response['message'] = trans('categories.title_required');\n\t\t\t\t$error = TRUE;\n\t\t\t}\n\n\t\t\t$category_level = Input::get('level');\n\t\t\t$parent = Input::get('parent');\n\t\t\tif ( ! empty($category_level) && in_array($category_level, ['1', '2']))\n\t\t\t{\n\t\t\t\tif (empty($parent))\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.parent_required');\n\t\t\t\t\t$error = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($error === FALSE)\n\t\t\t{\n\t\t\t\t$data = [\n\t\t\t\t\t'title' => trim(Input::get('title')),\n\t\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t\t'level' => $category_level,\n\t\t\t\t\t'parent' => $parent,\n\t\t\t\t\t'size_group' => Input::get('size_group'),\n\t\t\t\t\t'position' => Input::get('position'),\n\t\t\t\t\t'visible' => Input::get('visible'),\n\t\t\t\t\t'active' => Input::get('active'),\n\t\t\t\t\t'page_title' => Input::get('page_title'),\n\t\t\t\t\t'meta_description' => Input::get('meta_description'),\n\t\t\t\t\t'meta_keywords' => Input::get('meta_keywords'),\n\t\t\t\t];\n\n\t\t\t\tif (($id = Model_Categories::createCategory($data)) > 0)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//Manage Friendly URL\n\t\t\t\t\t\tModel_Categories::setURL($id, Input::get('friendly_url'));\n\n\t\t\t\t\t\t$response['status'] = 'success';\n\t\t\t\t\t\t$response['message'] = trans('categories.created');\n\t\t\t\t\t\t$response['category_id'] = $id;\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response['message'] = $e;\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$response['message'] = trans('categories.not_created');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json($response);\n\t}",
"public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}",
"private function saveTranslateConfig(){\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$lang_id \t= JRequest::getInt( 'lang_id',0 );\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$language = $model->getTable('JFLanguage');\t\t\r\n\t\t$language->load($lang_id);\r\n\r\n\t\tif (is_null($lang_id) || !isset($language->id) || $language->id<=0){\r\n\t\t\tdie( 'Invalid Language Id' );\r\n\t\t}\r\n\t\t\r\n\t\t$data = array();\r\n\t\tforeach ($_REQUEST as $key=>$val) {\r\n\t\t\tif (strpos($key,\"trans_\")===0){\r\n\t\t\t\t$key = str_replace(\"trans_\",\"\",$key);\r\n\t\t\t\tif (ini_get('magic_quotes_gpc')) {\r\n \t\t $val = stripslashes($val);\r\n \t\t} \r\n \t\t$data[$key]=$val;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$registry = new JRegistry();\r\n\t\t$registry->loadArray($data);\r\n\t\t$language->params = $registry->toString();\r\n\r\n\t\t$language->store();\r\n\t\tJFactory::getApplication()->redirect(\"index.php?option=com_joomfish&task=languages.show\",JText::_( 'LANGUAGES_SAVED' ));\r\n\t}",
"public function store(Request $request)\n {\n $request->validate([\n 'ru_title' => 'required|max:255',\n ]);\n\n $category = $this->handbookCategoryRepository->store($request);\n $categoryMeta = $category->createMetaInformation();\n auth()->user()->addHistoryItem('category.create', $categoryMeta);\n if ($request->has('saveQuit'))\n {\n $parent = $category->getParentId();\n if ($parent != null)\n return redirect()->route('admin.categories.show', $parent);\n else\n return redirect()->route('admin.categories.index');\n }\n else\n return redirect()->route('admin.categories.create');\n }",
"public function store()\n\t{\n\n\t\t$input = Input::all();\n\t\t$v = Validator::make($input, Translation::$rules);\n\t\tif ($v->passes()) {\n\t\t\t$translation = new Translation();\n\t\t\t$translation->label = $_POST['label'];\n\t\t\t$translation->description = $_POST['description'];\n\t\t\t$translation->de = $_POST['de'];\n\t\t\t$translation->en = $_POST['en'];\n\t\t\t$translation->fr = $_POST['fr'];\n\t\t\tif ($translation->save()) {\n\n\t\t\t\treturn Redirect::route('translation_add')->with('success', 'The translation Created successfully');\n\t\t\t}\n\t\t}\n\t\telse {\n\n\t\t\treturn Redirect::route(\"translation_add\")->with('error', 'The translations already exists!!!');\n\t\t}\n\t}",
"public function store(CategoryRequest $request)\n {\n $cate = new Category;\n $cate->name = $request->txtCateName;\n $cate->alias = changeTitle($request->txtCateName);\n $cate->order = $request->txtOrder;\n $cate->parent_id = $request->sltParent;\n $cate->keywords = $request->txtKeywords;\n $cate->description = $request->txtDesc;\n $cate ->save();\n return redirect()->route('categorys.create')->with('add','Thêm danh mục mới thành công');\n\n }",
"public function store($categoria)\n {\n $this->db->insert('categorias', $categoria);\n }",
"public function store()\n\t{\n\t\t$category = new Category(\\Input::except(['options, image']));\n\t\tif (!$category->save()) {\n\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t}\n\n\t\tif (\\Input::file('image')) {\n\t\t\tif (!$category->uploadImage(\\Input::file('image'), 'image')) {\n\t\t\t\t$category->delete();\n\t\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t\t}\n\t\t}\n\n\t\tif (\\Input::file('image_desc')) {\n\t\t\tif (!$category->uploadImage(\\Input::file('image_desc'), 'image_desc')) {\n\t\t\t\t$category->delete();\n\t\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t\t}\n\t\t}\n\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entity_created') .\n\t\t ' <a href=\"' . \\URL::Route('manager.catalog.categories.edit', ['id' => $category->id]) . '\">' . \\Lang::get('buttons.edit') . '</a>');\n\t\treturn \\Redirect::route('manager.catalog.categories.index');\n\t}",
"function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}",
"public function store(Request $request)\n {\n //Validating title and body field\n $this->validate($request, [\n 'category'=>'required|max:100',\n ]);\n\n $category = $request['category'];\n $inputcategory = Category::create($request->only('title'));\n \n //Display a successful message upon save\n return redirect()->route('category.index')\n ->with('flash_message', 'Article,\n '. $post->title.' created');\n }",
"public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }",
"public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'category_name_en' => 'required|unique:postcategories|max:55',\n ],\n [\n 'category_name_en' => 'The category name field is required (English)',\n ]\n );\n\n $category = new Postcategory();\n $category->category_name_en = $request->category_name_en;\n $category->category_name_bn = $request->category_name_bn;\n $category->save();\n $notification=array(\n 'messege'=>'Category successfully added.',\n 'alert-type'=>'success'\n );\n return redirect()->route('admin.post.category')->with($notification);\n }",
"public function store(StoreCategoryRequest $request)\n {\n\n// $locale = $request->headers->get('accept_language');\n// app()->setLocale($locale);\n \\DB::beginTransaction();\n\n try {\n $artist = new Artist();\n\n $translations = [\n 'en' => $request->name['en'],\n 'fa' => $request->name['fa'],\n ];\n\n $artist->setTranslations('name', $translations);\n\n $artist->fill($request->all());\n $artist->save();\n\n \\DB::commit();\n return [\n 'success' => true,\n 'message' => trans('responses.panel.music.message.store'),\n ];\n }catch (\\Exception $exception){\n \\DB::rollBack();\n\n return [\n 'success' => false,\n 'message' => $exception->getMessage(),\n ];\n }\n }",
"public function save()\r\n {\r\n $this->checkIfDemo();\r\n $this->form_validation->set_rules('title', 'Title', 'trim|required|min_length[2]|max_length[50]');\r\n\r\n $edit = $this->xssCleanInput('interview_category_id') ? $this->xssCleanInput('interview_category_id') : false;\r\n\r\n if ($this->form_validation->run() === FALSE) {\r\n echo json_encode(array(\r\n 'success' => 'false',\r\n 'messages' => $this->ajaxErrorMessage(array('error' => validation_errors()))\r\n ));\r\n } elseif ($this->AdminInterviewCategoryModel->valueExist('title', $this->xssCleanInput('title'), $edit)) {\r\n echo json_encode(array(\r\n 'success' => 'false',\r\n 'messages' => $this->ajaxErrorMessage(array('error' => lang('interview_category_already_exist')))\r\n ));\r\n } else {\r\n $this->AdminInterviewCategoryModel->store($edit);\r\n echo json_encode(array(\r\n 'success' => 'true',\r\n 'messages' => $this->ajaxErrorMessage(array('success' => lang('interview_category') . ($edit ? lang('updated') : lang('created'))))\r\n ));\r\n }\r\n }",
"function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }",
"public function saveCategory(Request $request)\n {\n $request->validate([\n \"categoryName\" => \"required|min:3|max:255\"\n ]);\n //Usa o método de salvar da model, e retorna bool para mostra de resultado\n if(CategoryModel::addCategory($request))\n {\n return view('layout.item.addType.result', [\n \"result\" => true,\n \"message\" => \"Categoria adicionada com sucesso!\"\n ]);\n }\n else\n {\n return view('layout.item.addType.result', [\n \"result\" => false,\n \"message\" => \"Falha na adição de categoria!\"\n ]);\n }\n }",
"public function store(CategoryRequest $request)\n {\n $category_id = categories::insertGetId([\n 'name' => $request->name,\n 'description' => $request->description,\n 'created_at' => Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon::now()->toDateTimeString()\n ]);\n\n //lay du lieu category va luu lai\n $category_data = categories::findOrFail($category_id);\n\n // $category->save();\n return back()->with('thongbao','Lưu Dữ Liệu Thành Công');\n }",
"public function store(Request $request)\n {\n if($request->input('slug')){\n $request->merge(['slug'=>make_slug($request->input('slug'))]);\n }else{\n $request->merge(['slug'=>make_slug($request->input('name'))]);\n }\n\n $validator = Validator::make($request->all() , [\n 'name'=>'required ',\n 'slug' => 'unique:categories',\n ],[\n 'name.required' => 'لطفا نام دسته بندی را وارد کنید',\n 'slug.unique'=>' نام مستعار دسته بندی باید یکتا باشد.',\n ]);\n if($validator->fails()) {\n return back()->withErrors($validator)->withInput();\n }\n $category=new Category();\n $category->name=$request->name;\n if($request->slug){\n $category->slug =make_slug($request->slug);\n }else{\n $category->slug =make_slug($request->name);\n }\n $category->parent_id = $request->parent_id;\n $category->save();\n Session::flash('success','دسته بندی با موفقیت ثبت گردید.');\n return redirect()->route('category.index');\n }",
"function wlms_book_categories_save()\n{\n global $wpdb;\n $name = \"\";\n \n $name = trim( $_POST['wlms_book_categories_name'] );\n $errors = array();\n\n if (strlen($name) == 0)\n {\n array_push( $errors, \"book_cat\" );\n }\n\n\n if( count($errors) == 0 )\n {\n $nonce = $_REQUEST['_wpnonce'];\n if ( ! wp_verify_nonce( $nonce, 'submit_books_categories' ) ) \n {\n exit; \n }\n\n // books categories save\n $id = 0;\n if(isset ($_POST['wlms_save_book_categories']))\n {\n $wpdb->query( $wpdb->prepare( \n \"\n INSERT INTO {$wpdb->prefix}wlms_book_categories\n ( name, status )\n VALUES ( %s, %d )\n \", \n array(\n $_POST['wlms_book_categories_name'], \n $_POST['wlms_book_cat_status']\n ) \n ) );\n \n $id = $wpdb->insert_id;\n set_message_key('item_saved', 'saved');\n }\n \n \n //update books categories\n if(isset ($_POST['wlms_update_book_categories']))\n {\n $request_id = 0;\n if ( is_numeric( $_GET['update_id'] ) ) {\n $request_id = absint( $_GET['update_id'] );\n $id = $request_id;\n }\n \n $wpdb->query(\n $wpdb->prepare(\n \"UPDATE {$wpdb->prefix}wlms_book_categories SET name = %s, status = %d WHERE id= %d\",\n $_POST['wlms_book_categories_name'], $_POST['wlms_book_cat_status'], $request_id\n )\n );\n \n set_message_key('item_updated', 'updated');\n }\n \n \n wp_redirect( esc_url_raw( add_query_arg( array( 'update_id' => $id ), admin_url( 'admin.php?page=wlms-pages&wlms-tab=wlms-book-categories&manage=add-book-categories' ) ) ) ); exit;\n }\n \n}",
"public function saved(Category $category)\n {\n // Removing Entries from the Cache\n $this->clearCache($category);\n }",
"public function store(Request $request)\n {\n $title_eng = $request->input('title_eng');\n $title_rus = $request->input('title_rus');\n $title_kaz = $request->input('title_kaz');\n if ($title_eng == null and $title_rus == null and $title_kaz == null){\n return redirect()->route('drug_categories.create')->with('error','You must fill in at least one language!!!');\n }\n else{\n $drugCategory = new DrugCategory();\n $drugCategory->save();\n if($title_eng != null){\n $langEng = new DrugCategoryLanguage();\n $langEng->language = 1;\n $langEng->title = $title_eng;\n $langEng->drug_category()->associate($drugCategory);\n $langEng->save();\n }\n\n if($title_rus != null){\n $langRus = new DrugCategoryLanguage();\n $langRus->language = 2;\n $langRus->title = $title_rus;\n $langRus->drug_category()->associate($drugCategory);\n $langRus->save();\n }\n\n if($title_kaz != null){\n $langKaz = new DrugCategoryLanguage();\n $langKaz->language = 3;\n $langKaz->title = $title_kaz;\n $langKaz->drug_category()->associate($drugCategory);\n $langKaz->save();\n }\n\n return redirect()->route('drug_categories.index')->with('success','DrugCategory is created.');\n }\n }",
"static public function ctractualizarCategoria(){\n if(isset($_POST[\"nombreEditar\"])){\n $datosControlador = array(\"id\"=>$_POST[\"idEditar\"],\n \"nombre\"=>$_POST[\"nombreEditar\"]);\n $respuesta = DatosCate::mdlactualizarCategoria($datosControlador,\"categorias\"); \n \n if($respuesta == \"success\"){\n echo '<script>\n\n\t\t\t\t\t\t\t\twindow.location = \"index.php?action=categorias\";\n\n\t\t\t\t\t\t\t</script>';\n } \n else{\n echo \"error\";\n } \n }\n\n }",
"public function insertCategory($cat_id, $text_de, $text_en) {\n\t\t$query = \"INSERT INTO categorie (cat_id, text_de, text_en) VALUES ('$cat_id', '$text_de', '$text_en')\";\n\t\t$this->query ( $query );\n\t}",
"function submit(){\n\t$parent_category = $this->uri->segment(4);\n\tif (!is_numeric($parent_category)){\n\t\t$parent_category = 0;\n\t}\n\n\t$this->form_validation->set_rules('category_name', 'Category Name', 'required');\n\n\tif ($this->form_validation->run() == FALSE){\n\t\t$this->create();\n\t} else {\n\n\t\t$update_id = $this->uri->segment(3);\n\n\t\tif ($update_id > 0){\n\t\t\t//This is an update\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$this->update($update_id, $data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully updated.</p>\";\n\t\t\t$parent_category = $update_id;\n\t\t} else {\n\t\t\t//Create new record\n\t\t\t$data = $this->get_data_from_post();\n\t\t\t$data['category_url'] = url_title($data['category_name']);\n\t\t\t$data['parent_category'] = $parent_category;\n\t\t\t$this->insert($data);\n\t\t\t$value = \"<p style = 'color: green;'>The category was successfully created.</p>\";\n\t\t\t$update_id = $this->get_max();\n\n\t\t\t$this->session->set_flashdata('category', $value);\n\t\t\t\n\t\t}\n\t\t//add flashdata\n\t\t$this->session->set_flashdata('category', $value);\t\n\n\t\tredirect ('store_categories/manage/'.$parent_category);\n\t\t\n\t}\n}",
"public function save($data)\n\t{\n\t $input = Factory::getApplication()->input;\n\t\tJLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR.\n\t\t\t'/components/com_categories/helpers/categories.php');\n\t\t// validate id\n\t\tif((int)$data['catid']>0)\n\t\t{\n\t\t\t$catid = CategoriesHelper::validateCategoryId\n\t\t\t\t($data['catid'], 'com_dinning_philosophers');\n\t\t\t// If catid and extension don't match, validate will return 0.\n\t\t\t// Let's create a new category to for this component.\n\t\t\tif($catid===0){\n\t\t\t $category = array();\n\t\t\t $category['id'] = $data['catid'];\n\t\t\t \n\t\t\t $categoryTable = Table::getInstance('Category');\n\t\t\t if (!$categoryTable->load($category))\n\t\t\t {\n\t\t\t $catid = 0;\n\t\t\t } else {\n\t\t\t $properties = $categoryTable->getProperties();\n\t\t\t unset($properties['id']);\n\t\t\t unset($properties['alias']);\n\t\t\t array_values($properties);\n\t\t\t // categories uses extension as an alias to identify\n\t\t\t // duplicates. Use unique extension.\n\t\t\t $properties['extension'] = 'com_dinning_philosophers';\n\t\t\t $catid = CategoriesHelper::createCategory($properties);\n\t\t\t }\n\t\t\t}\n\t\t\t$data['catid'] = $catid;\n\t\t}\n\t\t// Alter the alias for save as copy.\n\t\tif($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this-getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\t\t\tif($data['alias']==$origTable->alias)\n\t\t\t{\n\t\t\t\t$data['alias']='';\n\t\t\t}\n\t\t\t$data['published']=0;\n\t\t}\n\t\treturn parent::save($data);\n\t}",
"public function save_complaint()\n {\n $kritik = $this->input->post('kritik',TRUE);\n $saran = $this->input->post('saran',TRUE);\n $this->category_model->save_complaint($kritik,$saran);\n $this->session->set_flashdata('msg','<div class=\"alert alert-success\">Complaint Success!</div>');\n redirect('booking/complaint');\n }",
"protected function afterSave()\n {\n $arrayIngresients = array();\n $ingredientsKey = $_POST['Ing'];\n $ingredientsValue = $_POST['IngV'];\n $amountIngredients = sizeof($ingredientsKey);\n\n for($i = 0; $i < $amountIngredients; $i++){\n $arrayIngresients[] = array(\n 'ingredient_id' => $ingredientsKey[$i],\n 'total' => $ingredientsValue[$i],\n );\n }\n $arr = serialize($arrayIngresients);\n $category = Categories::model()->findByAttributes(array('section_id' => $this->id));\n if($category == null){\n $category = new Categories;\n $category->section_id = $this->id;\n $category->values = $arr;\n $category->save();\n }\n /**\n * If old records to save in DB\n */\n $arrayOldIngresients = array();\n $ingredientsOld = $_POST['IngOld'];\n if($ingredientsOld != null){\n foreach($ingredientsOld as $key => $value){\n $arrayOldIngresients[] = array(\n 'ingredient_id' => $key,\n 'total' => $value,\n );\n }\n $arrOld = serialize($arrayOldIngresients);\n $categoryOld = Categories::model()->findByAttributes(array('section_id' => $this->id));\n $categoryOld->values = $arrOld;\n $categoryOld->update(array('values'));\n }\n }",
"public function store(QuestionCategoryPost $request)\n {\n try{\n $req = $request->only('name', 'course_id', 'description');\n $this->questionCategoryRepo->store($req);\n flash('Question category added successfully!')->success();\n }catch (Exception $e){\n flash('Question category has not been added!')->error();\n }\n\n return redirect()->route('question-category.index');\n }",
"public function store(Request $request)\n {\n $data = [];\n $data['name'] = $request->get('name');\n $data['slug'] = str_slug($request->get('name'));\n $data['order'] = $request->get('order', 1);\n $data['parent_id'] = $request->get('parent_id');\n $category = Category::create( $data );\n\t\t\n\t\t$pricing_models = $request->input('pricing_models');\n\t\tif($pricing_models && is_array($pricing_models)) {\n\t\t\t$category->pricing_models()->sync($pricing_models);\n\t\t}\n\t\t$this->save_languages();\n\t\talert()->success('Successfully saved');\n return redirect()->route('panel.categories.index');\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'name_en' => 'required',\n 'description_en' => 'required',\n 'category_id' => 'required',\n ]);\n\n $requestData = $request->all();\n\n $subCategoryNumb = SubCategory::where('category_id', $requestData['category_id'])->count();\n\n isset($requestData['active']) ? $requestData['active'] = true : $requestData['active'] = false;\n\n if(!$requestData['parent_id']){\n unset($requestData['parent_id']);\n }\n\n $requestData['sequence'] = $subCategoryNumb + 1;\n\n $category = Category::findOrfail($requestData['category_id']);\n\n $category->subCategories()->create($requestData);\n\n Session::flash('flash_message', trans('admin.sub_categories.flash_messages.new'));\n\n return redirect('admin/sub-categories');\n }",
"public function store()\n\t{\n\t\t$cat = new Category;\n\n\t\t$cat->title = Input::get('title');\n\n\t\t$cat->save();\n\n\t\treturn Redirect::home();\n\t}",
"public function store(Request $request)\n {\n $cat = new Category();\n Category::validator($request->all())->validate();\n $cat->name_en = $request->input('name_en');\n $cat->name_ar = $request->input('name_ar');\n $cat->priority = ( Category::GetMaxPriority() + 1 );\n $cat->created_by = Auth::id();\n $cat->save();\n return redirect()->route('categories.index')->with('alert_sucesss','Category was added successfully');\n }",
"public function store(StoreUpdateCategoryFormRequest $request)\n {\n $this->repository->store([\n 'title' => $request->title,\n 'description' => $request->description,\n ]);\n\n return redirect()\n ->route('categories.index')\n ->withSuccess('Cadastro realizado com sucesso');\n }",
"public function store(Request $request)\n {\n // Input Validation\n $request->validate(\n [\n 'label' => 'required|max:255',\n 'category' => 'required',\n ]\n );\n\n $label = htmlspecialchars($request->label);\n $category = htmlspecialchars($request->category);\n\n //check is sub category exist in DB\n if (Sub_category::where('sub_category_label', htmlspecialchars($label))->where('sub_category_category_id', htmlspecialchars($category))->count() > 0) {\n\n //Flash Message\n flash_alert(\n __('alert.icon_error'), //Icon\n 'Gagal', //Alert Message \n 'Sub Category Already Exist' //Sub Alert Message\n );\n\n return redirect()->route('sub_category_create');\n }\n\n $sub_category_id = uniqid() . strtotime(now());\n\n $data = [\n 'sub_category_id' => $sub_category_id,\n 'sub_category_category_id' => $category,\n 'sub_category_label' => $label,\n ];\n\n //Insert Data\n Sub_category::create($data);\n\n //Flash Message\n flash_alert(\n __('alert.icon_success'), //Icon\n 'Sukses', //Alert Message \n 'Sub Category Added' //Sub Alert Message\n );\n\n return redirect()->route('sub_category');\n }",
"function saveTranslations($lang,$keyVals)\n {\n T::loadTranslations($lang);\n $l=T::$translations[$lang];\n foreach($l as $key=>$value)\n {\n if($value!=$keyVals[$key])\n {\n $m=\\getModel(\"ps_lang\\\\translations\",array(\"id_string\"=>$key,\"lang\"=>$lang));\n $m->value=$keyVals[$key];\n $m->save();\n }\n }\n }",
"public function store(Request $request){\n $category = new category();\n $category->nom = $request->input('nom');\n $category->save();\n $message='Categorie bien ajouté';\n return redirect('/admin/listecat')->withMessage($message);\n\n }",
"public function savePhrase()\n\t{\n\t\tglobal $ilUser;\n\t\tglobal $ilDB;\n\n\t\t$next_id = $ilDB->nextId('svy_phrase');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_phrase (phrase_id, title, defaultvalue, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','integer','integer'),\n\t\t\tarray($next_id, $this->title, 1, $ilUser->getId(), time())\n\t\t);\n\t\t$phrase_id = $next_id;\n\n\t\t$counter = 1;\n\t\tfor ($i = 0; $i < $this->categories->getCategoryCount(); $i++) \n\t\t{\n\t\t\t$cat = $this->categories->getCategory($i);\n\t\t\t$next_id = $ilDB->nextId('svy_category');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_category (category_id, title, defaultvalue, owner_fi, tstamp, neutral) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','text','text','integer','integer','text'),\n\t\t\t\tarray($next_id, $cat->title, 1, $ilUser->getId(), time(), $cat->neutral)\n\t\t\t);\n\t\t\t$category_id = $next_id;\n\t\t\t$next_id = $ilDB->nextId('svy_phrase_cat');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_phrase_cat (phrase_category_id, phrase_fi, category_fi, sequence) VALUES (%s, %s, %s, %s)\",\n\t\t\t\tarray('integer', 'integer', 'integer','integer'),\n\t\t\t\tarray($next_id, $phrase_id, $category_id, $counter)\n\t\t\t);\n\t\t\t$counter++;\n\t\t}\n\t}",
"function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }",
"public function store(StoreOrUpdateCategory $request)\n {\n $category = new Categories;\n $category->name = $request->input('name');\n $category->briefing = $request->input('briefing');\n\n $category->save();\n\n return redirect()->route('categories.index');\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Category::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCategory::create($data);\n\n\t\treturn Redirect::route('adm/categories');\n\n\t}",
"public function store(LanguageRequest $request)\n {\n LanguageOp::_store($request);\n toastr()->success(trans('local.saved_success'));\n return redirect()->route('languages.index');\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'ru_title' => 'required|max:255',\n ]);\n\n $category = $this->handbookCategoryRepository->store($request);\n if ($request->has('saveQuit'))\n {\n $parent = $category->getParentId();\n if ($parent != null)\n return redirect()->route('admin.categories.show', $parent);\n else\n return redirect()->route('admin.categories.index');\n }\n else\n return redirect()->route('admin.categories.create');\n }",
"public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }",
"static public function ControllerIngresarCategorias(){\n if(isset($_POST[\"nuevaCategoria\"])){//si vienen datos\n //solo datos permitidos \n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t$tabla = \"categorias\";//a la tabla categorias\n\n\t\t\t\t$datos = $_POST[\"nuevaCategoria\"];//enviamos la nueva categoria\n\n\t\t\t\t$respuesta = ModeloCategorias::ModelIngresarCategorias($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La categoría ha sido guardada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\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</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n //en caso de que vaya vacia o caracteres especiales\n echo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n }",
"public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}",
"public function store(StoreCategoriaRequest $request)\r\n {\r\n try {\r\n $categoria = new Categoria();\r\n $categoria->nombre = $request->input('nombre');\r\n $categoria->save();\r\n } catch (\\Exception $error) {\r\n // manejar\r\n }\r\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'ru_title' => 'required|unique:blog_categories|max:255',\n ]);\n\n $this->blogCategoryRepository->store($request);\n\n if ($request->has('save'))\n return redirect()->route('admin.blogcategories.create');\n else\n return redirect()->route('admin.blogcategories.index');\n }",
"public function save_category_form( $term_id ) {\n\t\tif( $this->save_count < 1 ) :\n\n\t\t\t$id = $this->args['id'];\n\t\t\t$data = Database::get_row( $this->args['table'], 'cat_id', $term_id );\n\n\t\t\tforeach( $this->args['table']['structure'] as $name => $args ) {\n\t\t\t\t$data[$name] = isset( $_POST[$name] ) ? $_POST[$name] : $data[$name];\n\t\t\t}\n\n\t\t\tif( empty( $data['cat_id'] ) ) {\n\t\t\t\t$data['cat_id'] = $term_id;\n\t\t\t\tDatabase::insert_row( $this->args['table'], $data );\n\t\t\t} else {\n\t\t\t\tDatabase::update_row( $this->args['table'], 'cat_id', $term_id, $data );\n\t\t\t}\n\n\t\t\t$this->save_count++;\n\n\t\tendif;\n\n\t}",
"public function store(Request $request)\n {\n $id = $request->input('edit_value');\n\n if ($id == NULL) {\n $validator_array = [\n 'image' => 'required|image|mimes:jpeg,png,jpg',\n ];\n $validator = Validator::make($request->all(), $validator_array);\n if ($validator->fails()) {\n return response()->json(['success' => false, 'message' => $validator->errors()->first()]);\n }\n }\n\n $image_path = $file_name = '';\n if ($request->hasFile('image')) {\n $image_path = 'uploads/' . date('Y') . '/' . date('m');\n $files = $request->file('image');\n\n if (!File::exists(public_path() . \"/\" . $image_path)) {\n File::makeDirectory(public_path() . \"/\" . $image_path, 0777, true);\n }\n\n $extension = $files->getClientOriginalExtension();\n $destination_path = public_path() . '/' . $image_path;\n $file_name = uniqid() . '.' . $extension;\n $files->move($destination_path, $file_name);\n\n if ($id != NULL) {\n Category::where('id', $id)->update([\n 'image' => $image_path . '/' . $file_name,\n ]);\n }\n }\n\n if ($id == NULL) {\n $category_order = Category::max('id');\n $insert_id = Category::create([\n 'image' => $image_path . '/' . $file_name,\n 'category_order' => $category_order + 1,\n ]);\n $languages = Language::all();\n foreach ($languages as $language) {\n CategoryTranslation::create([\n 'name' => $request->input($language->language_code . '_name'),\n 'category_id' => $insert_id->id,\n 'locale' => $language->language_code,\n ]);\n }\n return response()->json(['success' => true, 'message' => trans('adminMessages.category_inserted')]);\n } else {\n $languages = Language::all();\n foreach ($languages as $language) {\n CategoryTranslation::updateOrCreate([\n 'category_id' => $id,\n 'locale' => $language->language_code,\n ],\n [\n 'category_id' => $id,\n 'locale' => $language->language_code,\n 'name' => $request->input($language->language_code . '_name')\n ]);\n\n }\n return response()->json(['success' => true, 'message' => trans('adminMessages.category_updated')]);\n }\n }",
"public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }",
"public function store()\n\t{\n\t\t// validate\n\t\t// read more on validation at http://laravel.com/docs/validation\n\t\t$rules = array(\n\t\t\t'title' => 'required|unique:question-categories',\n\t\t\t'order' => 'required'\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\tSession::flash('error_message', 'Validation error, please check all required fields.');\n\t\t\treturn Redirect::to('admin/question-categories/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t}\n\n\t\t// Store\n\t\t$category \t\t\t= new QuestionCategory;\n\t\t$category->title \t= Input::get('title');\n\t\t$category->slug \t= Str::slug(Input::get('title'));\n\t\t$category->order \t= Input::get('order');\n\t\t$category->created_by = Auth::user()->id;\n\n\t\t$category->save();\n\n\t\t// redirect\n\t\tSession::flash('success_message', Input::get('title') . ' category has been aded.');\n\n\t\treturn Redirect::to('admin/question-categories');\n\t}",
"public function store(CategoryRequest $request)\n {\n MenuCategories::create(['title'=>$request->name]);\n session()->flash('alert_message', ['message'=>\"Succss\", 'icon'=>'success']); \n\n return redirect('dashboard/category');\n }",
"public function saveCategory(Request $request){\n if (Category::where('name', $request->get('category'))->exists()){\n // found\n }\n else{\n $level = $request->get('parent') == ''? 1 : 2;\n if ($level == 1){\n $parent = null;\n }\n else{\n $parent = Category::where('name', $request->get('parent'))->first()->id;\n }\n Category::insert([\n 'name' => $request->get('category'),\n 'level' => $level,\n 'parent_id' => $parent,\n 'created_at' => new \\DateTime(),\n 'updated_at' => new \\DateTime()\n ]);\n }\n return redirect()->route('all-categories');\n }",
"public function store(CategoryRequest $request)\n {\n try{\n\n $us = $request->all();\n $category = new Category;\n\n $category->name = $us['name'];\n\n\n\n $category->save();\n return response('Categoria cadastrada com sucesso', 201);\n\n }catch(\\Exception $erro) {\n\n return $erro->getMessage();;\n }\n }",
"public function store(CategoryCreateRequest $request)\n {\n //v1:\n //$request->validate(['name'=>'required']); // поле обязательно к заполнению , v2: валидация в папке \\request\\CategoryCreateRequest\n\n //dd($request->all());\n //dd($request->input('name'));\n //dd($request->only('name','desc'));\n //dd($request->except('name','desc'));\n //dd($request->has('name')); //=true\n //dd($request->path());\n //dd($request->url());\n //dd($request->fullurl());\n //dd($request->query('гет парам'));\n //dd($request->get('гет парам'));\n //$newsKat[] = ['id'=>intval(array_key_last( $this->newsKat))+2,'nameKat'=>$request->input('name')];\n //print_r($this->newsKat);\n\n //v1:\n //$id = DB::table('categ')->insertGetId(['name' => $request->input('name'), 'desc' => $request->input('desc')] );\n\n /*v2:\n $id = Categ::query()->insertGetId(['name' => $request->input('name'), 'desc' => $request->input('desc')] );\n\n if (!empty($id)) {$o='сохранено ';}\n else {$o='не сохранено';}\n $o .='<br><br> <a href=\"/adminc\">Управление Категориями</a><br>' ;\n //return redirect()->route('admin');\n return response($o);\n //return response->view('view.any');\n //return response->download('file.any');\n */\n\n //v3:\n $ctg= new Categ();\n\n if($request->isMethod('post')){\n $ctg->fill($request->all());\n $ctg->save();\n return redirect()->route('adminCateg');\n }\n return view('news.admin.categ.add');\n\n }",
"public function store()\n {\n $data = \\Request::all();\n $category = CategoryService::create($data);\n \\Msg::success($category->name . ' has been <strong>added</strong>');\n return redir('account/categories');\n }",
"public function store(CategoriesStore $request)\n {\n $data = $request->only(['title']);\n $objOrder = new Category();\n\n $objOrder->title = $data['title'];\n $objOrder->slug = Str::slug($data['title']);\n\n $objOrder->save();\n\n return redirect()->route('admin')->with('success', 'Категория добавлена.');\n }"
] | [
"0.7781562",
"0.7128285",
"0.70075434",
"0.6983991",
"0.6893051",
"0.6889632",
"0.6873338",
"0.6818383",
"0.66717714",
"0.66317505",
"0.65260947",
"0.6466519",
"0.640044",
"0.6383923",
"0.63679296",
"0.63310856",
"0.63252336",
"0.6300671",
"0.6255443",
"0.62531996",
"0.6222215",
"0.6203109",
"0.61567044",
"0.61562693",
"0.6148597",
"0.6121946",
"0.61186546",
"0.6114194",
"0.6091712",
"0.60883147",
"0.60837716",
"0.60803425",
"0.6060019",
"0.60471326",
"0.6034439",
"0.60158974",
"0.5994119",
"0.5980396",
"0.5975051",
"0.59385735",
"0.5932537",
"0.5913416",
"0.59060013",
"0.58987445",
"0.5898027",
"0.58961606",
"0.5893674",
"0.58924013",
"0.5891577",
"0.58748066",
"0.58738226",
"0.58735406",
"0.5870807",
"0.5867555",
"0.586449",
"0.585863",
"0.5852609",
"0.5848998",
"0.58488137",
"0.58424246",
"0.5838365",
"0.5837216",
"0.5836721",
"0.5834278",
"0.5829342",
"0.58129305",
"0.58066857",
"0.580317",
"0.57971746",
"0.5792104",
"0.57909185",
"0.5789464",
"0.5772379",
"0.5753803",
"0.57497776",
"0.57426584",
"0.57421994",
"0.57419914",
"0.57395935",
"0.57376647",
"0.57299304",
"0.5729884",
"0.57262903",
"0.5719615",
"0.5719014",
"0.57173824",
"0.5703548",
"0.5700752",
"0.569795",
"0.5695961",
"0.56939405",
"0.5692504",
"0.56915194",
"0.56902796",
"0.5690259",
"0.5685213",
"0.5683771",
"0.567417",
"0.5672315",
"0.5672254"
] | 0.6135744 | 25 |
See if a draft exists for a requested category | public function has_draft($cat_id, $language_id = FALSE)
{
// Get by current language or a requested one?
$language_id = $language_id ?: ee()->publisher_lib->lang_id;
$where = array(
'cat_id' => $cat_id,
'publisher_status' => PUBLISHER_STATUS_DRAFT,
'publisher_lang_id' => $language_id
);
$qry = ee()->db->select('edit_date')->get_where($this->data_table, $where);
// If we have a draft, see if its newer than the open version.
if ($qry->num_rows())
{
$draft_date = $qry->row('edit_date');
$where = array(
'cat_id' => $cat_id,
'publisher_status' => PUBLISHER_STATUS_OPEN,
'publisher_lang_id' => $language_id
);
$qry = ee()->db->select('edit_date')->get_where($this->data_table, $where);
$open_date = $qry->row('edit_date') ?: 0;
if ($draft_date > $open_date)
{
return TRUE;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None')\n {\n }",
"public function cate_exists() {\n\t\t$category_name = trim($this->input->post ( 'category_name' ));\n\n\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array ( 'category_name' => trim ( $category_name ));\n\n\t\tif ($edit_id != \"\") {\n\t\t\t$where = array_merge ( $where, array ( \"category_id !=\" => $edit_id ) );\n\t\t} \n\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('cate_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function hasCategory(): bool;",
"public static function isDrafted()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$template = $app->getTemplate(true);\n\t\t$templateId = 0;\n\n\t\tif ($app->isClient('site'))\n\t\t{\n\t\t\t$templateId = $template->id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($app->input->get('option') === 'com_ajax' && $app->input->get('helix') === 'ultimate')\n\t\t\t{\n\t\t\t\t$templateId = $app->input->get('id', 0, 'INT');\n\t\t\t}\n\t\t}\n\n\t\t$draftKeyOptions = [\n\t\t\t'option' => 'com_ajax',\n\t\t\t'helix' => 'ultimate',\n\t\t\t'status' => 'draft',\n\t\t\t'id' => $templateId\n\t\t];\n\n\t\t$key = self::generateKey($draftKeyOptions);\n\t\t$cache = new HelixCache($key);\n\n\t\treturn $cache->contains();\n\t}",
"public function isCategory($category): bool;",
"public function isDraft();",
"public function isDraft();",
"public function isDraft();",
"public function isNewCategory(): bool {\n return !$this->category->exists;\n }",
"public function draftsExists($page_id) {\n\t\t// Build the MindTouch API URL to check a draft's existence.\n\t\t$url = $this->draftsUrl($page_id);\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\tif ((string) $output['state'] === 'active' \n\t\t\t|| (string) $output['state'] === 'unpublished'\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasDrafts(): bool\n {\n return $this->drafts()->count() > 0;\n }",
"function categoryAssociationExists($monographId, $categoryId) {\n\t\t$result = $this->retrieve(\n\t\t\t'SELECT COUNT(*) FROM submission_categories WHERE submission_id = ? AND category_id = ?',\n\t\t\tarray((int) $monographId, (int) $categoryId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] == 1 ? true : false;\n\n\t\t$result->Close();\n\t\treturn $returner;\n\t}",
"function has_category($category = '', $post = \\null)\n {\n }",
"function categoryExists($cat) { // Return true if the given category exists\n\t$cat = dbEscape($cat);\n\treturn(dbResultExists(\"SELECT * FROM categories WHERE name='$cat'\"));\n}",
"public function isDraft()\n {\n return $this->publish_status == Status::DRAFT;\n }",
"public function cat_match($category){\n\n\t\t\t$sql = mysql_query(\"SELECT * FROM `categories` WHERE `cat` = '$category'\");\n\n\t\t\t$count_query = mysql_num_rows($sql);\n\n\t\t\t\tif ($count_query == 0) {\n\t\t\t\t\t# code...\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t}",
"function dialogue_contains_draft_files($draftid) {\n global $USER;\n\n $usercontext = \\context_user::instance($USER->id);\n $fs = get_file_storage();\n\n $draftfiles = $fs->get_area_files($usercontext->id, 'user', 'draft', $draftid, 'id');\n\n return (count($draftfiles) > 1) ? true : false;\n}",
"function feed_category_term_access($feed_category_term) {\r\n global $user;\r\n \r\n if (isset($feed_category_term->uid) && $feed_category_term->uid == $user->uid) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category_term->fcid) && $feed_category = feed_category_load($feed_category_term->fcid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}",
"public function isDraft()\n {\n return $this->isInStatus($this::DRAFT);\n }",
"private function hasDraft(&$Model, $id) {\r\n\t\treturn $Model->DraftModel->find('count', array(\r\n\t\t\t\t'conditions' => array($Model->primaryKey => $id)));\r\n\t}",
"public function isDraft()\n {\n return ($this->getData('draft')) ? true : false;\n }",
"public function hasCreatedFromDraftId()\n {\n return $this->CreatedFromDraftId !== null;\n }",
"function post_exists($title, $content = '', $date = '', $type = '', $status = '')\n {\n }",
"public static function exists($id,$future,$draft) {\n global $manager;\n\n $id = intval($id);\n\n $sql = 'SELECT count(*) AS result FROM '.sql_table('item').' WHERE inumber='.$id;\n if (!$future) {\n $bid = getBlogIDFromItemID($id);\n if (!$bid) return 0;\n $b =& $manager->getBlog($bid);\n $sql .= ' AND itime<='.mysqldate($b->getCorrectTime());\n }\n if (!$draft) {\n $sql .= ' AND idraft=0';\n }\n $sql .= ' LIMIT 1';\n\n return (intval(quickQuery($sql)) > 0);\n }",
"public function hasCategory()\n {\n return $this->category !== null;\n }",
"public function canBeShowInCategory($categoryId)\n {\n return $this->_getResource()->canBeShowInCategory($this, $categoryId);\n }",
"public function hasCategory($categoryId) {\n\t\t$quizCategories = $this->quizCategoriesTable->find('quizId', $this->id);\n\n\t\tforeach ($quizCategories as $quizCategory) {\n\t\t\tif ($quizCategory->categoryId == $categoryId) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public function category_exists() {\n\t\t$users_name = trim($this->input->post ( 'category_name' ));\n\n\t\t$where = array ('category_name' => trim ( $users_name ));\n\t\t\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('username_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function getDraftAttribute(): bool\n {\n return $this->status_id === CampaignStatus::STATUS_DRAFT;\n }",
"public function checkCategoryExist($ssCategory)\n {\n try\n {\n return Doctrine_Query::create()\n ->select(\"MU.*\")\n ->from(\"Model_Category MU\")\n ->where(\"MU.category_name =?\",$ssCategory)\n ->fetchArray();\n }\n catch( Exception $e )\n {\n echo $e->getMessage();\n return false;\n }\n }",
"public function hasIsDraft()\n {\n return $this->IsDraft !== null;\n }",
"public function isDraft() {\n return $this->state === self::STATUS_DRAFT;\n }",
"public function authorize()\n {\n return PrivateCategory::where([\n ['owner_id', '=', Auth::user()->id],\n ['id', '=', $this->category_id],\n ])->exists();\n }",
"function isOpen($cat) {\n global $GLOBAL;\n\tif($GLOBAL['category']==$cat) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function in_project($post_id) {\n $categories = get_the_category($post_id);\n $project = get_category_by_slug('project');\n\n foreach($categories as $category) {\n if($category->category_parent == $project->term_id) {\n return TRUE;\n }\n }\n\n return FALSE;\n}",
"public function existCategorie($categories){\n\t\t\n\t\tglobal $wpdb;\n\n\t\t$ok = 0;\n\t\t\n\t\tif(!empty($categories))\n\t\t{\n\t\t\tforeach($categories as $cat)\n\t\t\t{ \n\t\t\t\t$category = $this->utils->cleanString($cat);\n\t\t\t\t\n\t\t\t\t$result = $this->findCategory($category);\n\t\t\t\t\n\t\t\t\tif( !$result )\n\t\t\t\t{\n\t\t\t\t\t$this->insertCategory($category);\n\t\t\t\t}\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t \n\t\treturn true;\n\t}",
"function category_exists($cat_name, $category_parent = \\null)\n {\n }",
"private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }",
"function have_category() {\n global $categories_index, $discussion, $categories, $categories_count;\n\n $categories_count = count(get_categories());\n $categories = get_categories();\n\n if ($categories && $categories_index + 1 <= $categories_count) {\n $categories_index++;\n return true;\n } else {\n $categories_count = 0;\n return false;\n }\n}",
"public static function existsCategory($category) {\n $n = self::where('name', '=', $category)->where('parent_category_id', '=', 17)->count();\n return $n>0;\n }",
"public static function exists($categoryID) {\n\t\treturn self::isValid(self::findById($categoryID));\n\t}",
"public function hasCustomerStreamEmotions($categoryId);",
"function does_exists($id, $type) {\n\n global $course_id;\n switch ($type) {\n case 'forum':\n $sql = Database::get()->querySingle(\"SELECT id FROM forum\n WHERE id = ?d\n AND course_id = ?d\", $id, $course_id);\n break;\n case 'topic':\n $sql = Database::get()->querySingle(\"SELECT id FROM forum_topic\n WHERE id = ?d\", $id);\n break;\n }\n if (!$sql) {\n return 0;\n } else {\n return 1;\n }\n}",
"public function isNotDraft()\n {\n return ! $this->isDraft();\n }",
"function feed_category_access($allow_public = FALSE, $feed_category) {\r\n global $user;\r\n \r\n if ($allow_public && $feed_category->is_public) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category->uid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}",
"function has_categorys()\n\t{\n\t\t\t$categorias = $this->combofiller->categorias();\t\t\t\n\t\t\tforeach($categorias as $key => $value)\n\t\t\t{\n\t\t\t\tif ($this->input->post('' . $key . ''))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn FALSE;\t\n\t}",
"public function is_category($category = '')\n {\n }",
"public function getDraft() : bool\n {\n return $this->draft;\n }",
"public function checkExistCampaign()\r\n\t{\r\n\t $campaignTable = Engine_Api::_()->getDbtable('campaigns', 'ynfundraising');\r\n\t $select = $campaignTable->select()\r\n\t ->where('parent_id = ?', $this->trophy_id)\r\n\t ->where('parent_type = ?', 'trophy')\r\n\t\t->where(\"status IN ('draft','ongoing')\")\r\n\t ->limit(1);\r\n\t $row = $campaignTable->fetchRow($select);\r\n\t\treturn $row;\r\n\t}",
"public function isValidCat($cat){\r\n \treturn isset($this->categories[$cat]); \r\n\t}",
"public function thisTopicWasAlreadyExisted():bool\n {\n \t$column = $this->topic->getColumn();\n\t\t$tableName = $this->topic->getTableName();\n\t\t$columIdSubCat = 'id_sub_category';\n\n\t\t$is_exist = (int)(new Requestor())->getContentWith2Where('id', 'f_topics', 'content', $this->topic->getContent(), 'id_sub_category', $this->topic->getIdSubCategory());\n\n\t\tif ($is_exist > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n }",
"public function categoryExists($categoryID) {\n\t\t$this->load->model('BreweriesModel', '', true);\n\t\t// get the brewery information\n\t\t$rs = $this->BreweriesModel->getCategoryCheck($categoryID);\n\t\t// check if it really exists\n\t\t$boolean = count($rs) > 0 ? true : false;\n\t\t// check the boolean\n\t\tif($boolean === false) {\n\t\t\t$this->form_validation->set_message('categoryExists', 'The %s you have chosen doesn\\'t exists. Please choose another.');\n\t\t}\n\t\treturn $boolean;\n\t}",
"function isCategoryExist($categoryName)\n {\n $allCategories = $this->data->getAllCategories();\n while ($category = $allCategories->fetch_assoc())\n {\n if ($category['CategoryName'] == $categoryName)\n {\n return true;\n }\n }\n return false;\n }",
"public function isCategoryPage();",
"abstract public function exists($blogPostId);",
"public function isReadyForPurge()\n\t{\n\t\tif($this->getStatus() != CategoryStatus::DELETED)\n\t\t\treturn false;\n\t\t\t\n\t\tif($this->getMembersCount())\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getMembersCount() . \"] users\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getEntriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getEntriesCount() . \"] entries\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getDirectSubCategoriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getDirectSubCategoriesCount() . \"] sub categories\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function exists()\n {\n if (get_post($this->id)) {\n return true;\n }\n\n return false;\n }",
"public function checkcategoryid($id){\n\t\t$this->db->where('CategoryId', $id);\n\t\t$result=$this->db->get('tbl_category');\n\t\tif($result->num_rows()==1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function exists_in_feeds_posts_table() {\r\n\t\tglobal $wpdb;\r\n\t\t$table_name = $wpdb->prefix . CTF_FEEDS_POSTS_TABLE;\r\n\t\t$db_id = $this->db_id;\r\n\t\t$results = $wpdb->get_results( $wpdb->prepare( \"SELECT feed_id FROM $table_name WHERE id = %s AND feed_id = %s LIMIT 1\", $db_id, $this->feed_id ), ARRAY_A );\r\n\t\treturn isset( $results[0]['feed_id'] );\r\n\t}",
"public function isDraft() {\n return $this->getEditingStatus() != '';\n }",
"public function isValidCategory($id){\n\n $query = 'SELECT * FROM '.$this->table.' WHERE id = :id';\n $stmt = $this->conn->prepare($query);\n $stmt->bindValue(':id', $id, PDO::PARAM_STR);\n\n $stmt->execute();\n $result=$stmt->fetch(PDO::FETCH_ASSOC);\n if ($result) {\n return true;\n } else {\n return false;\n }\n }",
"private function isUserCategoryExists($ucat_name) {\n\t\t$stmt = $this->conn->prepare(\"SELECT ucat_name from user_category WHERE ucat_name = ? and (status=1 or status=2) \");\n $stmt->bind_param(\"s\", $ucat_name);\n $stmt->execute();\n\t\t$stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return !($num_rows == 0); //if no any user number of rows ==0; then get negative of it to send false\n }",
"public function isDraft() {\r\n return $this->isDraft;\r\n }",
"protected function _checkCategoryVisibility($category)\n {\n return $category && $category->getIsActive() > 0 && $category->getLevel() > 1;\n }",
"public function allDraftsCreated(): bool\n {\n if (!$this->save_as_draft) {\n return true;\n }\n\n return $this->active_subscriber_count === $this->messages()->count();\n }",
"public static function getChangeCategory($id, $categoryId)\n {\n return (bool) BackendModel::getContainer()->get('database')->getVar(\n 'SELECT i.category_id\n FROM slideshow_galleries AS i\n WHERE i.id = ? AND i.category_id = ?',\n array((int) $id, (int) $categoryId)\n );\n }",
"public function isCategoryDisplayedInPreferences( $category ) {\n\t\treturn !(\n\t\t\tisset( $this->categories[$category]['no-dismiss'] ) &&\n\t\t\tin_array( 'all', $this->categories[$category]['no-dismiss'] )\n\t\t);\n\t}",
"function postExists($id){\n return (getSingleValue(\"SELECT COUNT(`id`) FROM `public_forums_posts` WHERE `deleted` = '0' AND `id` = '\" . escape(intval($id)) . \"'\") >= 1);\n }",
"protected function _initCategory()\n {\n $category = $this->request->getPostValue('category');\n if (!$category) {\n return false;\n }\n\n try {\n $category = $this->categoryFactory->create()->loadByAttribute('url_key',$category);\n } catch (NoSuchEntityException $e) {\n return false;\n }\n\n $category->setStoreId($this->_storeManager->getStore()->getId());\n return $category;\n }",
"function ppo_categorized_blog() {\n if (false === ( $all_the_cool_cats = get_transient('ppo_category_count') )) {\n // Create an array of all the categories that are attached to posts\n $all_the_cool_cats = get_categories(array(\n 'hide_empty' => 1,\n ));\n\n // Count the number of categories that are attached to the posts\n $all_the_cool_cats = count($all_the_cool_cats);\n\n set_transient('ppo_category_count', $all_the_cool_cats);\n }\n\n if (1 !== (int) $all_the_cool_cats) {\n // This blog has more than 1 category so ppo_categorized_blog should return true\n return true;\n } else {\n // This blog has only 1 category so ppo_categorized_blog should return false\n return false;\n }\n}",
"public static function createDraftFromRequest() {\n global $member, $manager;\n\n $i_author = $member->getID();\n $i_body = postVar('body');\n $i_title = postVar('title');\n $i_more = postVar('more');\n\n if((strtoupper(_CHARSET) != 'UTF-8')\n && ( ($mb = function_exists('mb_convert_encoding')) || function_exists('iconv') )\n ) {\n if ($mb) {\n $i_body = mb_convert_encoding($i_body, _CHARSET, \"UTF-8\");\n $i_title = mb_convert_encoding($i_title, _CHARSET, \"UTF-8\");\n $i_more = mb_convert_encoding($i_more, _CHARSET, \"UTF-8\");\n } else {\n $i_body = iconv(\"UTF-8\", _CHARSET, $i_body);\n $i_title = iconv(\"UTF-8\", _CHARSET, $i_title);\n $i_more = iconv(\"UTF-8\", _CHARSET, $i_more);\n }\n }\n //$i_actiontype = postVar('actiontype');\n $i_closed = intPostVar('closed');\n //$i_hour = intPostVar('hour');\n //$i_minutes = intPostVar('minutes');\n //$i_month = intPostVar('month');\n //$i_day = intPostVar('day');\n //$i_year = intPostVar('year');\n $i_catid = postVar('catid');\n $i_draft = 1;\n $type = postVar('type');\n if ($type == 'edit') {\n $i_blogid = getBlogIDFromItemID(intPostVar('itemid'));\n }\n else {\n $i_blogid = intPostVar('blogid');\n }\n $i_draftid = intPostVar('draftid');\n\n if (!$member->canAddItem($i_catid)) {\n return array('status' => 'error', 'message' => _ERROR_DISALLOWED);\n }\n\n if (!trim($i_body)) {\n return array('status' => 'error', 'message' => _ERROR_NOEMPTYITEMS);\n }\n\n // create new category if needed\n if (strstr($i_catid, 'newcat')) {\n // Set in default category\n $blog =& $manager->getBlog($i_blogid);\n $i_catid = $blog->getDefaultCategory();\n }\n else {\n // force blogid (must be same as category id)\n $i_blogid = getBlogIDFromCatID($i_catid);\n $blog =& $manager->getBlog($i_blogid);\n }\n\n $posttime = 0;\n\n if ($i_draftid > 0) {\n ITEM::update($i_draftid, $i_catid, $i_title, $i_body, $i_more, $i_closed, 1, 0, 0);\n $itemid = $i_draftid;\n }\n else {\n $itemid = $blog->additem($i_catid, $i_title, $i_body, $i_more, $i_blogid, $i_author, $posttime, $i_closed, $i_draft);\n }\n\n // success\n return array('status' => 'added', 'draftid' => $itemid);\n }",
"private function category() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }",
"public function findWithAcl(int $categoryId): ?HostCategory;",
"protected function _canShow(Mage_Catalog_Model_Category $category)\n {\n // check if the category is new\n if (!$category->getId()) {\n // if yes, return FALSE\n return false;\n }\n // check if the category is active\n if (!$category->getIsActive()) {\n // if yes, return FALSE\n return false;\n }\n // else return TRUE\n return true;\n }",
"public function validCategory($data) {\n $categories = $this->categories();\n return array_key_exists(current($data), $categories);\n }",
"function in_comic_category() {\n\tglobal $post, $category_tree;\n\t\n\t$comic_categories = array();\n\tforeach ($category_tree as $node) {\n\t\t$comic_categories[] = end(explode(\"/\", $node));\n\t}\n\treturn (count(array_intersect($comic_categories, wp_get_post_categories($post->ID))) > 0);\n}",
"public function hasEntry($idEntry);",
"protected function isCategory()\n {\n return is_null($this->request->task);\n }",
"private function exist() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE \"\n . \"product_category_id= :cat_id and product_id= :prod_id \");\n $stmt->bindValue(\":cat_id\", $this->product_category_id, \\PDO::PARAM_INT);\n $stmt->bindValue(\":prod_id\", $this->product_id, \\PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch();\n }",
"static function canMatch($cat)\n {\n \tif(User::getCategoryCount($cat) > 9)\n \t\tif(!self::isWeekend(time()))\n \t\t\treturn true;\n \t\telse\n \t\t\treturn false;\n \telse\n \t\treturn false;\n \n }",
"public static function existsCategory($id)\n\t{\n\t\treturn (bool) BackendModel::getDB()->getVar(\n\t\t\t'SELECT COUNT(i.id)\n\t\t\t FROM faq_categories AS i\n\t\t\t WHERE i.id = ? AND i.language = ?',\n\t\t\tarray((int) $id, BL::getWorkingLanguage())\n\t\t);\n\t}",
"function _validCategory($check)\n\t\t{\n\t\t\t// check legacy too in case we're adding a legacy workshop\n\t\t\t$this->Category->useLegacy(true);\n\t\t\t\n\t\t\t$result = $this->Category->find('count', \n\t\t\t\tarray('recursive' => -1, 'conditions' => array('Category.id' => $check['category_id'])));\n\t\t\t\n\t\t\tif ($result)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}",
"public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }",
"public function isCategory( $name ) {\n $query = $this->db->query( \"SELECT DISTINCT category_id FROM \" . DB_PREFIX . \"category_description WHERE name = '\" . $name . \"'\" );\n\n return $query->row;\n }",
"function in_child_category($thecategory ){\n\t$params = array('type' => 'post',\n 'child_of' => $thecategory,\n 'hierarchical' => 0, );\n\t$cats = get_categories($params);\n\n\tforeach ($cats as $cat) {\n\t\tif ( in_category($cat->cat_ID) ){\n\t\t\treturn true;\n\t\t}\n \t} // end for children\n\treturn false;\n}",
"public static function existsCategory($id)\n {\n return (bool) BackendModel::getContainer()->get('database')->getVar(\n 'SELECT COUNT(i.id)\n FROM slideshow_categories AS i\n WHERE i.id = ? AND i.language = ?',\n array((int) $id, BL::getWorkingLanguage())\n );\n }",
"function client_portal_categorized_blog() {\n\n\t$category_count = get_transient( 'client_portal_categories' );\n\n\tif ( false === $category_count ) {\n\n\t\t$category_count_query = get_categories(\n\t\t\tarray(\n\t\t\t\t'fields' => 'count',\n\t\t\t)\n\t\t);\n\n\t\t$category_count = (int) $category_count_query[0];\n\n\t\tset_transient( 'client_portal_categories', $category_count );\n\t}\n\n\treturn $category_count > 1;\n}",
"public function hasFoodguid(){\n return $this->_has(3);\n }",
"public function checkdata_exist()\n\t{\n$categories=DB::select('select *from categories');\n\t\t$data_exist=DB::select('select *from categories where id=1');\n\t\tif(!$data_exist)\n\t\t{\n\t\t\t$this->autosavecategory();\n\t\t\treturn view('publish')->withCategories($categories);\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\treturn view('publish')->withCategories($categories);\n\t\t}\n\t\t\n\t\t\n\t}",
"private function check_category_taxonomy($category_name){\n\t\t$query = $this->db->prepare(\"SELECT count(`taxonomy_id`) FROM `nw_taxonomy` WHERE `taxonomy_value` = ?\");\n\t\t$query->bindValue(1, $category_name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 0){\n\t\t\t\treturn true;\n\t\t\t}else if($rows >= 1){\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}",
"function have_discussion() {\n\tglobal $discussions_index, $discussion, $discussions, $discussions_count, $discussion_title;\n\n\t// check if single discussion page\n\tif (!$discussion_title) {\n\t\t$discussions_count = count(discussion::get_discussions());\n\t\t$discussions = discussion::get_discussions();\n\t} else {\n\t\t$discussions_count = 1;\n\t\t$discussions = discussion::get_discussion($discussion_title);\n\t}\n\n\tif ($discussions && $discussions_index + 1 <= $discussions_count) {\n\t\t$discussions_index++;\n\t\treturn true;\n\t} else {\n\t\t$discussions_count = 0;\n\t\treturn false;\n\t}\n}",
"function exists() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT post_id FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( $results[0] )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t\t\n\t}",
"public function getActiveCategoryId() {\n\t\tif ($this->request->hasArgument(LinkUtility::CATEGORY)) {\n\t\t\t$categoryId = $this->request->getArgument(LinkUtility::CATEGORY);\n\t\t\tif (ctype_digit($categoryId)) {\n\t\t\t\treturn $categoryId;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function isValidCategory() {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\n\t\t// if no splits then category is required otherwise MUST be NULL (will be ignored in Save)\n\t\tif (empty($_POST['splits']) && empty($_POST['category_id'])) {\n\t\t\t$this->form_validation->set_message('isValidCategory', 'The Category Field is Required');\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function isAssignedToCategory()\n {\n $_currentProduct = $this->getProduct();\n $_categoryIds = $_currentProduct->getCategoryIds();\n if($_categoryIds) {\n return true;\n } else {\n return false;\n }\n }",
"function existCategoryOption() {\n\n\tglobal $result;\n\n\tglobal $cat_name_id;\n\n\tselectRows('category', 'cat_id');\n\n while ($row = mysqli_fetch_array($result)) {\n \t\n\t\t$cat_id = $row['cat_id'];\n\n\t\t$cat_name = $row['cat_name'];\n\n\t\tif ($cat_id == $cat_name_id) {\n\t\t\t\n\t\t\techo \"<option selected value='{$cat_id}'>{$cat_name}</option>\";\n\n\t\t} else {\n\n\t\t\techo \"<option value='{$cat_id}'>{$cat_name}</option>\";\n\n\t\t}\n }\n\n}",
"public function isCategoryFilterModelExist(int $categoryId, int $filterId, $type)\n {\n $model = CategoryFilter::whereCategoryId($categoryId)\n ->whereFilterId($filterId)\n ->whereType($type)->first();\n\n if ($model !== null) {\n return true;\n }\n\n return false;\n }",
"function isDataElementInCategorySelected($categoryDataId, &$gridDataElement) {\n\t\t$submissionFile = $gridDataElement['submissionFile'];\n\n\t\t// Check for special cases when the file needs to be unselected.\n\t\t$dataProvider = $this->getDataProvider();\n\t\tif ($dataProvider->getFileStage() != $submissionFile->getFileStage()) return false;\n\n\t\t// Passed the checks above. If it's part of the current query, mark selected.\n\t\t$query = $this->getAuthorizedContextObject(ASSOC_TYPE_QUERY);\n\t\t$headNote = $query->getHeadNote();\n\t\treturn ($submissionFile->getAssocType() == ASSOC_TYPE_NOTE && $submissionFile->getAssocId() == $headNote->getId());\n\t}",
"public function hasNewReplies($channel)\n {\n if (!auth()->check() || !$channel->threads()->count()) return false;\n\n $view = $channel->viewedBy()->where('users.id', auth()->user()->id)->get();\n\n if (\n $view->count() === 0 || $view->count() !== $channel->threads()->count()\n ) return true;\n\n $result = $view->search(function ($item) {\n return $item->viewed_thread->timestamp < $item->viewed_thread->thread->latest_reply_at;\n });\n\n return $result !== false;\n }",
"function check_category_code($category_code){\n\t\t\tif($this->db->get_where('category',array('code'=>$category_code))->num_rows()>0 ){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}"
] | [
"0.6410271",
"0.6308579",
"0.62689185",
"0.62643653",
"0.61226237",
"0.61004084",
"0.61004084",
"0.61004084",
"0.60864604",
"0.6063833",
"0.59904146",
"0.5868327",
"0.5829884",
"0.5709518",
"0.57029325",
"0.55906355",
"0.5565072",
"0.5559128",
"0.55590665",
"0.55541635",
"0.5552491",
"0.55474836",
"0.5543759",
"0.5538997",
"0.55215085",
"0.5505266",
"0.5501607",
"0.55015355",
"0.54740196",
"0.54720336",
"0.54682106",
"0.5466136",
"0.5445598",
"0.54254866",
"0.5421684",
"0.54096335",
"0.54054296",
"0.5388766",
"0.5378259",
"0.53644574",
"0.5351518",
"0.53196466",
"0.52664137",
"0.52603596",
"0.52486455",
"0.52241075",
"0.52133465",
"0.5212354",
"0.52049667",
"0.52011406",
"0.5197357",
"0.51932216",
"0.5183921",
"0.5173888",
"0.5170344",
"0.51667094",
"0.51642966",
"0.51588005",
"0.5156936",
"0.51352614",
"0.5124096",
"0.5122887",
"0.51208526",
"0.511888",
"0.5112031",
"0.5083374",
"0.50454664",
"0.50342566",
"0.5022266",
"0.5021294",
"0.50129604",
"0.50019735",
"0.4990075",
"0.49862784",
"0.49826744",
"0.49682447",
"0.49617442",
"0.49596635",
"0.49555555",
"0.4955469",
"0.49480712",
"0.4930818",
"0.49279055",
"0.49233782",
"0.49177206",
"0.49165583",
"0.4914605",
"0.49106103",
"0.49029338",
"0.490245",
"0.48987135",
"0.48915368",
"0.48884085",
"0.48840937",
"0.48831534",
"0.48810217",
"0.48805606",
"0.4876142",
"0.48752648",
"0.48747137"
] | 0.66792125 | 0 |
Search by a translated url_title, and return the default language version of it. | public function get_default_url_title($url_title, $return = 'url_title')
{
// First see if its a Cat URL Indicator translation
if ($seg = $this->_get_default_cat_url_indicator($url_title))
{
return $seg;
}
$cache_key = 'get_default_url_title/cat'. $url_title .'/'. $return;
// Make sure this query run as few times as possible
if ( !isset(ee()->session->cache['publisher'][$cache_key]))
{
$qry = ee()->db->select('cat_id')
->where('cat_url_title', $url_title)
->where('publisher_lang_id', ee()->publisher_lib->lang_id)
->where('publisher_status', ee()->publisher_lib->status)
->get('publisher_categories');
if ($qry->num_rows() == 1)
{
$cat_id = $qry->row('cat_id');
if ($return == 'cat_id')
{
ee()->session->cache['publisher'][$cache_key] = $cat_id;
}
else
{
$qry = ee()->db->select('cat_url_title')
->where('cat_id', $cat_id)
->get('categories');
$url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;
ee()->session->cache['publisher'][$cache_key] = $url_title;
}
}
}
if (isset(ee()->session->cache['publisher'][$cache_key]))
{
return ee()->session->cache['publisher'][$cache_key];
}
return ($return === FALSE) ? FALSE : $url_title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLanguageFromUrl(string $url);",
"abstract public function get_language_url($language = null, $url = null);",
"function loadContentEnglish($where, $default='') {\n // Sanitize it for security reasons\n $content = filter_input(INPUT_GET, $where, FILTER_SANITIZE_STRING);\n $default = filter_var($default, FILTER_SANITIZE_STRING);\n // If there wasn't anything on the url, then use the default\n $content = (empty($content)) ? $default : $content;\n // If you found have content, then get it and pass it back\n if ($content) {\n\t// sanitize the data to prevent hacking.\n\t$html = include 'content/en/'.$content.'.php';\n\treturn $html;\n }\n}",
"private function _get_default_cat_url_indicator($url_title)\n {\n foreach (ee()->publisher_model->languages as $lang_id => $language)\n {\n if ($language['cat_url_indicator'] == $url_title)\n {\n return ee()->publisher_model->languages[ee()->publisher_lib->default_lang_id]['cat_url_indicator'];\n }\n }\n\n return FALSE;\n }",
"function search( ) {\n\t\t$language_id = $this->session->userdata('language_id');\n\t\t// breadcrumb urls\n\t\t$language_list = get_msg('list_lang_label');\n\t\t$this->data['action_title'] = array( \n\t\t\tarray( 'url' => '/index/', 'label' => get_msg('list_lang_str_label'), 'mod_name' => 'language_strings','special_mod_name' => 'Languages', 'special_mod_url' => $language_list),\n\t\t\tarray( 'label' => get_msg( 'lang_str_search' ))\n\t\t\t\n\t\t);\n\t\t\n\t\t// condition with search term\n\t\tif($this->input->post('submit') != NULL ){\n\t\t\t$conds = array( 'searchterm' => $this->searchterm_handler( $this->input->post( 'searchterm' )) );\n\t\t\tif($this->input->post('searchterm') != \"\") {\n\t\t\t\t$conds['searchterm'] = $this->input->post('searchterm');\n\t\t\t\t$this->data['searchterm'] = $this->input->post('searchterm');\n\t\t\t\t$this->session->set_userdata(array(\"searchterm\" => $this->input->post('searchterm')));\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$this->session->set_userdata(array(\"searchterm\" => NULL));\n\t\t\t}\n\t\t}else{\n\t\t\t//read from session value\n\t\t\tif($this->session->userdata('searchterm') != NULL){\n\t\t\t\t$conds['searchterm'] = $this->session->userdata('searchterm');\n\t\t\t\t$this->data['searchterm'] = $this->session->userdata('searchterm');\n\t\t\t}\n\t\t}\n\n\t\t$conds['language_id'] = $language_id;\n\t\t// print_r($conds);die;\n\t\t// pagination\n\t\t$this->data['rows_count'] = $this->Language_string->count_all_by( $conds );\n\n\t\t// search data\n\t\t$this->data['langstrings'] = $this->Language_string->get_all_by( $conds, $this->pag['per_page'], $this->uri->segment( 4 ) );\n\t\t$this->data['language_id'] = $language_id;\n\t\t\n\t\t// load add list\n\t\tparent::string_search($language_id);\n\t}",
"public function get_language_from_url( $url = '' ) {\n\t\tif ( empty( $url ) ) {\n\t\t\t$url = pll_get_requested_url();\n\t\t}\n\n\t\t$host = wp_parse_url( $url, PHP_URL_HOST );\n\t\treturn ( $lang = array_search( $host, $this->get_hosts() ) ) ? $lang : '';\n\t}",
"public static function getLangByUrl($url = null)\n {\n if (is_null($url)) {\n return null;\n } else {\n $lang = self::find()->where(['url' => $url, 'status' => self::LANGUAGE_STATUS_ACTIVE])->one();\n if (is_null($lang)) {\n return null;\n } else {\n return $lang;\n }\n }\n }",
"protected function getTitleFromUrl($url, $default = '')\n {\n if (!empty($default)) {\n return $default;\n }\n\n preg_match('/<title>(.+)<\\/title>/', @file_get_contents($url), $matches);\n\n if (empty($matches)) {\n return $url;\n }\n\n return mb_convert_encoding($matches[1], 'UTF-8', 'UTF-8');\n }",
"public function get_translated_url_title($url_title, $lang_id_from = NULL, $lang_id_to = NULL)\n {\n $lang_id_from = $lang_id_from ?: ee()->publisher_lib->prev_lang_id;\n $lang_id_to = $lang_id_to ?: ee()->publisher_lib->lang_id;\n\n // If we're in the middle of a language switch, I don't care what was passed to this method.\n if (ee()->publisher_lib->switching)\n {\n $lang_id_from = ee()->publisher_lib->prev_lang_id;\n }\n\n $key = $lang_id_from.':'.$lang_id_to;\n\n if ( !isset($this->cache['translated_cat_url_title'][$url_title][$key]))\n {\n // Is it a Cat URL Title indicator?\n if ($seg = $this->_get_translated_cat_url_indicator($url_title, $lang_id_from, $lang_id_to))\n {\n $this->cache['translated_cat_url_title'][$seg][$key] = $seg;\n\n return $seg;\n }\n\n $qry = ee()->db->select('cat_id')\n ->where('cat_url_title', $url_title)\n ->where('publisher_lang_id', $lang_id_from)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n if ($qry->num_rows() == 1)\n {\n $cat_id = $qry->row('cat_id');\n\n $qry = ee()->db->select('cat_url_title')\n ->where('cat_id', $cat_id)\n ->where('publisher_lang_id', $lang_id_to)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;\n\n $this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;\n\n return $url_title;\n }\n }\n\n $this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;\n\n return $url_title;\n }",
"public static function find_default()\n\t{\n\t\t// All supported languages\n\t\t$langs = (array) Kohana::$config->load('lang');\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\t// Valid language found in cookie\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accept_lang() as $lang => $quality)\n\t\t{\n\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}",
"public function getLanguageSearch(): ?string {\n\t\treturn (string)$this->_getConfig('language.search');\n\t}",
"function subtitle($url)\n{\n // include the countries array\n $countries = include \"../app/includes/countries_array.php\";\n\n // if search results were found\n if(!empty($url['search'])) return \"results found\";\n\n // if country page is open\n if(!empty($url['country']) && isset($countries[$url['country']])) return \"caps from {$countries[$url['country']]}\";\n\n // if collection page is open\n return \"caps collected\";\n}",
"public function getTitle($languageCode);",
"abstract public function get_app_language();",
"function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }",
"function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}",
"public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }",
"function __($word) {\n global $cfg;\n if (isset($_GET['lang'])) {\n include(\"langs/\".$_GET['lang'].\".php\");\n } else include(\"langs/\".$cfg[\"default_language\"].\".php\"); \n\n return isset($translations[$word]) ? $translations[$word] : $word;\n}",
"function prefered_language ($available_languages,$http_accept_language=\"auto\") { \n // if $http_accept_language was left out, read it from the HTTP-Header \n if ($http_accept_language == \"auto\") $http_accept_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; \n\n // standard for HTTP_ACCEPT_LANGUAGE is defined under \n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 \n // pattern to find is therefore something like this: \n // 1#( language-range [ \";\" \"q\" \"=\" qvalue ] ) \n // where: \n // language-range = ( ( 1*8ALPHA *( \"-\" 1*8ALPHA ) ) | \"*\" ) \n // qvalue = ( \"0\" [ \".\" 0*3DIGIT ] ) \n // | ( \"1\" [ \".\" 0*3(\"0\") ] ) \n preg_match_all(\"/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?\" . \n \"(\\s*;\\s*q\\s*=\\s*(1\\.0{0,3}|0\\.\\d{0,3}))?\\s*(,|$)/i\", \n $http_accept_language, $hits, PREG_SET_ORDER); \n\n // default language (in case of no hits) is the first in the array \n $bestlang = $available_languages[0]; \n $bestqval = 0; \n\n foreach ($hits as $arr) { \n // read data from the array of this hit \n $langprefix = strtolower ($arr[1]); \n if (!empty($arr[3])) { \n $langrange = strtolower ($arr[3]); \n $language = $langprefix . \"-\" . $langrange; \n } \n else $language = $langprefix; \n $qvalue = 1.0; \n if (!empty($arr[5])) $qvalue = floatval($arr[5]); \n \n // find q-maximal language \n if (in_array($language,$available_languages) && ($qvalue > $bestqval)) { \n $bestlang = $language; \n $bestqval = $qvalue; \n } \n // if no direct hit, try the prefix only but decrease q-value by 10% (as http_negotiate_language does) \n else if (in_array($langprefix,$available_languages) && (($qvalue*0.9) > $bestqval)) { \n $bestlang = $langprefix; \n $bestqval = $qvalue*0.9; \n } \n } \n return $bestlang; \n}",
"public function getByTitle()\n {\n }",
"function lixgetlang() {\n $lang = 'rus';\n \n if ($_GET[lang] != 'rus' && $_GET[lang] != 'eng' && $_GET[lang] != 'deu') {\n if (lixlpixel_detect_lang() != 'ru') { $lang = 'eng'; }\n else { $lang = 'rus'; }\n } else {\n $lang = $_GET[lang];\n }\n \n return $lang;\n}",
"function gettitle() {\n\n\t\tglobal $pagetiltle;\n\n\t\tif (isset($pagetiltle)) {\n\n\t\t\techo $pagetiltle;\n\t\t} else {\n\n\t\t\techo lang('DEFAULT');\n\t\t}\n\t}",
"public function languageWhere() {}",
"public function languageWhere() {}",
"function edan_search_set_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n /**\n * if in the loop and the title is cached (or if object group is retrieved successfully)\n * modify the page title on display.\n */\n if(in_the_loop() && edan_search_name_from_url() == $options->get_path() && $options->get_title() != '')\n {\n if(get_query_var('edanUrl'))\n {\n $object = $cache->get()['object'];\n\n if($object)\n {\n if(property_exists($object, 'content') && property_exists($object->{'content'}, 'descriptiveNonRepeating'))\n {\n if(property_exists($object->{'content'}->{'descriptiveNonRepeating'}, 'title'))\n {\n $title = $object->{'content'}->{'descriptiveNonRepeating'}->{'title'}->{'content'};\n }\n }\n elseif(property_exists($object, 'title'))\n {\n if(property_exists($object->{'title'}, 'content'))\n {\n $title = $this->object->{'title'}->{'content'};\n }\n else\n {\n $title = $this->object->{'title'};\n }\n }\n }\n }\n else\n {\n $title = $options->get_title();\n }\n }\n\n return $title;\n }",
"function get_lang($name) {\n global $lang;\n return $lang->get_phrase($name);\n}",
"function preferred_language ($available_languages, $http_accept_language=\"auto\") {\n if ($http_accept_language == \"auto\") $http_accept_language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n // standard for HTTP_ACCEPT_LANGUAGE is defined under\n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4\n // pattern to find is therefore something like this:\n // 1#( language-range [ \";\" \"q\" \"=\" qvalue ] )\n // where:\n // language-range = ( ( 1*8ALPHA *( \"-\" 1*8ALPHA ) ) | \"*\" )\n // qvalue = ( \"0\" [ \".\" 0*3DIGIT ] )\n // | ( \"1\" [ \".\" 0*3(\"0\") ] )\n preg_match_all(\"/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?\" .\n \"(\\s*;\\s*q\\s*=\\s*(1\\.0{0,3}|0\\.\\d{0,3}))?\\s*(,|$)/i\",\n $http_accept_language, $hits, PREG_SET_ORDER);\n\n // default language (in case of no hits) is the first in the array\n $bestlang = $available_languages[0];\n $bestqval = 0;\n\n foreach ($hits as $arr) {\n // read data from the array of this hit\n $langprefix = strtolower ($arr[1]);\n if (!empty($arr[3])) {\n $langrange = strtolower ($arr[3]);\n $language = $langprefix . \"-\" . $langrange;\n }\n else $language = $langprefix;\n $qvalue = 1.0;\n if (!empty($arr[5])) $qvalue = floatval($arr[5]);\n\n // find q-maximal language\n if (in_array($language,$available_languages) && ($qvalue > $bestqval)) {\n $bestlang = $language;\n $bestqval = $qvalue;\n }\n // if no direct hit, try the prefix only but decrease q-value by 10% (as http_negotiate_language does)\n else if (in_array($langprefix,$available_languages) && (($qvalue*0.9) > $bestqval)) {\n $bestlang = $langprefix;\n $bestqval = $qvalue*0.9;\n }\n }\n return $bestlang;\n}",
"public function matchLanguage()\n\t{\n\t\t$pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})'.\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)'.\n '(?P<quantifier>\\d\\.\\d))?$/';\n\t\t\n\t\tforeach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) \n\t\t{\n\t\t\t$splits = array();\n\n\t\t\tif (preg_match($pattern, $lang, $splits)) \n\t\t\t{\n\t\t\t\t$language = $splits['primarytag'];\n\t\t\t\tif(isset($this->languages[$language]))\n\t\t\t\t\treturn $language;\n\t\t\t} \n\t\t\telse \n\t\t\t\treturn 'en';\n\t\t}\n\t\t\n\t\treturn 'en';\n\t}",
"public function getTitle($route = NULL) {\n if ($route === NULL) {\n $route = $this->routeMatch->getRouteName();\n }\n $facet = $this->request->get('facets_query');\n\n $title = $this->getTitleFromRoute($route);\n $search = $this->request->query->all();\n\n if ($route === 'search.view') {\n if (!empty($search)) {\n return t('@title results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n // Applying the term being viewed to Judiciary Sentencing guidelines page title.\n elseif ($route === 'view.judicial_decisions_search.sentence_guide_search_page') {\n $current_path = $this->currentPath->getPath();\n // Match the last number in the URL string with the type filter applied.\n if (preg_match_all('/.*\\/type\\/.*-(\\d+)/', $current_path, $matches)) {\n $tid = $matches[1][0];\n if (is_numeric($tid)) {\n $decision_type = Term::load($tid);\n $term_name = $decision_type->getName();\n $title = 'Sentencing guidelines - ' . $term_name;\n }\n }\n else {\n $title = 'Sentencing guidelines';\n }\n return $title;\n }\n else {\n if (!empty($facet) || !empty($search)) {\n return t('@title - search results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n }",
"function fetch_title($_url=\"\"){ \n if($_url&&$this-> fetch($_url)){\n $html = str_get_html($this-> html);\n return $html->find('title',0)->plaintext;\n }\n return false;\n }",
"public function checkExistLanguageTitle($language_title, $id = 0)\n {\n \t//$language_title = iconv('windows-1251', 'utf-8', strtolower(iconv('utf-8', 'windows-1251', $language_title)));\n \t//$language_title = mb_detect_encoding($language_title, 'utf-8');\n\n \tif($id){\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE lang_id!=? AND LOWER(title) = ?', array($id, $language_title)); \t \t\t\n \t} else {\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE LOWER(title) = ?', $language_title); \t\n \t}\n\n\t\tif(!empty($result)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n }",
"public function searchLabel($msginstancename = \"defaultTranslationService\", $selfedit = \"false\", $search, $language_search = null) {\n\t\t$this->msgInstanceName = $msginstancename;\n\t\t$this->selfedit = $selfedit;\n\t\n\t\t$array = $this->getAllMessagesFromService(($selfedit == \"true\"), $msginstancename, $language_search);\n\t\t$this->languages = $array[\"languages\"];\n\t\t$this->search = $search;\n\t\t$this->language_search = $language_search;\n\t\tif($search) {\n\t\t\t$this->msgs = $array[\"msgs\"];\n\t\n\t\t\t\n\t\t\t$regex = $this->stripRegexMetaChars($this->stripAccents($search));\n\t\t\t$this->results = $this->regex_search_array($array[\"msgs\"], $regex);\n\t\t\t\n\t\t\t$this->error = false;\n\t\t}\n\t\telse\n\t\t\t$this->error = true;\n\n\t\t$webLibriary = new WebLibrary(array(), array('../utils.i18n.fine/src/views/css/style.css'));\n\t\t$this->template->getWebLibraryManager()->addLibrary($webLibriary);\n\n\t\t$this->content->addFile('../utils.i18n.fine/src/views/searchLabel.php', $this);\n\t\t$this->template->toHtml();\n\t}",
"public function getSiteDefaultLanguage();",
"function lng($text, $lng = '') {\n\tglobal $_base_path_cms, $_lang_cms, $_lang_array;\n\n\tif(empty($lng)) {\n\t\tif($_lang_cms == \"\") $_lang_cms = \"ro\";\n\t\t$return = lng($text, $_lang_cms);\n\n\t\tif(!empty($return)) {\n\t\t\treturn $_lang_array[$return];\n\t\t}\n\n\t\treturn $text;\n\t} else {\n\t\t/*\n\t\tinclude $_base_path_cms.'lang/'.$lng.'.php';\n\t\tif(is_file($_base_path_cms . 'lang/extra/'.$lng.'.php')){\n\t\t\tinclude $_base_path_cms . 'lang/extra/'.$lng.'.php';\n\t\t}\n\t\t*/\n\t\tif(isset($_lang_array[$text])) return $text;\n\n\t\t$key = array_search($text, $_lang_array);\n\t\tif(!empty($key)) return $key;\n\t}\n}",
"function compare_title($a, $b) \n{ \n if (($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG) && ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG))\n return strnatcmp($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]);\n if ($a[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return 1;\n if ($b[$GLOBALS['MYLANGFIELDS'][1]] == DEFAULTLANG)\n return -1;\n \n return strcmp_from_utf8($a[$GLOBALS['MYFIELDS'][1]], $b[$GLOBALS['MYFIELDS'][1]]); \n}",
"public static function findByDefault_lang($default_lang)\n {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from( array(\"m\" => \"main\") ) \n ->where( \"m.default_lang = \" . $default_lang );\n\n return $db->fetchRow($query); \n }",
"public function getLanguageSearchPlaceholder(): ?string {\n\t\treturn (string)$this->_getConfig('language.searchPlaceholder');\n\t}",
"public function setTitle(string $title): ISearchOption;",
"function localize($phrase) {\n global $translations;\n /* Static keyword is used to ensure the file is loaded only once */\n if ($translations[$phrase])\n return $translations[$phrase];\n else\n return $phrase;\n}",
"public static function getDefaultLang() {\n return self::find()->where(['is_default' => self::LANGUAGE_IS_DEFAULT, 'status' => self::LANGUAGE_STATUS_ACTIVE])->one();\n }",
"public function getTitle() {\n\t\treturn WCF::getLanguage()->get($this->languageName);\n\t}",
"function getTitle()\n\t{\n\t\t\n\t\t$query = new Bin_Query();\t\n\t\t$title=$_GET['word'];\n\t\tif($title!='')\n\t\t{\n\t\t\t$sql= \"SELECT title FROM products_table WHERE title like '\".$title.\"%'\"; \n\t\t\t$query->executeQuery($sql);\n\t\t\t$arr=$query->records;\n\t\t\treturn Display_DManageProducts::getTitle($query->records);\t\t\t\t\t\n\t\t}\t\n\n\t}",
"protected function _extractLanguage() {\n // Default lanuage is always Lao\n $lang = 'lo';\n\n // Set the cookie name\n //$this->Cookie->name = '_osm_la';\n //echo $this->response->cookie(\"_osm_la\");\n \n // First check if the language parameter is set in the URL. The URL\n // parameter has first priority.\n $paramLang = $this->request->query(\"lang\");\n if (isset($paramLang)) {\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($paramLang, $this->_languages)) {\n // Set the language to the URL parameter\n $lang = $paramLang;\n }\n } else if ($this->Cookie->read($this->_languageCookie) != null) {\n // Check if a cookie is set and set its value as language. A Cookie\n // has second priority\n $cookieValue = $this->Cookie->read($this->_languageCookie);\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($cookieValue, $this->_languages)) {\n // Set the language to the Cookie value\n $lang = $cookieValue;\n }\n }\n\n // If neither the lang parameter nor a cookie is set, set and return\n // Lao as language.\n //$this->log(var_dump($this));\n //$this->response->cookie($this->_languageCookie => $lang ]);\n return $lang;\n }",
"public function lookFor($word,$lang='tr'){\n\t\t\n\t\tif($lang=='tr')\n\t\t\t$content=file_get_contents($this->enUrl.urlencode($word));\n\t\telse\n\t\t\t$content=$this->fetchTrWord(urlencode($word));\n\t\t\n\t\t$content=mb_convert_encoding($content,'UTF-8','ISO-8859-9');\n\t\t\n\t\tif($content!=false && $this->getWordLang($content)==$lang){\n\t\t\t$this->content=$content;\n\t\t\treturn $content;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"private function get_search_page() {\n\t\tif ( ! $this->is_template_supported( 'is_search' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn add_query_arg( 's', 'example', home_url( '/' ) );\n\t}",
"function get_text($id, $language = '', $default = '')\n{\n if (empty($language))\n $language = get_config('language', 'main');\n\n $__langs__ = $GLOBALS[\"__LANGUAGE__{$language}__\"];\n\n return isset($__langs__[strtolower($id)]) ? __replace_cfgs($__langs__[strtolower($id)], 0, $language) : $default;\n}",
"function searchByTitle($title, $groupId=null, $parentId=null) {\n if(is_array($title)) {\n $where = ' i.title IN (\"'.implode('\", \"', array_map('db_es', $title)).'\")';\n } else {\n $where = ' i.title = '.$this->da->quoteSmart($title);\n }\n if($groupId !== null) {\n $where .= ' AND i.group_id = '.$this->da->escapeInt($groupId);\n }\n if($parentId !== null) {\n $where .= ' AND i.parent_id = '.$this->da->escapeInt($parentId);\n }\n\n $order = ' ORDER BY version_date DESC';\n return $this->_searchWithCurrentVersion($where, '', $order);\n }",
"public function getLang();",
"public static function LocatedAt($title) {\n return static::where(compact('title'))->firstOrFail();\n }",
"public function searchTitleActionGet()\n {\n $title = \"Search for a movie by title\";\n $searchTitle = $this->app->request->getGet(\"searchTitle\");\n\n $this->app->db->connect();\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $this->app->page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle,\n ]);\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"function getTitle($url) {\n $str = file_get_contents($url);\n /* RegEx erzeugt ein Array in dem Der Seitentitel auf Index 1 liegt */\n preg_match('/\\<title\\>(.*)\\<\\/title\\>/', $str, $title);\n /* Seitentitel aus Index 1 zurückgeben */\n return $title[1];\n }",
"public function getFromLanguage(): string;",
"public function search($query, $selfedit = \"false\") {\n\t\t$instances = MoufReflectionProxy::getInstances(\"LanguageTranslationInterface\", $selfedit == \"true\");\n\n\t\t$this->selfedit = $selfedit;\n\t\t\n\t\tif($query) {\n\t\t\t$regex = $this->stripRegexMetaChars($this->stripAccents($query));\n\t\t\tforeach ($instances as $instance) {\n\t\t\t\t$array = $this->getAllMessagesFromService(($selfedit == \"true\"), $instance, null);\n\n\t\t\t\t$this->results[$instance] = $this->regex_search_array($array[\"msgs\"], $regex);\n\t\t\t}\n\t\t\t$this->error = false;\n\t\t}\n\t\telse\n\t\t\t$this->error = true;\n\t\t\n\t\t$this->loadFile(dirname(__FILE__).\"/../views/searchGlobal.php\");\n\t}",
"private function retrieve_searchphrase() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$search = get_query_var( 's' );\n\t\t\tif ( $search !== '' ) {\n\t\t\t\t$replacement = esc_html( $search );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getLangFromHeader() {\n\t\t$arr = $this->getHttpHeader();\n\n\t\t// look through sorted list and use first one that matches our languages\n\t\tforeach ($arr as $lang => $val) {\n\t\t\t$lang = explode('-', $lang);\n\t\t\tif (in_array($lang[0], $this->arrLang)) {\n\t\t\t\treturn $lang[0];\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function language();",
"public function language();",
"public static function title( $title )\r\n {\r\n return array_search ( $title, self::choices() );\r\n }",
"public static function getLanguageName(){\n if(Cache::isStored('website_lang')) return Cache::get('website_lang'); \n $row = getDatabase()->queryFirstRow(\"SELECT `value` FROM `settings` WHERE `setting` = 'website_lang'\");\n Cache::store('website_lang', $row['value']);\n return $row['value'];\n }",
"function parseDefaultLanguage($http_accept, $deflang = \"en\") {\n if(isset($http_accept) && strlen($http_accept) > 1) {\n # Split possible languages into array\n $x = explode(\",\",$http_accept);\n foreach ($x as $val) {\n #check for q-value and create associative array. No q-value means 1 by rule\n if(preg_match(\"/(.*);q=([0-1]{0,1}\\.\\d{0,4})/i\",$val,$matches))\n $lang[$matches[1]] = (float)$matches[2];\n else\n $lang[$val] = 1.0;\n }\n\n #return default language (highest q-value)\n $qval = 0.0;\n foreach ($lang as $key => $value) {\n if ($value > $qval) {\n $qval = (float)$value;\n $deflang = $key;\n }\n }\n }\n return strtolower($deflang);\n}",
"function PageByCurrentLocale($pageURL) {\n\t\tif($pg = Translatable::get_one_by_locale('Page', Translatable::default_locale(), \"URLSegment = '{$pageURL}'\")) return $pg->getTranslation(Translatable::get_current_locale());\n\t\t\n\t\treturn null;\n\t}",
"function get_page_by_title($page_title, $output = \\OBJECT, $post_type = 'page')\n {\n }",
"public function getPrimaryLanguage();",
"function edan_search_set_doc_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n if(edan_search_name_from_url() == $options->get_path() && $options->get_title() != '')\n {\n if(get_query_var('edanUrl'))\n {\n $object = $cache->get()['object'];\n\n if($object)\n {\n if(property_exists($object, 'content') && property_exists($object->{'content'}, 'descriptiveNonRepeating'))\n {\n if(property_exists($object->{'content'}->{'descriptiveNonRepeating'}, 'title'))\n {\n $title = $object->{'content'}->{'descriptiveNonRepeating'}->{'title'}->{'content'};\n }\n }\n elseif(property_exists($object, 'title'))\n {\n if(property_exists($object->{'title'}, 'content'))\n {\n $title = $this->object->{'title'}->{'content'};\n }\n else\n {\n $title = $this->object->{'title'};\n }\n }\n }\n }\n else\n {\n $title = $options->get_title();\n }\n }\n\n $sitename = get_bloginfo('name');\n return $title . \" - $sitename\";\n }",
"function getLanguage($url, $ln = null, $type = null) {\n\t// Type 2: Change the path for the /requests/ folder location\n\t// Set the directory location\n\tif($type == 2) {\n\t\t$languagesDir = '../languages/';\n\t} else {\n\t\t$languagesDir = './languages/';\n\t}\n\t// Search for pathnames matching the .png pattern\n\t$language = glob($languagesDir . '*.php', GLOB_BRACE);\n\n\tif($type == 1) {\n\t\t// Add to array the available images\n\t\tforeach($language as $lang) {\n\t\t\t// The path to be parsed\n\t\t\t$path = pathinfo($lang);\n\t\t\t\n\t\t\t// Add the filename into $available array\n\t\t\t$available .= '<li><a href=\"'.$url.'index.php?lang='.$path['filename'].'\">'.ucfirst(strtolower($path['filename'])).'</a></li>';\n\t\t}\n\t\treturn substr($available, 0, -3);\n\t} else {\n\t\t// If get is set, set the cookie and stuff\n\t\t$lang = 'Venezuela'; // DEFAULT LANGUAGE\n\t\tif($type == 2) {\n\t\t\t$path = '../languages/';\n\t\t} else {\n\t\t\t$path = './languages/';\n\t\t}\n\t\tif(isset($_GET['lang'])) {\n\t\t\tif(in_array($path.$_GET['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_GET['lang'];\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t} else {\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t}\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\tif(in_array($path.$_COOKIE['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_COOKIE['lang'];\n\t\t\t}\n\t\t} else {\n\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t}\n\n\t\tif(in_array($path.$lang.'.php', $language)) {\n\t\t\treturn $path.$lang.'.php';\n\t\t}\n\t}\n}",
"protected function getLanguageParameter() {}",
"function fetch_default_language() {\n\tglobal $_OPENDB_DEFAULT_LANGUAGE;\n\n\tif (strlen($_OPENDB_DEFAULT_LANGUAGE) == 0) {\n\t\t$query = \"SELECT language FROM s_language WHERE default_ind = 'Y'\";\n\n\t\t$result = db_query($query);\n\t\tif ($result && db_num_rows($result) > 0) {\n\t\t\t$record_r = db_fetch_assoc($result);\n\t\t\tdb_free_result($result);\n\n\t\t\tif ($record_r) {\n\t\t\t\t$_OPENDB_DEFAULT_LANGUAGE = $record_r['language'];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $_OPENDB_DEFAULT_LANGUAGE;\n}",
"public function setLocalizedUrl($url, $default);",
"function GetJournalByURL($url) {\n // mysql_pconnect removed (lib)\n\n $result = mysql_query (\"SELECT title FROM phil WHERE url = '$url'\",$db);\n\n while ($myrow = mysql_fetch_row($result)) {\n $title = $myrow[0];\n }\n\n // sometimes the UMI URLs can be a little haphazard, but as long as \n // a Publication ID is present, we can just match on that: \n // note that UMI is gone now, so we use the OLD phil table \"phil_min\"\n // to match on old titles\n\n if (! $title) {\n if (preg_match(\"/Pub=(\\d+)/\",$url,$matches)) {\n $result = mysql_query (\"SELECT title FROM phil_min WHERE url like '%$matches[1]%'\",$db);\n while ($myrow = mysql_fetch_row($result)) {\n\t$title = $myrow[0];\n } // end while myrow\n } // end if a UMI PUB id\n } // end if no title found on first try\n\n return \"$title\";\n}",
"function vietnamese_permalink($title, $replacement = '-') {\n\t$map = array();\n\t$quotedReplacement = preg_quote($replacement, '/');\n\t$default = array(\n\t\t'/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ|À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ|å/' => 'a',\n\t\t'/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ|È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ|ë/' => 'e',\n\t\t'/ì|í|ị|ỉ|ĩ|Ì|Í|Ị|Ỉ|Ĩ|î/' => 'i',\n\t\t'/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ|Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ|ø/' => 'o',\n\t\t'/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ|Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ|ů|û/' => 'u',\n\t\t'/ỳ|ý|ỵ|ỷ|ỹ|Ỳ|Ý|Ỵ|Ỷ|Ỹ/' => 'y',\n\t\t'/đ|Đ/' => 'd',\n\t\t'/ç/' => 'c',\n\t\t'/ñ/' => 'n',\n\t\t'/ä|æ/' => 'ae',\n\t\t'/ö/' => 'oe',\n\t\t'/ü/' => 'ue',\n\t\t'/Ä/' => 'Ae',\n\t\t'/Ü/' => 'Ue',\n\t\t'/Ö/' => 'Oe',\n\t\t'/ß/' => 'ss',\n\t\t'/[^\\s\\p{Ll}\\p{Lm}\\p{Lo}\\p{Lt}\\p{Lu}\\p{Nd}]/mu' => ' ',\n\t\t'/\\\\s+/' => $replacement,\n\t\tsprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '',\n\t);\n\t//Some URL was encode, decode first\n\t$title = urldecode($title);\n\t$map = array_merge($map, $default);\n\treturn strtolower(preg_replace(array_keys($map), array_values($map), $title));\n}",
"function getUserLang($allowedLangs, $fallbackLang)\n{\n // reset user_lang array\n $userLangs = [];\n // 2nd highest priority: GET parameter 'lang'\n if (isset($_GET['lang']) && is_string($_GET['lang'])) {\n $userLangs[] = $_GET['lang'];\n }\n // 3rd highest priority: SESSION parameter 'lang'\n if (isset($_SESSION['lang']) && is_string($_SESSION['lang'])) {\n $userLangs[] = $_SESSION['lang'];\n }\n // 4th highest priority: HTTP_ACCEPT_LANGUAGE\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $part) {\n $userLangs[] = strtolower(substr($part, 0, 2));\n }\n }\n // Lowest priority: fallback\n $userLangs[] = $fallbackLang;\n foreach ($allowedLangs as $al) {\n if ($userLangs[0] == $al) {\n return $al;\n }\n }\n return $fallbackLang;\n}",
"function get_blog_by_title($db, $title)\n\t{\n\t\tif(is_string($title))\n\t\t{\n\t\t\t$sql = sprintf(\"SELECT * FROM articles WHERE title LIKE '%s'\", \n\t\t\t\t\t\t\t\tmysqli_real_escape_string($db, $title));\n\n\t\t\t$result = mysqli_query($db, $sql);\n\n\t\t\tif(!$result || mysqli_num_rows($result) === 0)\n\t\t\t\treturn NULL;\n\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t\tthrow new Exception(\"String parameter required.\");\n\t}",
"function lang()\n\t{\n\t\t$args = func_get_args();\n\t\tif (is_array($args) && count($args) == 1 && is_array($args[0]))\n\t\t\t$args = $args[0];\n\t\treturn CmsLanguage::translate($args[0], array_slice($args, 1), $this->get_name(), '', $this->default_language());\n\t}",
"function get_page_by_title_safely( $title, $alt_title = 'Error' ) {\n if (($page = get_page_by_title($title)) && ($page->post_status == 'publish')) {\n return $page;\n }elseif(($page = get_page_by_title($alt_title)) && ($page->post_status == 'publish')) {\n if ($alt_title == 'Error') { $page->post_content .= '<p>>>> ' . $title . ' ???</p>'; }\n return $page;\n // we don't care if Error is a published page\n }elseif($page = get_page_by_title('Error')) {\n $page->post_content .= '<p>>>> ' . $title . ' ???</p>';\n return $page;\n }else{\n throw new Exception('Sorry, I can\\'t find that. Is the Error page missing?');\n }\n}",
"function local_navigation_get_string($string) {\n $title = $string;\n $text = explode(',', $string, 2);\n if (count($text) == 2) {\n // Check the validity of the identifier part of the string.\n if (clean_param($text[0], PARAM_STRINGID) !== '') {\n // Treat this as atext language string.\n $title = get_string($text[0], $text[1]);\n }\n }\n return $title;\n}",
"public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public function setLanguageSearchPlaceholder(string $searchPlaceholder) {\n\t\t$this->_setConfig('language.searchPlaceholder', $searchPlaceholder);\n\n\t\treturn $this;\n\t}",
"static function lookup($msgid)\n\t{\n\t\t$lang = self::$lang;\n\t\tif (!$lang) {\n\t\t\treturn $msgid;\n\t\t}\n\t\tif (!isset(self::$dicts[$lang])) {\n\t\t\tself::load_dict($lang);\n\t\t}\n\t\tif (array_key_exists($msgid, self::$dicts[$lang])) {\n\t\t\treturn self::$dicts[$lang][$msgid];\n\t\t}\n\t\treturn $msgid;\n\t}",
"function _polylang_set_sitemap_language() {\n\n\tif ( ! \\function_exists( 'PLL' ) ) return;\n\tif ( ! ( \\PLL() instanceof \\PLL_Frontend ) ) return;\n\n\t// phpcs:ignore, WordPress.Security.NonceVerification.Recommended -- Arbitrary input expected.\n\t$lang = isset( $_GET['lang'] ) ? $_GET['lang'] : '';\n\n\t// Language codes are user-definable: copy Polylang's filtering.\n\t// The preg_match's source: \\PLL_Admin_Model::validate_lang();\n\tif ( ! \\is_string( $lang ) || ! \\strlen( $lang ) || ! preg_match( '#^[a-z_-]+$#', $lang ) ) {\n\t\t$_options = \\get_option( 'polylang' );\n\t\tif ( isset( $_options['force_lang'] ) ) {\n\t\t\tswitch ( $_options['force_lang'] ) {\n\t\t\t\tcase 0:\n\t\t\t\t\t// Polylang determines language sporadically from content: can't be trusted. Overwrite.\n\t\t\t\t\t$lang = \\pll_default_language();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Polylang can differentiate languages by (sub)domain/directory name early. No need to interfere. Cancel.\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t// This will default to the default language when $lang is invalid or unregistered. This is fine.\n\t$new_lang = \\PLL()->model->get_language( $lang );\n\n\tif ( $new_lang )\n\t\t\\PLL()->curlang = $new_lang;\n}",
"public function getPiece($title, $default = '', $locale = ''){\n $post = \\FlexCMS\\BasicCMS\\Models\\Article::where('title', '=', $title)->first();\n return $post ? $post->description : $default;\n }",
"public function autoselect()\n {\n $site_url = Config::getSiteURL();\n\n $sites = array();\n foreach ($this->all_lang as $lang) {\n $sites[$lang] = $site_url . \"/\" . $lang;\n }\n\n // Get 2 char lang code from the browser\n if ((isset($_SERVER)) && (array_key_exists('HTTP_ACCEPT_LANGUAGE',$_SERVER))) {\n $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);\n } else {\n $lang = $this->default_lang;\n }\n \n\n // Set default language if a '$lang' version of site is not available\n if (!isset($sites[$lang])) {\n $lang = $this->default_lang;\n }\n // Finally redirect to desired location\n header('Location: ' . $sites[$lang]);\n exit;\n }",
"function GetDefaultLang() : string\n{\n return 'ar';\n}",
"function us_wpml_tr_selected_lang_page( $default_value = FALSE ) {\r\n\t\tif ( ! empty( $_REQUEST['lang'] ) ) {\r\n\t\t\treturn strtolower( $_REQUEST['lang'] ) !== 'all';\r\n\t\t} elseif ( ! empty( $_COOKIE[ 'wp-wpml_current_language' ] ) ) {\r\n\t\t\treturn strtolower( $_COOKIE[ 'wp-wpml_current_language' ] ) !== 'all';\r\n\t\t}\r\n\t\treturn $default_value;\r\n\t}",
"protected function get_search_locale() {\n return self::$locale;\n }",
"public function getSearchText();",
"function PageByDefaultLocale($pageURL){\n\t\t$defLoc = Translatable::default_locale();\n\t\tif($pg = Translatable::get_one_by_locale('Page', $defLoc, \"URLSegment = '{$pageURL}'\")) return $pg;\n\t\t\n\t\treturn null;\n\t}",
"function themes_get_language($script = 'global')\n{\n}",
"public function negotiateLanguage()\n {\n $matches = $this->getMatchesFromAcceptedLanguages();\n foreach ($matches as $key => $q) {\n\n $key = ($this->configRepository->get('laravellocalization.localesMapping')[$key]) ?? $key;\n\n if (!empty($this->supportedLanguages[$key])) {\n return $key;\n }\n\n if ($this->use_intl) {\n $key = Locale::canonicalize($key);\n }\n\n // Search for acceptable locale by 'regional' => 'af_ZA' or 'lang' => 'af-ZA' match.\n foreach ( $this->supportedLanguages as $key_supported => $locale ) {\n if ( (isset($locale['regional']) && $locale['regional'] == $key) || (isset($locale['lang']) && $locale['lang'] == $key) ) {\n return $key_supported;\n }\n }\n }\n // If any (i.e. \"*\") is acceptable, return the first supported format\n if (isset($matches['*'])) {\n reset($this->supportedLanguages);\n\n return key($this->supportedLanguages);\n }\n\n if ($this->use_intl && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $http_accept_language = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\n if (!empty($this->supportedLanguages[$http_accept_language])) {\n return $http_accept_language;\n }\n }\n\n if ($this->request->server('REMOTE_HOST')) {\n $remote_host = explode('.', $this->request->server('REMOTE_HOST'));\n $lang = strtolower(end($remote_host));\n\n if (!empty($this->supportedLanguages[$lang])) {\n return $lang;\n }\n }\n\n return $this->defaultLocale;\n }",
"public function search()\n {\n auth_admin();\n $s_title = myUrlEncode(trim($this->input->post('s_title')));\n redirect($this->path_uri . '/main/a' . $s_title);\n }",
"public function localeIndex();",
"function getTitle($view=''){\n\t\t\t\t\t\tif($view=='') return \"{Site_Title}\";\n\t\t\t\t\t\telse if ($view=='search'){\n\t\t\t\t\t\t\t\t$tukhoa=$_GET['tukhoa'];\n\t\t\t\t\t\t\t\treturn \"Tìm Kiếm Thông Tin | \".$tukhoa;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} //return \"Tìm Kiếm Thông Tin\";\n\t\t\t\t\t\telse if ($view=='register') return \"Đăng Ký Thành Viên\";\n\t\t\t\t\t\telse if ($view=='news') {\n\t\t\t\t\t\t\t$TieuDe_KhongDau=$_GET['TieuDe_KhongDau'];\n\t\t\t\t\t\t\t$kq=mysql_query(\"SELECT TieuDe FROM tin WHERE TieuDe_KhongDau='$TieuDe_KhongDau'\")\n\t\t\t\t\t\t\tor die (mysql_error());\n\t\t\t\t\t\t\tif(mysql_num_rows($kq)<=0)return \"{Site_Title}\";\n\t\t\t\t\t\t\t$row_kq=mysql_fetch_row($kq);\n\t\t\t\t\t\t\treturn $row_kq[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($view=='cat'){\n\t\t\t\t\t\t\t$Ten_KhongDau=$_GET['Ten_KhongDau'];;\n\t\t\t\t\t\t\t$kq=mysql_query(\"SELECT Ten FROM loaitin WHERE Ten_KhongDau='$Ten_KhongDau'\")\n\t\t\t\t\t\t\tor die (mysql_error());\n\t\t\t\t\t\t\tif(mysql_num_rows($kq)<=0)\n\t\t\t\t\t\t\treturn \"{Site_Title}\";\n\t\t\t\t\t\t\t$row_kq=mysql_fetch_row($kq);\n\t\t\t\t\t\t\treturn $row_kq[0];\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}",
"function getBasicDetailsByTitle($sek_title)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE \";\r\n if (is_numeric(strpos(APP_SQL_DBTYPE, \"pgsql\"))) { //pgsql is case sensitive\r\n $stmt .= \" sek_title ILIKE \" . $db->quote($sek_title);\r\n } else {\r\n $stmt .= \" sek_title=\" . $db->quote($sek_title);\r\n }\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }",
"abstract public function getTranslationIn(string $locale);",
"abstract public function getTranslationIn(string $locale);",
"abstract public function getTranslationIn(string $locale);",
"function lang()\n {\n global $CFG; \n $language = $CFG->item('language');\n \n $lang = array_search($language, $this->languages);\n if ($lang)\n {\n return $lang;\n }\n \n return NULL; // this should not happen\n }",
"public function searchByTitle($title) \n {\n try {\n $data = VideoContent::where('title','LIKE','%'.$title.'%')->where('status', '=', true)->orderBy('ID', 'DESC')->paginate(10);\n if (!empty($data)) {\n $response = APIResponse('200', 'Success', $data);\n } else {\n $response = APIResponse('201', 'No data found.');\n }\n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n \n return $response;\n }",
"function get_title($url){\n\t$str = file_get_contents($url);\n\tif(strlen($str)>0){\n\t\t$str = trim(preg_replace('/\\s+/', ' ', $str)); // supports line breaks inside <title>\n\t\tpreg_match(\"/\\<title\\>(.*)\\<\\/title\\>/i\",$str,$title); // ignore case\n\t\treturn $title[1];\n\t}\n}",
"function lang($variable, $default_text, $lang=''){\n\t\t\t\tglobal $eventon_rs;\n\t\t\t\treturn $eventon_rs->lang($variable, $default_text, $lang);\n\t\t\t}",
"function language_url($url) {\n\n if(isset($_COOKIE['language'])) {\n return '/' . $_COOKIE['language'] . $url;\n } else {\n return $url;\n }\n }"
] | [
"0.61352044",
"0.60453653",
"0.5912318",
"0.5887892",
"0.58520335",
"0.57546294",
"0.5693313",
"0.56768495",
"0.5669532",
"0.56693906",
"0.563123",
"0.55944204",
"0.54889673",
"0.54722184",
"0.5399911",
"0.5374761",
"0.53701484",
"0.5348924",
"0.5316287",
"0.53082323",
"0.5284016",
"0.52739686",
"0.527141",
"0.527141",
"0.52642745",
"0.52623177",
"0.5261023",
"0.52607495",
"0.52536106",
"0.5247487",
"0.522937",
"0.5223011",
"0.5222133",
"0.5221125",
"0.5208819",
"0.51951176",
"0.5142413",
"0.5142344",
"0.5139913",
"0.5132633",
"0.51251864",
"0.51224697",
"0.511957",
"0.51188296",
"0.5112344",
"0.51040447",
"0.5101874",
"0.51009095",
"0.50969625",
"0.50840867",
"0.50813156",
"0.5073329",
"0.5070468",
"0.50672156",
"0.5063855",
"0.50509614",
"0.50509614",
"0.5050035",
"0.50360566",
"0.5032168",
"0.5015184",
"0.5013722",
"0.50009036",
"0.49794534",
"0.4972286",
"0.4971728",
"0.49696994",
"0.4965433",
"0.49596512",
"0.49469495",
"0.49461523",
"0.4944715",
"0.49430743",
"0.49428335",
"0.49423364",
"0.49407232",
"0.49402297",
"0.4934096",
"0.4930531",
"0.4928585",
"0.492781",
"0.4925351",
"0.49240127",
"0.49211016",
"0.4919946",
"0.49137494",
"0.4909895",
"0.49078006",
"0.49057674",
"0.49040616",
"0.48993716",
"0.48984224",
"0.48981613",
"0.48981613",
"0.48981613",
"0.4897194",
"0.48938268",
"0.4888757",
"0.4887726",
"0.48791215"
] | 0.6164824 | 0 |
Search for a default url_title, and return the translated version of it. | public function get_translated_url_title($url_title, $lang_id_from = NULL, $lang_id_to = NULL)
{
$lang_id_from = $lang_id_from ?: ee()->publisher_lib->prev_lang_id;
$lang_id_to = $lang_id_to ?: ee()->publisher_lib->lang_id;
// If we're in the middle of a language switch, I don't care what was passed to this method.
if (ee()->publisher_lib->switching)
{
$lang_id_from = ee()->publisher_lib->prev_lang_id;
}
$key = $lang_id_from.':'.$lang_id_to;
if ( !isset($this->cache['translated_cat_url_title'][$url_title][$key]))
{
// Is it a Cat URL Title indicator?
if ($seg = $this->_get_translated_cat_url_indicator($url_title, $lang_id_from, $lang_id_to))
{
$this->cache['translated_cat_url_title'][$seg][$key] = $seg;
return $seg;
}
$qry = ee()->db->select('cat_id')
->where('cat_url_title', $url_title)
->where('publisher_lang_id', $lang_id_from)
->where('publisher_status', ee()->publisher_lib->status)
->get('publisher_categories');
if ($qry->num_rows() == 1)
{
$cat_id = $qry->row('cat_id');
$qry = ee()->db->select('cat_url_title')
->where('cat_id', $cat_id)
->where('publisher_lang_id', $lang_id_to)
->where('publisher_status', ee()->publisher_lib->status)
->get('publisher_categories');
$url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;
$this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;
return $url_title;
}
}
$this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;
return $url_title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getTitleFromUrl($url, $default = '')\n {\n if (!empty($default)) {\n return $default;\n }\n\n preg_match('/<title>(.+)<\\/title>/', @file_get_contents($url), $matches);\n\n if (empty($matches)) {\n return $url;\n }\n\n return mb_convert_encoding($matches[1], 'UTF-8', 'UTF-8');\n }",
"public function get_default_url_title($url_title, $return = 'url_title')\n {\n // First see if its a Cat URL Indicator translation\n if ($seg = $this->_get_default_cat_url_indicator($url_title))\n {\n return $seg;\n }\n\n $cache_key = 'get_default_url_title/cat'. $url_title .'/'. $return;\n\n // Make sure this query run as few times as possible\n if ( !isset(ee()->session->cache['publisher'][$cache_key]))\n {\n $qry = ee()->db->select('cat_id')\n ->where('cat_url_title', $url_title)\n ->where('publisher_lang_id', ee()->publisher_lib->lang_id)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n if ($qry->num_rows() == 1)\n {\n $cat_id = $qry->row('cat_id');\n\n if ($return == 'cat_id')\n {\n ee()->session->cache['publisher'][$cache_key] = $cat_id;\n }\n else\n {\n $qry = ee()->db->select('cat_url_title')\n ->where('cat_id', $cat_id)\n ->get('categories');\n\n $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;\n\n ee()->session->cache['publisher'][$cache_key] = $url_title;\n }\n }\n }\n\n if (isset(ee()->session->cache['publisher'][$cache_key]))\n {\n return ee()->session->cache['publisher'][$cache_key];\n }\n\n return ($return === FALSE) ? FALSE : $url_title;\n }",
"function title($default = \"\") {\n\t\t$this->loadModel('SeoTitle');\n\t\t$request = env('REQUEST_URI');\n\t\t$seo_title = $this->SeoTitle->findTitleByUri($request);\n\t\t$title = $seo_title ? $seo_title['SeoTitle']['title'] : $default;\n\t\treturn $this->Html->tag('title', $title);\n\t}",
"public function getDefaultTitle(): string;",
"public function getDefaultTitle()\n {\n return __('Pages');\n }",
"function gettitle() {\n\n\t\tglobal $pagetiltle;\n\n\t\tif (isset($pagetiltle)) {\n\n\t\t\techo $pagetiltle;\n\t\t} else {\n\n\t\t\techo lang('DEFAULT');\n\t\t}\n\t}",
"private function _get_default_cat_url_indicator($url_title)\n {\n foreach (ee()->publisher_model->languages as $lang_id => $language)\n {\n if ($language['cat_url_indicator'] == $url_title)\n {\n return ee()->publisher_model->languages[ee()->publisher_lib->default_lang_id]['cat_url_indicator'];\n }\n }\n\n return FALSE;\n }",
"function edan_search_set_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n /**\n * if in the loop and the title is cached (or if object group is retrieved successfully)\n * modify the page title on display.\n */\n if(in_the_loop() && edan_search_name_from_url() == $options->get_path() && $options->get_title() != '')\n {\n if(get_query_var('edanUrl'))\n {\n $object = $cache->get()['object'];\n\n if($object)\n {\n if(property_exists($object, 'content') && property_exists($object->{'content'}, 'descriptiveNonRepeating'))\n {\n if(property_exists($object->{'content'}->{'descriptiveNonRepeating'}, 'title'))\n {\n $title = $object->{'content'}->{'descriptiveNonRepeating'}->{'title'}->{'content'};\n }\n }\n elseif(property_exists($object, 'title'))\n {\n if(property_exists($object->{'title'}, 'content'))\n {\n $title = $this->object->{'title'}->{'content'};\n }\n else\n {\n $title = $this->object->{'title'};\n }\n }\n }\n }\n else\n {\n $title = $options->get_title();\n }\n }\n\n return $title;\n }",
"public function change_default_title($title) {\n\t\treturn '';\n\t}",
"function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}",
"function edan_search_set_doc_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n if(edan_search_name_from_url() == $options->get_path() && $options->get_title() != '')\n {\n if(get_query_var('edanUrl'))\n {\n $object = $cache->get()['object'];\n\n if($object)\n {\n if(property_exists($object, 'content') && property_exists($object->{'content'}, 'descriptiveNonRepeating'))\n {\n if(property_exists($object->{'content'}->{'descriptiveNonRepeating'}, 'title'))\n {\n $title = $object->{'content'}->{'descriptiveNonRepeating'}->{'title'}->{'content'};\n }\n }\n elseif(property_exists($object, 'title'))\n {\n if(property_exists($object->{'title'}, 'content'))\n {\n $title = $this->object->{'title'}->{'content'};\n }\n else\n {\n $title = $this->object->{'title'};\n }\n }\n }\n }\n else\n {\n $title = $options->get_title();\n }\n }\n\n $sitename = get_bloginfo('name');\n return $title . \" - $sitename\";\n }",
"function ffw_media_change_default_title( $title ) {\n $screen = get_current_screen();\n\n if ( 'ffw_media' == $screen->post_type ) {\n \t$label = ffw_media_get_label_singular();\n $title = sprintf( __( 'Enter %s title here', 'FFW_media' ), $label );\n }\n\n return $title;\n}",
"function loadContentEnglish($where, $default='') {\n // Sanitize it for security reasons\n $content = filter_input(INPUT_GET, $where, FILTER_SANITIZE_STRING);\n $default = filter_var($default, FILTER_SANITIZE_STRING);\n // If there wasn't anything on the url, then use the default\n $content = (empty($content)) ? $default : $content;\n // If you found have content, then get it and pass it back\n if ($content) {\n\t// sanitize the data to prevent hacking.\n\t$html = include 'content/en/'.$content.'.php';\n\treturn $html;\n }\n}",
"function fetch_title($_url=\"\"){ \n if($_url&&$this-> fetch($_url)){\n $html = str_get_html($this-> html);\n return $html->find('title',0)->plaintext;\n }\n return false;\n }",
"public function getPiece($title, $default = '', $locale = ''){\n $post = \\FlexCMS\\BasicCMS\\Models\\Article::where('title', '=', $title)->first();\n return $post ? $post->description : $default;\n }",
"function getTitle($url) {\n $str = file_get_contents($url);\n /* RegEx erzeugt ein Array in dem Der Seitentitel auf Index 1 liegt */\n preg_match('/\\<title\\>(.*)\\<\\/title\\>/', $str, $title);\n /* Seitentitel aus Index 1 zurückgeben */\n return $title[1];\n }",
"public function getPageTitle()\n {\n return parent::getPageTitle() ?:\n (\n isset($this->get['pages']) ? $this->tableAdmin->translate('Pages') :\n (\n isset($this->get['products']) ? $this->tableAdmin->translate('Products') :\n (\n isset($this->get['urls']) ? $this->tableAdmin->translate('URL') :\n ''\n )\n )\n );\n }",
"public static function title( $title )\r\n {\r\n return array_search ( $title, self::choices() );\r\n }",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"public function getTitle();",
"private function retrieve_title() {\n\t\t$replacement = null;\n\n\t\tif ( is_string( $this->args->post_title ) && $this->args->post_title !== '' ) {\n\t\t\t$replacement = stripslashes( $this->args->post_title );\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function get_title();",
"public function page_title_should_return_the_base_title_if_the_title_is_empty()\n {\n $this->assertEquals('Laracarte - List of artisans', page_title(''));\n }",
"public static function get($default_title = \"\", $delimiter = \"-\", $reverse = false)\n {\n if ( ! is_null($default_title)) {\n array_unshift(static::$titles, $default_title);\n }\n\n return implode(' '.$delimiter.' ', $reverse === true ? array_reverse(static::$titles) : static::$titles);\n }",
"public function setLocalizedUrl($url, $default);",
"function getLocalizedTitle() {\n\t\tif ( $this->_titleLocalized ) return $this->_titleLocalized;\n\t\treturn __($this->_title);\n\t}",
"function change_default_title($title) {\n $screen = get_current_screen();\n $post_type = $screen->post_type;\n if (array_key_exists($post_type, TOWER_CUSTOM_POSTS))\n return @TOWER_CUSTOM_POSTS[$post_type]['placeholder'];\n return $title;\n}",
"function get_page_by_title_safely( $title, $alt_title = 'Error' ) {\n if (($page = get_page_by_title($title)) && ($page->post_status == 'publish')) {\n return $page;\n }elseif(($page = get_page_by_title($alt_title)) && ($page->post_status == 'publish')) {\n if ($alt_title == 'Error') { $page->post_content .= '<p>>>> ' . $title . ' ???</p>'; }\n return $page;\n // we don't care if Error is a published page\n }elseif($page = get_page_by_title('Error')) {\n $page->post_content .= '<p>>>> ' . $title . ' ???</p>';\n return $page;\n }else{\n throw new Exception('Sorry, I can\\'t find that. Is the Error page missing?');\n }\n}",
"public function change_default_title($title)\n {\n $screen = get_current_screen();\n\n if ($this->token == $screen->post_type) {\n $title = 'Enter a title for your Chiro Quiz';\n }\n\n return $title;\n }",
"function get_title($url){\n\t$str = file_get_contents($url);\n\tif(strlen($str)>0){\n\t\t$str = trim(preg_replace('/\\s+/', ' ', $str)); // supports line breaks inside <title>\n\t\tpreg_match(\"/\\<title\\>(.*)\\<\\/title\\>/i\",$str,$title); // ignore case\n\t\treturn $title[1];\n\t}\n}",
"public function getDefaultTitle()\n {\n if ($this->getMenu()) {\n return $this->getMenu()->getName();\n }\n\n return __('Menu');\n }",
"protected function get_default_title() {\n\n\t\treturn __( 'TeleCheck', 'woocommerce-gateway-firstdata' );\n\t}",
"function getTitle(){\r\n\r\n \tglobal $pageTitle;\r\n \r\n if(isset($pageTitle)){\r\n\r\n \techo $pageTitle;\r\n\r\n }else{\r\n\r\n \techo 'Default';\r\n }\r\n\r\n }",
"function _getLinkTitle($title, $default, &$isImage, $id = null, $linktype = 'content') {\n $isImage = false;\n if(is_array($title)) {\n $isImage = true;\n return $this->_imageTitle($title);\n } elseif(is_null($title) || trim($title) == '') {\n if(useHeading($linktype) && $id) {\n $heading = p_get_first_heading($id);\n if(!blank($heading)) {\n return $this->_xmlEntities($heading);\n }\n }\n return $this->_xmlEntities($default);\n } else {\n return $this->_xmlEntities($title);\n }\n }",
"function gettitle(){\n global $pagetitle;\n if(isset($pagetitle)){\n echo $pagetitle;\n }else{\n echo 'Default';\n }\n }",
"public static function change_default_title( $title ){\n\t\t$screen = get_current_screen();\n\n\t\tif ( self::$post_type_name == $screen->post_type )\n\t\t\t$title = __( 'Enter Sponsor Name', self::$text_domain );\n\n\t\treturn $title;\n\t}",
"public function getTitle()\n\t{\n\t\tif( isset($this->title) )\n\t\t{\n\t\t\t$translate = Zend_Registry::get('Zend_Translate');\n\t\t\treturn $translate -> translate($this->title);\n\t\t}\n\t\treturn null;\n\t}",
"protected function defaultUrlName()\n {\n $urlName = $this->getName();\n return preg_replace('/([^A-Z|^0-9|^-])/is', '-', $urlName);\n }",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle() {\n\t\treturn WCF::getLanguage()->get($this->languageName);\n\t}",
"public function getTitle() {}",
"public function getTitle() {}",
"public function getTitle($languageCode);",
"function wpvideocoach_custom_title()\r\n{\r\n\tglobal $wpvideocoach_custom_title;\r\n\tif(empty($wpvideocoach_custom_title)){\r\n\t\t$wpvideocoach_custom_title = __('WordPress Video Coach', 'wp-video-coach');\r\n\t}\r\n\treturn $wpvideocoach_custom_title;\r\n}",
"function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}",
"function getTitle()\n\t{\n\t\t\n\t\t$query = new Bin_Query();\t\n\t\t$title=$_GET['word'];\n\t\tif($title!='')\n\t\t{\n\t\t\t$sql= \"SELECT title FROM products_table WHERE title like '\".$title.\"%'\"; \n\t\t\t$query->executeQuery($sql);\n\t\t\t$arr=$query->records;\n\t\t\treturn Display_DManageProducts::getTitle($query->records);\t\t\t\t\t\n\t\t}\t\n\n\t}",
"private function retrieve_searchphrase() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$search = get_query_var( 's' );\n\t\t\tif ( $search !== '' ) {\n\t\t\t\t$replacement = esc_html( $search );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"function pageTitle(){\n\t\tglobal $pageTitle;\n\t\techo isset($pageTitle) ? $pageTitle : \"Default\";\n\t}",
"public function getTitle($route = NULL) {\n if ($route === NULL) {\n $route = $this->routeMatch->getRouteName();\n }\n $facet = $this->request->get('facets_query');\n\n $title = $this->getTitleFromRoute($route);\n $search = $this->request->query->all();\n\n if ($route === 'search.view') {\n if (!empty($search)) {\n return t('@title results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n // Applying the term being viewed to Judiciary Sentencing guidelines page title.\n elseif ($route === 'view.judicial_decisions_search.sentence_guide_search_page') {\n $current_path = $this->currentPath->getPath();\n // Match the last number in the URL string with the type filter applied.\n if (preg_match_all('/.*\\/type\\/.*-(\\d+)/', $current_path, $matches)) {\n $tid = $matches[1][0];\n if (is_numeric($tid)) {\n $decision_type = Term::load($tid);\n $term_name = $decision_type->getName();\n $title = 'Sentencing guidelines - ' . $term_name;\n }\n }\n else {\n $title = 'Sentencing guidelines';\n }\n return $title;\n }\n else {\n if (!empty($facet) || !empty($search)) {\n return t('@title - search results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n }",
"function getTitle($sek_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n IF(sek_alt_title <> '', sek_alt_title, sek_title)\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE\r\n sek_id= \" . $db->quote($sek_id);\r\n try {\r\n $res = $db->fetchOne($stmt);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n\r\n return $res;\r\n }",
"function getTitle() ;",
"public function searchTitleActionGet()\n {\n $title = \"Search for a movie by title\";\n $searchTitle = $this->app->request->getGet(\"searchTitle\");\n\n $this->app->db->connect();\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $this->app->page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle,\n ]);\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"function get_title()\n {\n }",
"public static function find_default()\n\t{\n\t\t// All supported languages\n\t\t$langs = (array) Kohana::$config->load('lang');\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\t// Valid language found in cookie\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accept_lang() as $lang => $quality)\n\t\t{\n\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}",
"public abstract function getTitle();",
"function genesis_do_search_title() {\n\n\t$title = sprintf( '<div class=\"archive-description\"><h1 class=\"archive-title\">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search results for: ', 'genesis' ) ), get_search_query() );\n\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\n}",
"function trans_or_default(string $key, $default, array $replace = [], $locale = null): string\n {\n $message = trans($key, $replace, $locale);\n\n return $message === $key ? $default : $message;\n }",
"function customPageTitle($string) {\n return sprintf(__('Add language » %s'), $string);\n}",
"function site_title( $nd = ' - ' ) {\r\n\r\n\tglobal $db;\t\r\n\t\r\n\tif( isset( $_GET['page'] ) ) {\r\n\t\t$link = $_GET['page'];\r\n\t} else {\r\n\t\t$link = 'home-page';\t\r\n\t}\t\r\n\r\n\t$result = mysql_query(\"SELECT title FROM pages WHERE link='$link'\");\r\n\tif( !$result ) {\r\n\t\t$title = 'Not Found';\r\n\t} else {\r\n\t\t$page = mysql_fetch_array( $result );\r\n\t\t$title = $page['title'];\t\r\n\t}\r\n\r\n\techo SITENAME . $nd . $title;\t\r\n\t\r\n}",
"function uvasomrfd_do_search_title() {\n\t$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );\n\tif(!is_page('27718')){\n\t//if (!strpos($_SERVER[\"REQUEST_URI\"], 'faculty-mentoring-undergraduates')) {\n\tif (is_tax( 'primary')||is_tax( 'training-grant')) {$preterm='Department of ';}\n\tif (is_tax( 'research-discipline')) {$preterm='Research Discipline: ';}\n\tif (is_tax( 'training-grant')) {$preterm='Training Program: ';}\n\t//if (strpos($_SERVER[\"REQUEST_URI\"], '?undergraduates')){$preterm='Faculty Accepting Undergraduates';$term->name='';}\n$title = sprintf( '<div class=\"clearfix\"></div><div id=\"uvasom_page_title\">'.genesis_do_breadcrumbs().'<h1 class=\"archive-title\">%s %s</h1>', apply_filters( 'genesis_search_title_text', __( $preterm, 'genesis' ) ), $term->name).'</div>';\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\t}\n}",
"public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }",
"private function parseTitleUrl() {\n $posId = strpos($this->title, '-') + 1;\n $this->title = substr($this->title, $posId, strlen($this->title) - $posId);\n $this->title = $this->smoothenTitle($this->title);\n\n $sql = \"SELECT\n id,\n title\n FROM\n articles\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $title);\n while($stmt->fetch()) {\n if($this->title == $this->smoothenTitle($title)) {\n $this->articleId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->articleId !== -1) {\n $this->parsedUrl = '/'.$this->articleId.'/'.$this->cat.'/'.$this->title;\n }\n }",
"private function getIssuesPageTitle(): string\n {\n return $this->app->translator->translate('issues.title');\n }",
"public static function findByDefault_lang($default_lang)\n {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from( array(\"m\" => \"main\") ) \n ->where( \"m.default_lang = \" . $default_lang );\n\n return $db->fetchRow($query); \n }",
"function hijack_title(&$text, $url, $title) {\n if (preg_match('/^\\s*<h1>(.*)<\\/h1>(.*)$/sxi', $text, $matches)) {\n $text = $matches[2];\n if (is_null($url)) {\n return '<h1>'.$matches[1].'</h1>';\n } else {\n return '<h1>'.format_link($url, $matches[1], false).'</h1>';\n }\n } else {\n if (is_null($url)) {\n return '<h1>'.html_escape($title).'</h1>';\n } else {\n return '<h1>'.format_link($url, $title).'</h1>';\n }\n }\n}",
"public function getByTitle()\n {\n }",
"public function getTitle(LocalActionInterface $local_action);",
"function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)\n {\n if (Lang::has($key, $locale)) {\n return __($key, $replace, $locale);\n }\n if ($default) {\n if (Str::contains($default, [' ', '.', ':'])) {\n return __($default, $replace, $locale);\n }\n // is probably single word\n return $default;\n }\n return $key;\n }",
"public function getTitle( $path = null ) {\n\t\t$this->_getSiteStruture();\n\t\tif ( is_null( $path ) ) $path = $this->getPath();\n\t\tzc_log( \"Titles ($path) \". print_r( $this->current_titles, true ) );\n\t\treturn isset( $this->current_titles[ $path ] )\n\t\t\t? $this->current_titles[ $path ]\n\t\t\t: $path\n\t\t;\n\t}",
"function getTitle() {\n \n global $pageTitle;\n if(isset($pageTitle)){\n echo $pageTitle;\n } else {\n echo 'Default';\n }\n}",
"function getTitle();",
"function getTitle();",
"function search_results_title() {\r\n if( is_search() ) {\r\n \r\n global $wp_query;\r\n \r\n if( $wp_query->post_count == 1 ) {\r\n $result_title .= '1 search result found';\r\n } else {\r\n $result_title .= 'Showing ' . $wp_query->found_posts . ' results';\r\n }\r\n \r\n $result_title .= \" for “<span style='color:#e83936;'>\" . wp_specialchars($wp_query->query_vars['s'], 1) . \"</span>”\";\r\n \r\n echo $result_title;\r\n \r\n }\r\n}",
"abstract public function getTitle();",
"abstract public function getTitle();"
] | [
"0.698318",
"0.6873713",
"0.6548498",
"0.6530517",
"0.62364787",
"0.6072061",
"0.6068971",
"0.6061084",
"0.5953399",
"0.5827173",
"0.5798541",
"0.57955325",
"0.5781925",
"0.5777224",
"0.57352084",
"0.5724192",
"0.5709532",
"0.5691777",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.5687567",
"0.56620723",
"0.5661049",
"0.56513405",
"0.56293875",
"0.561173",
"0.558413",
"0.5580247",
"0.5547855",
"0.5544643",
"0.5539881",
"0.5530685",
"0.55102015",
"0.55060816",
"0.54741937",
"0.54626137",
"0.5456547",
"0.5448274",
"0.54426",
"0.5433566",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54322106",
"0.54302144",
"0.54298604",
"0.54298604",
"0.54197264",
"0.54105633",
"0.5400349",
"0.5391111",
"0.53896075",
"0.5371073",
"0.5369581",
"0.53600174",
"0.534778",
"0.534371",
"0.5342689",
"0.53400904",
"0.5332793",
"0.5332511",
"0.5331443",
"0.5324934",
"0.5319145",
"0.5299588",
"0.5289495",
"0.52892274",
"0.5274447",
"0.52718425",
"0.52696186",
"0.5262896",
"0.5257029",
"0.52553093",
"0.52494186",
"0.524899",
"0.5240732",
"0.5240732",
"0.524043",
"0.52392656",
"0.52392656"
] | 0.54274994 | 67 |
Search for the default Cat URL Indicator segment based on the currently translated segment. | private function _get_default_cat_url_indicator($url_title)
{
foreach (ee()->publisher_model->languages as $lang_id => $language)
{
if ($language['cat_url_indicator'] == $url_title)
{
return ee()->publisher_model->languages[ee()->publisher_lib->default_lang_id]['cat_url_indicator'];
}
}
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultURLSegment()\n {\n return $this->generateURLSegment(\n _t(\n 'SilverStripe\\CMS\\Controllers\\CMSMain.NEWPAGE',\n 'New {pagetype}',\n [\n 'pagetype' => $this->i18n_singular_name()\n ]\n )\n );\n }",
"public static function Segment($key = null, $default = false)\n\t{\n\t\tstatic $result = null;\n\n\t\tif (is_null($result) === true)\n\t\t{\n\t\t\tif (count($result = explode('/', substr(self::Value($_SERVER, 'PHP_SELF'), strlen(self::Value($_SERVER, 'SCRIPT_NAME'))))) > 0)\n\t\t\t{\n\t\t\t\t$result = array_values(array_filter($result, 'strlen'));\n\t\t\t}\n\t\t}\n\n\t\treturn (isset($key) === true) ? self::Value($result, (is_int($key) === true) ? $key : (array_search($key, $result) + 1), $default) : $result;\n\t}",
"function LookForExistingURLSegment($URLSegment)\n {\n return Company::get()->filter(array('URLSegment' => $URLSegment, 'ID:not' => $this->ID))->first();\n }",
"public function get_cat_url_indicator()\n {\n if(isset(ee()->publisher_model->current_language['cat_url_indicator']) &&\n ee()->publisher_model->current_language['cat_url_indicator'] != '')\n {\n return ee()->publisher_model->current_language['cat_url_indicator'];\n }\n\n return ee()->config->item('reserved_category_word');\n }",
"private function get_category_breaking_segment($segments)\n {\n\n // var_dump($segments);\n }",
"protected function _default_segments()\n\t{\n\t\t// Check for default controller\n\t\tif (empty($this->default_controller))\n\t\t{\n\t\t\t// Return empty array\n\t\t\treturn array();\n\t\t}\n\n\t\t// Break out default controller\n\t\t$default = explode('/', $this->default_controller);\n\t\tif ( ! isset($default[1]))\n\t\t{\n\t\t\t// Add default method\n\t\t\t$default[] = 'index';\n\t\t}\n\n\t\treturn $default;\n\t}",
"private function _get_translated_cat_url_indicator($str, $lang_id_from = NULL, $lang_id_to = NULL)\n {\n $from_language = ee()->publisher_model->languages[$lang_id_from];\n $to_language = ee()->publisher_model->languages[$lang_id_to];\n\n if ($from_language['cat_url_indicator'] == $str)\n {\n return $to_language['cat_url_indicator'];\n }\n\n return FALSE;\n }",
"public function getUrlSegment()\n {\n // Create URL segment if we don't have one.\n if(!$this->url_segment){\n $this->url_segment = str_slug($this->getFullName().' '.$this->id);\n $this->save();\n }\n\n return $this->url_segment;\n }",
"function uriSegment($segment = '')\n {\n $request_uri = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');\n $explode = explode('/', str_replace('index.php/', '', $request_uri));\n\n if(empty($segment)) return '';\n\n if(!empty($explode[($segment-1)]))\n return $explode[($segment-1)];\n else \n return '';\n }",
"static function get_url_segment() {\r\n\t\tself::$url_path;\r\n\t}",
"public function getContentSegment($segment = 'content');",
"function ver_categoria ( $uri ) {\n\tglobal $categorias;\n\t//ver si figura la variable cat en el url, en ese caso es categoria\n\t$cat = isset($_REQUEST['cat']) ? $_REQUEST['cat'] : 'none';\n\n\t$parseUrl = explode('/', $uri);\n\t$RequestURI = $parseUrl[1];\n\n\tfor ($i=0; $i < count($categorias); $i++) { \n\t\tif ( $categorias[$i]['slug'] == $RequestURI ) {\n\t\t$cat = $RequestURI;\n\t\tbreak;\n\t\t}\n\t}\n\n\treturn $cat;\n\n}",
"public function get_default_url_title($url_title, $return = 'url_title')\n {\n // First see if its a Cat URL Indicator translation\n if ($seg = $this->_get_default_cat_url_indicator($url_title))\n {\n return $seg;\n }\n\n $cache_key = 'get_default_url_title/cat'. $url_title .'/'. $return;\n\n // Make sure this query run as few times as possible\n if ( !isset(ee()->session->cache['publisher'][$cache_key]))\n {\n $qry = ee()->db->select('cat_id')\n ->where('cat_url_title', $url_title)\n ->where('publisher_lang_id', ee()->publisher_lib->lang_id)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n if ($qry->num_rows() == 1)\n {\n $cat_id = $qry->row('cat_id');\n\n if ($return == 'cat_id')\n {\n ee()->session->cache['publisher'][$cache_key] = $cat_id;\n }\n else\n {\n $qry = ee()->db->select('cat_url_title')\n ->where('cat_id', $cat_id)\n ->get('categories');\n\n $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;\n\n ee()->session->cache['publisher'][$cache_key] = $url_title;\n }\n }\n }\n\n if (isset(ee()->session->cache['publisher'][$cache_key]))\n {\n return ee()->session->cache['publisher'][$cache_key];\n }\n\n return ($return === FALSE) ? FALSE : $url_title;\n }",
"public function segment($num_segment=NULL){\n\t\t$base_url = $this->site_url();\n\t\t$actual_link = $this->protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$set_parse = str_replace($base_url, $this->protocol() . 'g.g/', $actual_link);\n\t\t$parse_url = parse_url($set_parse, PHP_URL_PATH);\n\t\t$arrPath = explode('/', $parse_url);\n\t\t/*\tmembuat urutan ulang index array. urutan pertama menjadi 1 */\n\n\t\tif($num_segment == NULL){\n\n\t\t\t/* menampilkan semua data array */\n\t\t\treturn $arrPath;\n\t\t} else {\n\n\t\t\t/* chcek jika input data melebihi jumlah array path */\n\t\t\tif(count($arrPath) >= $num_segment){\n\t\t\t\tif(isset($arrPath[$num_segment])){\n\t\t\t\t\treturn $arrPath[$num_segment];\n\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}",
"private function __getCategoryIdFromUrl() {\n return $this->uri->segment( 3, 0 );\n }",
"function urlSegment($int=''){\n $input = get('url');\n $input = explode('/', $input);\n $int--;\n return $input[$int];\n }",
"public function findDefault();",
"function get_segment_name() {\n\tif ( isset( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) ) {\n\t\treturn sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) );\n\t}\n}",
"private function get_default_filter_search() {\n \n //get instance config\n $instance_config = $this->get_settings_config_data();\n \n //if there is saved filters\n if(isset($instance_config) && isset($instance_config->data))\n $search = $this->get_default_search($instance_config->data);//get default\n \n //if a default for instance is found return it\n if($search != null) return $search;\n \n //get global config data for dd_content blocks\n $global_config_data = dd_content_get_admin_config();\n \n //tty to get a default from global\n $search = $this->get_default_search($global_config_data);\n \n //if a default is found return it\n if($search != null) return $search;\n\n //no default is found - return null\n return null;\n \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 static function getFirstSegment(string $uri = null, bool $no_index_path = false, string $index_page_default = NULL){\n $segments = self::segments($uri, $no_index_path, $index_page_default);\n if($segments){\n return array_values($segments)[0];\n }\n return null;\n }",
"private function findTranslationId($segment)\n {\n return array_search($segment, (array) $this->trans());\n }",
"function matchFirstCategory( $menuname, $categories ) {\n # First load and parse the template page \n $content = loadTemplate( $menuname );\n \n # Navigation list\n $breadcrumb = '';\n preg_match_all( \"`<li>\\s*?(.*?)\\s*</li>`\", $content, $matches, PREG_PATTERN_ORDER );\n \n # Look for the first matching category or a default string\n foreach ( $matches[1] as $nav ) {\n $pos = strpos( $nav, DELIM ); // End of category\n if ( $pos !== false ) {\n $cat = trim( substr($nav, 0, $pos) );\n $crumb = trim( substr($nav, $pos + 1) );\n // Is there a match for any of our page's categories? \n if ( $cat == 'default' ) {\n $breadcrumb = $crumb;\n }\n else if ( in_array( $cat, $categories ) ) {\n $breadcrumb = $crumb;\n break;\n }\n }\n }\n \n return normalizeParameters( $breadcrumb, DELIM, 3 );\n}",
"protected function getMappingSegment($className, $segment)\n\t{\n\t\treturn explode('@', $this->mappings[$className])[$segment];\n\t}",
"function rest_get_url_prefix()\n {\n }",
"private function match($categoryNodes, $segment)\n {\n foreach ($categoryNodes as $categoryNode) {\n if ($segment == $categoryNode->id . ':' . $categoryNode->alias) {\n return $categoryNode;\n }\n }\n return null;\n }",
"public function getUrlSegment ()\n {\n $parts = preg_split(\n '/([A-Z]{1}+[a-z]+)|([A-Z])/',\n $this->getClassName(),\n -1,\n PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n );\n\n return strtolower(implode('-', $parts));\n }",
"public static function translate($input = null, $casing = null, $scan_bundles = false)\r\n\t{\r\n\r\n\t\t// Defaults\r\n\t\tif (strlen($scan_bundles) == 0 || $scan_bundles === false)\r\n\t\t\t$scan_bundles = Config::get('breadcrumb::breadcrumb.scan_bundles');\r\n\r\n\t\tif (strlen($casing) == 0 || is_null($casing))\r\n\t\t\t$casing = Config::get('breadcrumb::breadcrumb.default_casing');\r\n\r\n\t\t// Check if an input was given or not and process it if it is necessary\r\n\t\tif (is_array($input))\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = $input;\r\n\t\t}\r\n\t\telseif ($input != null)\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = static::split_uri($input);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = static::split_uri(URI::current());\r\n\t\t}\r\n\r\n\t\t// Translation\r\n\t\tif (is_array(static::$segments_raw) && !empty(static::$segments_raw))\r\n\t\t{\r\n\t\t\t// Clean previous versions\r\n\t\t\tstatic::$segments_translated = null;\r\n\r\n\t\t\tforeach (static::$segments_raw AS $value)\r\n\t\t\t{\r\n\t\t\t\t$key = 'breadcrumb::breadcrumb.' . $value;\r\n\t\t\t\t$tmp = null;\r\n\r\n\t\t\t\t// If the scanning is turned on, and if we find a match\r\n\t\t\t\t// for the current controller's name in the bundles list\r\n\t\t\t\t// then we use it's language settings instead of this\r\n\t\t\t\t// bundle's translations.\r\n\t\t\t\t$controller_name = strtolower(URI::segment(1));\r\n\r\n\t\t\t\t// Case insensitive search, just in case... o.O\r\n\t\t\t\tforeach(\\Bundle::names() AS $bundle_name)\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t// This isn't the greates way of executing a search,\r\n\t\t\t\t\t// but couldn't find a better way to do it at the \r\n\t\t\t\t\t// time this was made....\r\n\t\t\t\t\tif(strtolower($controller_name) == strtolower($bundle_name) && $scan_bundles === true && Lang::has($bundle_name . '::breadcrumb.' . $value))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = Lang::line($bundle_name . '::breadcrumb.' . $value)->get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If it doesn't find a match, then it basically continues\r\n\t\t\t\t// with the translation search in this bundle or falls back.\r\n\t\t\t\tif(is_null($tmp))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (Lang::has($key))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = Lang::line($key)->get();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// Formats\r\n\t\t\t\tswitch ($casing)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'lower':\r\n\t\t\t\t\t\t$tmp = Str::lower($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'upper':\r\n\t\t\t\t\t\t$tmp = Str::upper($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'title':\r\n\t\t\t\t\t\t$tmp = Str::title($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$tmp = Str::lower($tmp);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstatic::$segments_translated[] = $tmp;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new BreadcrumbException('No array provided to work with!');\r\n\t\t}\r\n\t}",
"function culturefeed_search_get_active_search_page() {\n if ($type = culturefeed_get_searchable_type_by_path()) {\n return culturefeed_get_search_page($type);\n }\n}",
"protected function getCurrentSegment(string $seg): string\n {\n if ($seg[0] === '{') {\n return str_replace(['}', '{'], '', $seg);\n }\n\n return $seg;\n }",
"public function isDefaultLocaleHiddenInUrl();",
"function getSegment($n)\n{\n foreach (explode(\"/\", preg_replace(\"|/*(.+?)/*$|\", \"\\\\1\", RURL)) as $val) {\n $val = clearSegment($val);\n if ($val != '') {\n $segments[] = $val;\n }\n }\n\n return isset($segments[$n - 1]) ? $segments[$n - 1] : \"\";\n}",
"function get_segments($ignore_custom_routes=NULL) {\n $psuedo_url = str_replace('://', '', BASE_URL);\n $psuedo_url = rtrim($psuedo_url, '/');\n $bits = explode('/', $psuedo_url);\n $num_bits = count($bits);\n\n if ($num_bits>1) {\n $num_segments_to_ditch = $num_bits-1;\n } else {\n $num_segments_to_ditch = 0;\n }\n\n $assumed_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n if (!isset($ignore_custom_routes)) {\n $assumed_url = attempt_add_custom_routes($assumed_url);\n }\n\n $data['assumed_url'] = $assumed_url;\n\n $assumed_url = str_replace('://', '', $assumed_url);\n $assumed_url = rtrim($assumed_url, '/');\n\n $segments = explode('/', $assumed_url);\n\n for ($i=0; $i < $num_segments_to_ditch; $i++) { \n unset($segments[$i]);\n }\n\n $data['segments'] = array_values($segments); \n return $data;\n}",
"function culturefeed_get_searchable_type_by_path($path = '') {\n if (!$path) {\n $menu_item = menu_get_item();\n $path = $menu_item['path'];\n // If path contains % argument for rss of ajax we use agenda/search\n if ($path == 'agenda/search/%') {\n $path = 'agenda/search';\n }\n }\n foreach (culturefeed_get_searchable_types() as $name => $type) {\n if ($type['path'] == $path) {\n $type['name'] = $name;\n return $type;\n }\n }\n return FALSE;\n}",
"function static_cat_name() {\n global $wp;\n $current_url = home_url(add_query_arg(array(),$wp->request));\n if (stripos($current_url, 'th') !== false) {\n return 'posts-th';\n } else {\n return 'posts';\n }\n}",
"public function getFirstPageUrl();",
"function _culturefeed_search_ui_get_active_search_page() {\n\n $query = drupal_get_query_parameters(NULL, array('q', 'page'));\n $searchable_types = culturefeed_get_searchable_types();\n\n foreach ($searchable_types as $key => $type) {\n\n // Check if this is the current page.\n if ($type['path'] == $_GET['q'] || $type['path'] . '/nojs' == $_GET['q']) {\n\n // If this page has active facets in the info definition. Check if all the facets matches.\n if (!empty($type['active_facets']) && !empty($query['facet'])) {\n $total_requested = count($type['active_facets']);\n $total_matches = 0;\n // Loop through the requested facets, and check if this is active in current search.\n foreach ($type['active_facets'] as $requested_facet => $requested_values) {\n\n // If the requested facet is active. Calculate the intersection, and check if all requested values are in the current page facets.\n if (isset($query['facet'][$requested_facet])) {\n $matches = array_intersect($requested_values, $query['facet'][$requested_facet]);\n if (count($matches) == count($requested_values)) {\n $total_matches++;\n }\n }\n }\n\n // If all the requested facets are found, this type should be default.\n if ($total_matches == $total_requested) {\n return $key;\n }\n\n }\n else {\n return $key;\n }\n\n }\n }\n\n return NULL;\n\n}",
"private function searchRoute()\r\n {\r\n $currentUrl = self::cleanUrl(self::getCurentUrl());\r\n $activeMethod = self::getActiveMethod();\r\n\r\n foreach (array_reverse($this->routes) as $route) {\r\n if (preg_match('/^'.$route['regex'].'$/', $currentUrl) && $activeMethod === $route['method']) {\r\n $route['active'] = $currentUrl;\r\n return $route;\r\n }\r\n }\r\n }",
"public function getDefaultCategory(): string|null;",
"public function getShownLocaleInUri()\n {\n $segment = $this->request->segment(1);\n\n if ($this->isValidLocale($segment)) {\n return $segment;\n }\n\n return null;\n }",
"protected function getCurrentSectionAlias()\n {\n $url = parse_url(URL::current());\n\n $path = explode('/', $url['path']);\n\n if (isset($path[1]) && ! empty($path[1]))\n {\n return $path[1];\n }\n\n if (isset($path[0]) && ! empty($path[0]))\n {\n return $path[0];\n }\n\n return $path[0];\n }",
"public function findIndexOfSlug(string $slug, int|bool $default = false): int|false\n {\n $search = array_keys($this->index, $slug);\n return $search // If search results in a value that is not false\n ? array_shift($search) // Return the value\n : $default; // Else return the default value\n }",
"function _get_item_segments()\n{\n$segments = \"musical/instrument/\";\nreturn $segments;\n\n}",
"public function intended($default = '/');",
"function nebula_url_components($segment=\"all\", $url=null) {\n\tif ( !$url ) {\n\t\t$url = nebula_requested_url();\n\t}\n\n\t$url_compontents = parse_url($url);\n\tif ( empty($url_compontents['host']) ) {\n\t\treturn;\n\t}\n\t$host = explode('.', $url_compontents['host']);\n\n\t//Best way to get the domain so far. Probably a better way by checking against all known TLDs.\n\tpreg_match(\"/[a-z0-9\\-]{1,63}\\.[a-z\\.]{2,6}$/\", parse_url($url, PHP_URL_HOST), $domain);\n\t$sld = substr($domain[0], 0, strpos($domain[0], '.'));\n\t$tld = substr($domain[0], strpos($domain[0], '.'));\n\n\tswitch ($segment) {\n\t\tcase ('all') :\n\t\t\treturn $url;\n\t\t\tbreak;\n\n\t\tcase ('protocol') : //Protocol and Scheme are aliases and return the same value.\n\t\tcase ('scheme') : //Protocol and Scheme are aliases and return the same value.\n\t\tcase ('schema') :\n\t\t\tif ( $url_compontents['scheme'] != '' ) {\n\t\t\t\treturn $url_compontents['scheme'];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('host') : //In http://something.example.com the host is \"something.example.com\"\n\t\tcase ('hostname') :\n\t\t\treturn $url_compontents['host'];\n\t\t\tbreak;\n\n\t\tcase ('www') :\n\t\t\tif ( $host[0] == 'www' ) {\n\t\t\t\treturn 'www';\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('subdomain') :\n\t\tcase ('sub_domain') :\n\t\t\tif ( $host[0] != 'www' && $host[0] != $sld ) {\n\t\t\t\treturn $host[0];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('domain') : //In http://example.com the domain is \"example.com\"\n\t\t\treturn $domain[0];\n\t\t\tbreak;\n\n\t\tcase ('basedomain') : //In http://example.com/something the basedomain is \"http://example.com\"\n\t\tcase ('base_domain') :\n\t\t\treturn $url_compontents['scheme'] . '://' . $domain[0];\n\t\t\tbreak;\n\n\t\tcase ('sld') : //In example.com the sld is \"example\"\n\t\tcase ('second_level_domain') :\n\t\tcase ('second-level_domain') :\n\t\t\treturn $sld;\n\t\t\tbreak;\n\n\t\tcase ('tld') : //In example.com the tld is \".com\"\n\t\tcase ('top_level_domain') :\n\t\tcase ('top-level_domain') :\n\t\t\treturn $tld;\n\t\t\tbreak;\n\n\t\tcase ('filepath') : //Filepath will be both path and file/extension\n\t\t\treturn $url_compontents['path'];\n\t\t\tbreak;\n\n\t\tcase ('file') : //Filename will be just the filename/extension.\n\t\tcase ('filename') :\n\t\t\tif ( contains(basename($url_compontents['path']), array('.')) ) {\n\t\t\t\treturn basename($url_compontents['path']);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('path') : //Path should be just the path without the filename/extension.\n\t\t\tif ( contains(basename($url_compontents['path']), array('.')) ) { //@TODO \"Nebula\" 0: This will possibly give bad data if the directory name has a \".\" in it\n\t\t\t\treturn str_replace(basename($url_compontents['path']), '', $url_compontents['path']);\n\t\t\t} else {\n\t\t\t\treturn $url_compontents['path'];\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase ('query') :\n\t\tcase ('queries') :\n\t\t\treturn $url_compontents['query'];\n\t\t\tbreak;\n\n\t\tdefault :\n\t\t\treturn $url;\n\t\t\tbreak;\n\t}\n}",
"static function get_segment($id){\n\t\t$start_marker = \"#zazzle_acc_start \".$id;\n\t\t$end_marker = \"#zazzle_acc_end \".$id.\"\\n\";\n\t\t\n\t\t$start = strpos(self::$FDATA, $start_marker);\n\t\t$end = strpos(self::$FDATA, $end_marker);\n\t\t\n\t\t//echo \"--Start: \".$start.\"<br>\";\n\t\t//echo \"--End: \".$end.\"<br>\";\n\t\t\n\t\tif($start === false){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$segment = substr(self::$FDATA, $start, $end - $start +strlen($end_marker));\n\t\t//echo \"--Segment: \".$segment.\"<br>\";\n\t\treturn $segment;\n\t}",
"function _get_items_segments()\n{\n$segments = \"music/instruments/\";\nreturn $segments;\n\n}",
"function current_controller($param = '') {\n $param = '/' . $param;\n $CI = & get_instance();\n $dir = $CI->router->directory;\n $class = $CI->router->fetch_class();\n return base_url() . $dir . $class . $param;\n}",
"abstract protected function getDefaultPrefix(): string;",
"public function getCurrentAlias()\n {\n return rtrim(\\Yii::$app->request->get('nodes'), '/') ?: $this->defaultAlias;\n }",
"private function get_search_page() {\n\t\tif ( ! $this->is_template_supported( 'is_search' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn add_query_arg( 's', 'example', home_url( '/' ) );\n\t}",
"protected static function lookup($segments) {\n $items = &static::$items;\n\n foreach($segments as $step) {\n if (is_array($items) && array_key_exists($step, $items)) {\n $items = &$items[$step]; \n } else {\n return null;\n }\n }\n\n return $items;\n }",
"public function setCategory() {\n /**\n *\n * @todo make a separate config file for the default category ?!\n */\n $defaultCategory = 1;\n $category = Category::find()->all();\n $newCat = $this->strProcessing($this->category);\n $k = NULL;\n if (!empty($newCat)) {\n foreach ($category as $value) {\n $cat = explode(',', $value['synonyms']);\n $cat = array_map(array($this, 'strProcessing'), $cat);\n $k = array_search($newCat, $cat);\n if ($k !== NULL && $k !== FALSE) {\n $k = $value['id'];\n break;\n }\n }\n }\n if ($k) {\n $this->category = $k;\n } else {\n $this->category = $defaultCategory;\n }\n return TRUE;\n }",
"function URLSegment() {\n\t\treturn $this->getForumHolder()->URLSegment;\n\t}",
"function getCurrentPage($where){\n $currentPage = filter_input(INPUT_GET, $where, FILTER_SANITIZE_STRING);\n $currentPage = (empty($currentPage)) ? 'home' : $currentPage;\n return $currentPage;\n}",
"function get_network_by_path($domain, $path, $segments = \\null)\n {\n }",
"public function testFindDefault()\n {\n $data = array(\n 'customerId' => '33160580-3e25-49f4-b01c-274634cb3011'\n );\n $this->resource->findDefault($data);\n\n $this->assertAttributeEquals(BASE_URL, 'base_url', $this->connector, 'Failed. Base url not correct');\n $this->assertAttributeEquals('GET', 'method', $this->connector, 'Failed. Method is not correct');\n $this->assertAttributeEquals('paymentmethods/default?' . http_build_query($data), 'url', $this->connector, 'Failed. Url is not correct');\n\n }",
"public function getSegment($key);",
"public static function findByDefault_lang($default_lang)\n {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from( array(\"m\" => \"main\") ) \n ->where( \"m.default_lang = \" . $default_lang );\n\n return $db->fetchRow($query); \n }",
"public function getCategoryDefault($needle)\n {\n $defaults = $this->getCategoryDefaults();\n\n if (array_key_exists($needle, $defaults)) {\n return $defaults[$needle];\n }\n\n return null;\n }",
"function get_complex_base_url($at)\n{\n return ((get_forum_base_url() != get_base_url()) ? get_forum_base_url() : ((substr($at, 0, 22) === 'themes/default/images/') ? get_base_url() : get_custom_base_url()));\n}",
"private function lookup($word) {\n\n $query = $this->dm->getRepository('\\FYP\\Database\\Documents\\Lexicon');\n $result = $query->findOneBy(array('phrase' => $word));\n if (empty($result)) {\n $result = $query->findOneBy(array('phrase' => strtolower($word)));\n }\n\n if (empty($result)) {\n return self::DEFAULT_TAG;\n } else {\n return $result->getTags()[0];\n }\n\n }",
"function active_for($url)\n{\n $url = ltrim(URL::makeRelative($url), '/');\n\n return app()->request->is($url) ? 'selected' : '';\n}",
"public function getStringForDefault($string);",
"public function getForSavedSearches()\n\t{\n##if @BUILDER.strSavedSearchesConnectionID.len##\n\t\treturn $this->byId( \"##@BUILDER.strSavedSearchesConnectionID s##\" );\n##else##\t\t\n\t\treturn $this->getDefault();\n##endif##\n\t}",
"public function prependSegment(Stringable|string $segment): static\n {\n return new static(static::normalizePath($this->uri, HierarchicalPath::fromUri($this->uri)->prepend($segment)));\n }",
"function segment($index){\n\t\t\tif(!empty($this->path[$index-1])){\n\t\t\t return $this->path[$index-1];\n\t\t\t}else{ \n\t\t\t return false;\n\t\t\t}\n\t\t}",
"public function segment(int $n, $fallback = null) : ?string;",
"public function findDefault(): AudienceInterface;",
"public function pathAliasCallback() {\n $args = func_get_args();\n switch($args[0]) {\n case '/content/first-node':\n return '/node/1';\n case '/content/first-node-test':\n return '/node/1/test';\n case '/malicious-path':\n return '/admin';\n case '':\n return '<front>';\n default:\n return $args[0];\n }\n }",
"public static function find_default()\n\t{\n\t\t// All supported languages\n\t\t$langs = (array) Kohana::$config->load('lang');\n\n\t\t// Look for language cookie first\n\t\tif ($lang = Cookie::get(Lang::$cookie))\n\t\t{\n\t\t\t// Valid language found in cookie\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\n\t\t\t// Delete cookie with invalid language\n\t\t\tCookie::delete(Lang::$cookie);\n\t\t}\n\n\t\t// Parse HTTP Accept-Language headers\n\t\tforeach (Request::accept_lang() as $lang => $quality)\n\t\t{\n\t\t\t// Return the first language found (the language with the highest quality)\n\t\t\tif (isset($langs[$lang]))\n\t\t\t\treturn $lang;\n\t\t}\n\n\t\t// Return the hard-coded default language as final fallback\n\t\treturn Lang::$default;\n\t}",
"function getSelectedAdTag() {\n\treturn constant($_GET['adTag']);\n}",
"function PageByDefaultLocale($pageURL){\n\t\t$defLoc = Translatable::default_locale();\n\t\tif($pg = Translatable::get_one_by_locale('Page', $defLoc, \"URLSegment = '{$pageURL}'\")) return $pg;\n\t\t\n\t\treturn null;\n\t}",
"public static function uriProcessorResourceNotFound($segment)\n {\n return 'Resource not found for the segment \\'' . $segment . '\\'.';\n }",
"public function getSearchDefaults()\r\n {\r\n if (! $this->defaultSearchData) {\r\n $orgId = $this->currentOrganization->getId();\r\n $this->defaultSearchData[-1] = \"((gsu_insertable = 1 AND gsu_insert_organizations LIKE '%|$orgId|%') OR\r\n EXISTS\r\n (SELECT gro_id_track FROM gems__tracks INNER JOIN gems__rounds ON gtr_id_track = gro_id_track\r\n WHERE gro_id_survey = gsu_id_survey AND gtr_organizations LIKE '%|$orgId|%'\r\n ))\";\r\n }\r\n\r\n return parent::getSearchDefaults();\r\n }",
"public function getActivePageSlug()\n {\n $url = wp_parse_url( $this->getServerVar( 'REQUEST_URI' ) );\n\n if ( ! isset( $url['path'] ) ) return false;\n\n $url = explode( '/', untrailingslashit( $url['path'] ) );\n $offset = count( $url ) - 1;\n\n $url_offset = isset( $url[ $offset ] ) ? $url[ $offset ] : '';\n return sanitize_key( $url_offset );\n }",
"function getParam($str)\r\n\t{\r\n\t\t$pos =strpos($str, $this->_BASEURL);\r\n\r\n\t\tif ($pos < 0)\r\n\t\t\treturn null;\r\n\r\n\t\t$temp = explode($this->_BASEURL.\"index.php\", $str);\r\n\r\n\t\tif (count($temp) == 2)\r\n\t\t{\r\n\t\t\t$p = $temp[1];\r\n\r\n\t\t\t//file check\r\n\t\t\tif (strpos(strtolower($p), \".\") > -1)\r\n\t\t\t\treturn null;\r\n\r\n\t\t\tif (strlen($p) == 0)\r\n\t\t\t\treturn \"Default\";\r\n\r\n\t\t\t$p = substr($p, -1,1) == \"/\" ? substr($p, 0, -1):$p;\r\n\t\t\t\r\n\t\t\treturn substr($p, 0, 1) == \"/\" ? substr($p, 1):$p;\r\n\t\t}\r\n\r\n\t}",
"protected function urlSegmentMatch($get, $num = 0) {\n\t\t\n\t\tif(empty($get) && $num > 0) {\n\t\t\treturn isset($this->urlSegments[$num]) ? $this->urlSegments[$num] : '';\n\t\t}\n\t\t\n\t\t$eqPos = strpos($get, '=');\n\t\tif($eqPos !== false) $get = trim($get, '=');\n\t\tlist($matchBefore, $matchAfter) = array($eqPos === 0, $eqPos > 0);\n\t\n\t\t// check if $get has wildcard or regex\n\t\t$regex = $this->patternToRegex($get);\n\t\t$match = '';\n\t\t$index = 0;\n\n\t\tif($regex) {\n\t\t\t// find matching URL segment and return it\n\t\t\tforeach($this->urlSegments as $index => $segment) {\n\t\t\t\tif($num > 0 && $index !== $num) continue;\n\t\t\t\t$match = $this->patternMatchesValue($regex, $segment);\n\t\t\t\tif($match !== '') break;\n\t\t\t}\n\t\t\tif($match === '') $index = 0;\n\t\t\t\n\t\t} else {\n\t\t\t// return index where segment is found\n\t\t\tif($num > 0) {\n\t\t\t\t// apply only to specific URL segment and return bool\n\t\t\t\t$match = isset($this->urlSegments[$num]) && $this->urlSegments[$num] === $get;\n\t\t\t\t$index = $match ? $num : 0;\n\t\t\t} else {\n\t\t\t\t// search all URL segments and return index\n\t\t\t\t$match = (int) array_search($get, $this->urlSegments);\n\t\t\t\t$index = $match;\n\t\t\t}\n\t\t}\n\t\n\t\t// adjust to use urlSegment before or after when requested\n\t\tif($matchBefore) {\n\t\t\t$match = $index > 1 ? $this->urlSegments[$index-1] : '';\n\t\t} else if($matchAfter) {\n\t\t\t$match = isset($this->urlSegments[$index+1]) ? $this->urlSegments[$index+1] : '';\n\t\t}\n\n\t\treturn $match;\n\t}",
"public function hasContentSegment($segment);",
"public function Loading($request,$category)\n {\n $idem = Search::whereKeywords(strtolower($request))->get()->count();\n\n\n if($idem == 0)\n {\n $this->search_ = new Search([\n 'keywords' => strtolower($request)\n ]);\n $user = Auth::user();\n $this->search_->user()->associate($user);\n $this->search_->save();\n }\n else\n {\n $this->search_ = Search::whereKeywords(strtolower($request))->get()->first();\n switch ($category) {\n case \"all\":\n if($this->eager)\n {\n $this->searchResultsDB = $this->assign($this->search_->searchResults_A);\n }\n else\n {\n $this->searchResults = $this->assign($this->search_->searchResults_A);\n }\n\n break;\n case \"social\":\n if($this->eager)\n {\n $this->searchResultsDB = $this->assign($this->search_->searchResults_S);\n }\n else\n {\n $this->searchResults = $this->assign($this->search_->searchResults_S);\n }\n break;\n case \"images\":\n if($this->eager)\n {\n $this->searchResultsDB = $this->assign($this->search_->searchResults_I);\n }\n else\n {\n $this->searchResults = $this->assign($this->search_->searchResults_I);\n }\n break;\n case \"video\":\n if($this->eager)\n {\n $this->searchResultsDB = $this->assign($this->search_->searchResults_V);\n }\n else\n {\n $this->searchResults = $this->assign($this->search_->searchResults_V);\n }\n break;\n case \"document\":\n if($this->eager)\n {\n $this->searchResultsDB = $this->assign($this->search_->searchResults_D);\n }\n else\n {\n $this->searchResults = $this->assign($this->search_->searchResults_D);\n }\n break;\n default:\n if($this->eager)\n {\n $this->searchResultsDB = $this->assign($this->search_->searchResults_A);\n }\n else\n {\n $this->searchResults = $this->assign($this->search_->searchResults_A);\n }\n }\n\n\n // print_r($this->searchResults);\n }\n }",
"function taxonomy_nav_url($url, $tax, $term) {\n \tif ( $section_term = get_query_var('medium') ) {\n \t\t$section = 'medium';\n \t}\n \telse if ( $section_term = get_query_var('time') ) {\n \t\t$section = 'time';\n \t}\n\n \tif ($section ) {\n \t\t$url = add_query_arg( array( $section => $section_term, $tax->query_var => $term->slug ), get_post_type_archive_link( 'collections' ) );\n \t}\n \t// else if ( !$term && $section ) {\n\n \t// }\n \telse {\n \t\t$url = add_query_arg( array($tax->query_var => $term->slug), get_permalink( get_option('page_for_posts' ) ) );\n \t}\n\n \treturn $url;\n }",
"public function get($index = null, $default = false) {\n\t\tif (!is_null($index)) {\n\n\t\t\t// the model is defined by the first element in the uri - so 'model' returns the 0 index.\n\t\t\tif ($index == 'model') return $this->path[0];\n\n\t\t\t// return the full uri as a string.\n\t\t\tif ($index == 'full') {\n\t\t\t\t// remove the query string from the uri. (preg_replace will generally be fastest)\n return preg_replace('/\\?(?!.*\\?)\\S+/', '', implode('/',$this->path));\n\t\t\t}\n\n if (isset($this->path[$index]) && $this->path[$index] != '') {\n \t// remove the query string from the specified uri segment.\n return preg_replace('/\\?(?!.*\\?)\\S+/', '', $this->path[$index]);\n }\n else return $default;\n }\n // return the path as an array.\n else return $this->path;\n\t}",
"public function getFallbackCatalogue();",
"public function lookupIndex(string $label)\n {\n return $this->labels[$label] ?? null;\n }",
"public static function get($key, $default = null) {\n $segments = explode('.', $key);\n\n // Check to see if the value is already loaded.\n $value = static::lookup($segments);\n if ($value !== null) return $value;\n\n if (count($segments) < 3) return $default;\n\n // Attempt a 'lazy load' if the key has at least 3 segments.\n if (!static::load($segments)) return $default;\n\n // Recheck for the setting.\n $value = static::lookup($segments);\n return $value !== null ? $value : $default;\n }",
"public static function getAllSegments()\n {\n $segments = explode('/', trim(parse_url(self::$__uri)['path'], '/'));\n array_unshift($segments, 'zero_segment');\n return $segments;\n }",
"function _wp_filter_taxonomy_base($base)\n {\n }",
"public function testGetSegmentsDefault(): void\n {\n self::assertNull($this->class->getSegments());\n }",
"public function SearchByName(Request $request)\n\t{\n\t\t$searchString = trim(Input::get('searchString'));\n\t\t$negative = false;\n\t\t$primary = false;\n\t\t$secondary = false;\n\t\t$searchClassifier = null;\n\t\t\n\t\t//Pull the negative out\n\t\tif ($searchString[0] == \"-\")\n\t\t{\n\t\t\t$negative = true;\n\t\t\t$searchString = trim(substr($searchString, 1));\n\t\t}\n\t\t\n\t\t//Pull primary and secondary out\n\t\t$flag_marker = strpos($searchString, ':');\n\t\tif ($flag_marker !== false)\n\t\t{\n\t\t\t$flag = strtolower(substr($searchString, 0, $flag_marker));\n\t\t\t\n\t\t\tif ($flag == \"primary\")\n\t\t\t{\n\t\t\t\t$primary = true;\n\t\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t\t}\n\t\t\telse if ($flag == \"secondary\")\n\t\t\t{\n\t\t\t\t$secondary = true;\n\t\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//Pull targeting out\n\t\t$flag_marker = strpos($searchString, ':');\n\t\tif ($flag_marker !== false)\n\t\t{\n\t\t\t//Get the contents before the \":\" to check for search clarifiers\n\t\t\t$searchClassifier = strtolower(substr($searchString, 0, $flag_marker));\n\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t}\n\t\t\n\t\t$values = array();\n\t\tif ($searchClassifier == \"artist\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::ArtistLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"artist:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"character\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::CharacterLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"character:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"scanalator\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::ScanalatorLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"series\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::SeriesLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"series:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"tag\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::TagLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"tag:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"language\")\n\t\t{\n\t\t\t$languages = Language::where('languages.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'languages.id', '=', 'collections.language_id')->select('languages.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($languages as $language)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($language, \"language:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"rating\")\n\t\t{\n\t\t\t$ratings = Rating::where('ratings.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'ratings.id', '=', 'collections.rating_id')->select('ratings.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($ratings as $rating)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($rating, \"rating:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"status\")\n\t\t{\n\t\t\t$statuses = Status::where('statuses.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'statuses.id', '=', 'collections.status_id')->select('statuses.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($statuses as $status)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($status, \"status:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\t\n\t\t\t//Get artists with total\n\t\t\t$artists = Artist::where('artists.name', 'like', '%' . $searchString . '%')->leftjoin('artist_collection', 'artists.id', '=', 'artist_collection.artist_id')->select('artists.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$artists = $artists->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"artist:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global artist aliases with total\n\t\t\t$global_artist_aliases = ArtistAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('artists', 'artists.id', '=', 'artist_alias.artist_id')->leftjoin('artist_collection', 'artists.id', '=', 'artist_collection.artist_id')->select('artist_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_artist_aliases = $global_artist_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"artist:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get characters with total\n\t\t\t$characters = Character::where('characters.name', 'like', '%' . $searchString . '%')->leftjoin('character_collection', 'characters.id', '=', 'character_collection.character_id')->select('characters.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$characters = $characters->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"character:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\n\t\t\t//Get global character aliases with total\n\t\t\t$global_character_aliases = CharacterAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('characters', 'characters.id', '=', 'character_alias.character_id')->leftjoin('character_collection', 'characters.id', '=', 'character_collection.character_id')->select('character_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$global_character_aliases = $global_character_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"character:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\n\t\t\t//Get scanalators with total\n\t\t\t$scanalators = Scanalator::where('scanalators.name', 'like', '%' . $searchString . '%')->leftjoin('chapter_scanalator', 'scanalators.id', '=', 'chapter_scanalator.scanalator_id')->select('scanalators.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$scanalators = $scanalators->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global scanalator aliases with total\n\t\t\t$global_scanalator_aliases = ScanalatorAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('scanalators', 'scanalators.id', '=', 'scanalator_alias.scanalator_id')->leftjoin('chapter_scanalator', 'scanalators.id', '=', 'chapter_scanalator.scanalator_id')->select('scanalator_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_scanalator_aliases = $global_scanalator_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get series with total\n\t\t\t$series = Series::where('series.name', 'like', '%' . $searchString . '%')->leftjoin('collection_series', 'series.id', '=', 'collection_series.series_id')->select('series.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$series = $series->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"series:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global series aliases with total\n\t\t\t$global_series_aliases = SeriesAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('series', 'series.id', '=', 'series_alias.series_id')->leftjoin('collection_series', 'series.id', '=', 'collection_series.series_id')->select('series_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_series_aliases = $global_series_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"series:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\n\t\t\t//Get global tags with total\n\t\t\t$tags = Tag::where('tags.name', 'like', '%' . $searchString . '%')->leftjoin('collection_tag', 'tags.id', '=', 'collection_tag.tag_id')->select('tags.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$tags = $tags->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"tag:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global tag aliases with total\n\t\t\t$global_tag_aliases = TagAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('tags', 'tags.id', '=', 'tag_alias.tag_id')->leftjoin('collection_tag', 'tags.id', '=', 'collection_tag.tag_id')->select('tag_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_tag_aliases = $global_tag_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"tag:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$languages = Language::where('languages.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'languages.id', '=', 'collections.language_id')->select('languages.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$languages = $languages->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"language:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$ratings = Rating::where('ratings.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'ratings.id', '=', 'collections.rating_id')->select('ratings.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$ratings = $ratings->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"rating:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$statuses = Status::where('statuses.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'statuses.id', '=', 'collections.status_id')->select('statuses.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$statuses = $statuses->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"status:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$matches = collect();\n\t\t\t$matches->push($artists);\n\t\t\t$matches->push($global_artist_aliases);\n\t\t\t$matches->push($characters);\n\t\t\t$matches->push($global_character_aliases);\n\t\t\t$matches->push($scanalators);\n\t\t\t$matches->push($global_scanalator_aliases);\n\t\t\t$matches->push($series);\n\t\t\t$matches->push($global_series_aliases);\n\t\t\t$matches->push($tags);\n\t\t\t$matches->push($global_tag_aliases);\n\t\t\t$matches->push($languages);\n\t\t\t$matches->push($ratings);\n\t\t\t$matches->push($statuses);\t\t\t\n\t\t\n\t\t\t$matches = $matches->flatten(1);\n\t\t\t$matches = $matches->sortByDesc('total');\n\t\t\t$typeAheadCollection = $matches->take(5)->pluck('name');\n\t\t\n\t\t\t$typeAheadCollection = $typeAheadCollection->sort();\n\t\t\t\n\t\t\tforeach ($typeAheadCollection as $typeAhead)\n\t\t\t{\n\t\t\t\tarray_push($values, ['value' => $typeAhead, 'label' => $typeAhead]);\n\t\t\t}\t \n\t\t}\n\t\t\n\t\treturn $values;\n\t}",
"function attempt_add_custom_routes($target_url) {\n\n $target_segment = str_replace(BASE_URL, '', $target_url);\n\n\n foreach (CUSTOM_ROUTES as $key => $value) {\n\n if ($key == $target_segment) {\n $target_url = str_replace($key, $value, $target_url);\n }\n }\n\n return $target_url;\n}",
"function rnf_postie_default_trip_category($category) {\n // Geo functions are provided by the rnf-geo plugin, check for it:\n if (!function_exists('rnf_geo_current_trip')) {\n return $category;\n }\n\n // Get the current trip\n $current = rnf_geo_current_trip();\n\n // If there is one _and_ it has an associated category, pass its ID\n if ($current && !empty($current->wp_category)) {\n return $current->wp_category->term_id;\n }\n\n return $category;\n}",
"function CrowdfundingParseRoute($segments)\n{\n $total = count($segments);\n $vars = array();\n\n for ($i = 0; $i < $total; $i++) {\n $segments[$i] = preg_replace('/-/', ':', $segments[$i], 1);\n }\n\n //Get the active menu item.\n $app = JFactory::getApplication();\n $menu = $app->getMenu();\n $item = $menu->getActive();\n\n // Count route segments\n $count = count($segments);\n\n // Standard routing for articles. If we don't pick up an Itemid then we get the view from the segments\n // the first segment is the view and the last segment is the id of the details, category or payment.\n if (!isset($item)) {\n $vars['view'] = $segments[0];\n $vars['id'] = $segments[$count - 1];\n\n return $vars;\n }\n\n // COUNT == 1\n\n // Category\n if ($count == 1) {\n\n // We check to see if an alias is given. If not, we assume it is a project,\n // because categories have always alias.\n // If it is a menu item \"Details\" that could be one of its specific views - backing, embed,...\n if (false == strpos($segments[0], ':')) {\n\n switch ($segments[0]) {\n\n case \"backing\":\n case \"embed\":\n\n $id = $item->query[\"id\"];\n $project = CrowdfundingHelperRoute::getProject($id);\n\n $vars['view'] = $segments[0];\n $vars['catid'] = (int)$project[\"catid\"];\n $vars['id'] = (int)$project[\"id\"];\n\n break;\n\n default:\n $vars['view'] = 'details';\n $vars['id'] = (int)$segments[0];\n break;\n }\n\n return $vars;\n }\n\n list($id, $alias) = explode(':', $segments[0], 2);\n $alias = str_replace(\":\", \"-\", $alias);\n\n // first we check if it is a category\n $category = JCategories::getInstance('Crowdfunding')->get($id);\n\n if ($category and (strcmp($category->alias, $alias) == 0)) {\n $vars['view'] = 'category';\n $vars['id'] = $id;\n\n return $vars;\n } else {\n $project = CrowdfundingHelperRoute::getProject($id);\n if (!empty($project)) {\n if ($project[\"alias\"] == $alias) {\n\n $vars['view'] = 'details';\n $vars['catid'] = (int)$project[\"catid\"];\n $vars['id'] = (int)$id;\n\n return $vars;\n }\n }\n }\n\n }\n\n // COUNT >= 2\n\n if ($count >= 2) {\n\n $view = $segments[$count - 1];\n\n switch ($view) {\n\n case \"backing\":\n\n $itemId = (int)$segments[$count - 2];\n\n // Get catid from menu item\n if (!empty($item->query[\"id\"])) {\n $catId = (int)$item->query[\"id\"];\n } else {\n $catId = (int)$segments[$count - 3];\n }\n\n $vars['view'] = 'backing';\n $vars['id'] = (int)$itemId;\n $vars['catid'] = (int)$catId;\n\n break;\n\n case \"embed\": // Backing without reward\n\n $itemId = (int)$segments[$count - 2];\n\n // Get catid from menu item\n if (!empty($item->query[\"id\"])) {\n $catId = (int)$item->query[\"id\"];\n } else {\n $catId = (int)$segments[$count - 3];\n }\n\n $vars['view'] = 'embed';\n $vars['id'] = (int)$itemId;\n $vars['catid'] = (int)$catId;\n\n break;\n\n case \"updates\": // Screens of details - \"updates\", \"comments\", \"funders\"\n case \"comments\":\n case \"funders\":\n\n $itemId = (int)$segments[$count - 2];\n\n // Get catid from menu item\n if (!empty($item->query[\"id\"])) {\n $catId = (int)$item->query[\"id\"];\n } else {\n $catId = (int)$segments[$count - 3];\n }\n\n $vars['view'] = 'details';\n $vars['id'] = (int)$itemId;\n $vars['catid'] = (int)$catId;\n\n // Get screen\n $screen = $segments[$count - 1];\n $allowedScreens = array(\"updates\", \"comments\", \"funders\");\n if (in_array($screen, $allowedScreens)) {\n $vars['screen'] = $screen;\n }\n\n break;\n\n default:\n\n // if there was more than one segment, then we can determine where the URL points to\n // because the first segment will have the target category id prepended to it. If the\n // last segment has a number prepended, it is details, otherwise, it is a category.\n $catId = (int)$segments[$count - 2];\n $id = (int)$segments[$count - 1];\n\n if ($id > 0 and $catId > 0) {\n $vars['view'] = 'details';\n $vars['catid'] = $catId;\n $vars['id'] = $id;\n } else {\n $vars['view'] = 'category';\n $vars['id'] = $id;\n }\n\n break;\n\n }\n\n }\n\n return $vars;\n}",
"function get($path=null, $default=null)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t\n\t\t\tif ($path==null) return $this->settings;\n\t\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$tmp = $this->settings;\n\t\t\tforeach($path as $pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\tif (!isset($tmp[$pointer])){\n\t\t\t\t\t\treturn $default;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = $tmp[$pointer];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $tmp;\n\t\t}",
"function _wp_translate_php_url_constant_to_key($constant)\n {\n }",
"private function dajImeKontrolera()\n {\n $segmenti = explode('\\\\', get_class($this));\n $kontroler = end($segmenti);\n\n if (substr($kontroler, -9) == 'Kontroler') {\n return substr($kontroler, 0, -9);\n }\n\n return $kontroler;\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}",
"private function initUrlProcess() {\n $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $urld = urldecode($url);\n $url = trim(str_replace($this->subdir, \"\", $urld), '/');\n\n // Redirect index aliases\n if (in_array($url, ['home', 'index', 'index.php'])) {\n redirect($this->subdir, 301);\n }\n\n $this->url = $url;\n $this->segments = empty($url) ? [] : explode('/', $url);\n }",
"public function loadDefaults()\n {\n $this->addSe('*.google.*', 'q');\n $this->addSe('*.yahoo.*', 'p');\n $this->addSe('*.live.*', 'q');\n $this->addSe('*.bing.*', 'q');\n $this->addSe('*.aolsvc.*', 'q');\n $this->addSe('suche.webfan.de', 'q');\n }",
"function find_id_moniker($url_parts, $zone, $search_redirects = true)\n{\n if (!isset($url_parts['page'])) {\n return null;\n }\n\n $page = $url_parts['page'];\n\n if (strpos($page, '[') !== false) {\n return null; // A regexp in a comparison URL, in breadcrumbs code\n }\n if ($zone == '[\\w\\-]*') {\n return null; // Part of a breadcrumbs regexp\n }\n\n // Does this URL arrangement support monikers?\n global $CONTENT_OBS;\n if ($CONTENT_OBS === null) {\n load_moniker_hooks();\n }\n if (!array_key_exists('id', $url_parts)) {\n if (($page != 'start'/*TODO: Change in v11*/) && (@is_file(get_file_base() . '/' . $zone . (($zone == '') ? '' : '/') . 'pages/modules/' . $page . '.php'))) { // Wasteful of resources\n return null;\n }\n if (($zone == '') && (get_option('collapse_user_zones') == '1')) {\n if (@is_file(get_file_base() . '/site/pages/modules/' . $page . '.php')) {// Wasteful of resources\n return null;\n }\n }\n\n // Moniker may be held the other side of a redirect\n if (!function_exists('_request_page')) {\n return null; // In installer\n }\n if ($search_redirects) {\n $page_place = _request_page(str_replace('-', '_', $page), $zone);\n if ($page_place[0] == 'REDIRECT') {\n $page = $page_place[1]['r_to_page'];\n $zone = $page_place[1]['r_to_zone'];\n }\n }\n\n $url_parts['type'] = '';\n $effective_id = $zone;\n $url_parts['id'] = $zone;\n\n $looking_for = '_WILD:_WILD';\n } else {\n if (!isset($url_parts['type'])) {\n $url_parts['type'] = 'browse';\n }\n if ($url_parts['type'] === null) {\n $url_parts['type'] = 'browse'; // null means \"do not take from environment\"; so we default it to 'browse' (even though it might actually be left out when URL Schemes are off, we know it cannot be for URL Schemes)\n }\n\n if ($url_parts['id'] === null) {\n return null;\n }\n\n global $REDIRECT_CACHE;\n if ((isset($REDIRECT_CACHE[$zone][strtolower($page)])) && ($REDIRECT_CACHE[$zone][strtolower($page)]['r_is_transparent'] === 1)) {\n $new_page = $REDIRECT_CACHE[$zone][strtolower($page)]['r_to_page'];\n $new_zone = $REDIRECT_CACHE[$zone][strtolower($page)]['r_to_zone'];\n $page = $new_page;\n $zone = $new_zone;\n }\n\n $effective_id = $url_parts['id'];\n\n $looking_for = '_SEARCH:' . $page . ':' . $url_parts['type'] . ':_WILD';\n }\n $ob_info = isset($CONTENT_OBS[$looking_for]) ? $CONTENT_OBS[$looking_for] : null;\n if ($ob_info === null) {\n return null;\n }\n\n if ($ob_info['id_field_numeric']) {\n if (!is_numeric($effective_id)) {\n return null;\n }\n } else {\n if (strpos($effective_id, '/') !== false) {\n return null;\n }\n }\n\n if ($ob_info['support_url_monikers']) {\n global $SMART_CACHE;\n if ($SMART_CACHE !== null) {\n $SMART_CACHE->append('NEEDED_MONIKERS', serialize(array(array('page' => $page, 'type' => $url_parts['type']), $zone, $effective_id)));\n }\n\n // Has to find existing if already there\n global $LOADED_MONIKERS_CACHE;\n if (isset($LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id])) {\n if (is_bool($LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id])) { // Ok, none pre-loaded yet, so we preload all and replace the boolean values with actual results\n $or_list = '';\n foreach ($LOADED_MONIKERS_CACHE as $type => $pages) {\n foreach ($pages as $_page => $ids) {\n $first_it = true;\n\n foreach ($ids as $id => $status) {\n if ($status !== true) {\n continue;\n }\n\n if ($first_it) {\n if (!is_string($_page)) {\n $_page = strval($_page);\n }\n\n $first_it = false;\n }\n\n if (is_integer($id)) {\n $id = strval($id);\n }\n\n if ($or_list != '') {\n $or_list .= ' OR ';\n }\n $or_list .= '(' . db_string_equal_to('m_resource_page', $_page) . ' AND ' . db_string_equal_to('m_resource_type', $type) . ' AND ' . db_string_equal_to('m_resource_id', $id) . ')';\n\n $LOADED_MONIKERS_CACHE[$_page][$type][$id] = $id; // Will be replaced with correct value if it is looked up\n }\n }\n }\n if ($or_list != '') {\n $bak = $GLOBALS['NO_DB_SCOPE_CHECK'];\n $GLOBALS['NO_DB_SCOPE_CHECK'] = true;\n $query = 'SELECT m_moniker,m_resource_page,m_resource_type,m_resource_id FROM ' . get_table_prefix() . 'url_id_monikers WHERE m_deprecated=0 AND (' . $or_list . ')';\n $results = $GLOBALS['SITE_DB']->query($query, null, null, false, true);\n $GLOBALS['NO_DB_SCOPE_CHECK'] = $bak;\n foreach ($results as $result) {\n $LOADED_MONIKERS_CACHE[$result['m_resource_type']][$result['m_resource_page']][$result['m_resource_id']] = $result['m_moniker'];\n }\n foreach ($LOADED_MONIKERS_CACHE as $type => &$pages) {\n foreach ($pages as $_page => &$ids) {\n foreach ($ids as $id => $status) {\n if (is_bool($status)) {\n $ids[$id] = false; // Could not look up, but we don't want to search for it again so mark as missing\n }\n }\n }\n }\n }\n }\n $test = $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id];\n if ($test === false) {\n $test = null;\n }\n } else {\n $bak = $GLOBALS['NO_DB_SCOPE_CHECK'];\n $GLOBALS['NO_DB_SCOPE_CHECK'] = true;\n $where = array(\n 'm_deprecated' => 0,\n 'm_resource_page' => $page,\n 'm_resource_type' => $url_parts['type'],\n 'm_resource_id' => is_integer($effective_id) ? strval($effective_id) : $effective_id,\n );\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('url_id_monikers', 'm_moniker', $where);\n $GLOBALS['NO_DB_SCOPE_CHECK'] = $bak;\n if ($test !== null) {\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id] = $test;\n } else {\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id] = false;\n }\n }\n\n if (is_string($test)) {\n return ($test == '') ? null : $test;\n }\n\n if ($looking_for == '_WILD:_WILD') {\n return null; // We don't generate these automatically\n }\n\n // Otherwise try to generate a new one\n require_code('urls2');\n $test = autogenerate_new_url_moniker($ob_info, $url_parts, $zone);\n if ($test === null) {\n $test = '';\n }\n $LOADED_MONIKERS_CACHE[$url_parts['type']][$page][$effective_id] = $test;\n return ($test == '') ? null : $test;\n }\n\n return null;\n}",
"public function addRootLabel(): static\n {\n $host = $this->uri->getHost();\n\n return match (true) {\n null === $host,\n str_ends_with($host, '.') => $this,\n default => new static($this->uri->withHost($host.'.')),\n };\n }"
] | [
"0.53501505",
"0.5228517",
"0.5163586",
"0.5127393",
"0.5069319",
"0.4969884",
"0.49285695",
"0.48433638",
"0.4810713",
"0.48093724",
"0.4749071",
"0.46752492",
"0.46630478",
"0.4662474",
"0.46541166",
"0.46516436",
"0.46339652",
"0.462695",
"0.46196583",
"0.45948422",
"0.45757005",
"0.45567474",
"0.4552777",
"0.45457143",
"0.45272014",
"0.4518733",
"0.45163655",
"0.45094442",
"0.44768858",
"0.44693908",
"0.44577783",
"0.44537953",
"0.4385652",
"0.43693817",
"0.43565452",
"0.43551898",
"0.4354466",
"0.43531975",
"0.43519965",
"0.43410861",
"0.43204474",
"0.43174767",
"0.43135315",
"0.42927402",
"0.42768297",
"0.42579234",
"0.42558855",
"0.42518643",
"0.42505595",
"0.42501926",
"0.42419675",
"0.4235884",
"0.42355633",
"0.42336467",
"0.42313278",
"0.4220583",
"0.4212725",
"0.42125955",
"0.42100424",
"0.420554",
"0.42010334",
"0.42010072",
"0.41954297",
"0.41913375",
"0.4162786",
"0.41563565",
"0.41539392",
"0.4140713",
"0.41393995",
"0.41381627",
"0.4136987",
"0.41319382",
"0.41288033",
"0.41213936",
"0.41174188",
"0.4110868",
"0.40965205",
"0.40944898",
"0.40943077",
"0.40925208",
"0.408719",
"0.40766487",
"0.40762192",
"0.4073453",
"0.40719086",
"0.40710625",
"0.40710223",
"0.40691197",
"0.40666944",
"0.40635243",
"0.40602526",
"0.40560204",
"0.4048278",
"0.4047964",
"0.4040728",
"0.40391305",
"0.40366128",
"0.4033616",
"0.40319413",
"0.40306783"
] | 0.5442984 | 0 |
Search for the translated version of a Cat URL Indicator segment. Takes a segment, and sees if it exists in the languages array. If it does, return the translated version of it from the requested language | private function _get_translated_cat_url_indicator($str, $lang_id_from = NULL, $lang_id_to = NULL)
{
$from_language = ee()->publisher_model->languages[$lang_id_from];
$to_language = ee()->publisher_model->languages[$lang_id_to];
if ($from_language['cat_url_indicator'] == $str)
{
return $to_language['cat_url_indicator'];
}
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function findTranslationId($segment)\n {\n return array_search($segment, (array) $this->trans());\n }",
"public function getLanguageFromUrl(string $url);",
"public static function translate($input = null, $casing = null, $scan_bundles = false)\r\n\t{\r\n\r\n\t\t// Defaults\r\n\t\tif (strlen($scan_bundles) == 0 || $scan_bundles === false)\r\n\t\t\t$scan_bundles = Config::get('breadcrumb::breadcrumb.scan_bundles');\r\n\r\n\t\tif (strlen($casing) == 0 || is_null($casing))\r\n\t\t\t$casing = Config::get('breadcrumb::breadcrumb.default_casing');\r\n\r\n\t\t// Check if an input was given or not and process it if it is necessary\r\n\t\tif (is_array($input))\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = $input;\r\n\t\t}\r\n\t\telseif ($input != null)\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = static::split_uri($input);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tstatic::$segments_raw = static::split_uri(URI::current());\r\n\t\t}\r\n\r\n\t\t// Translation\r\n\t\tif (is_array(static::$segments_raw) && !empty(static::$segments_raw))\r\n\t\t{\r\n\t\t\t// Clean previous versions\r\n\t\t\tstatic::$segments_translated = null;\r\n\r\n\t\t\tforeach (static::$segments_raw AS $value)\r\n\t\t\t{\r\n\t\t\t\t$key = 'breadcrumb::breadcrumb.' . $value;\r\n\t\t\t\t$tmp = null;\r\n\r\n\t\t\t\t// If the scanning is turned on, and if we find a match\r\n\t\t\t\t// for the current controller's name in the bundles list\r\n\t\t\t\t// then we use it's language settings instead of this\r\n\t\t\t\t// bundle's translations.\r\n\t\t\t\t$controller_name = strtolower(URI::segment(1));\r\n\r\n\t\t\t\t// Case insensitive search, just in case... o.O\r\n\t\t\t\tforeach(\\Bundle::names() AS $bundle_name)\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t// This isn't the greates way of executing a search,\r\n\t\t\t\t\t// but couldn't find a better way to do it at the \r\n\t\t\t\t\t// time this was made....\r\n\t\t\t\t\tif(strtolower($controller_name) == strtolower($bundle_name) && $scan_bundles === true && Lang::has($bundle_name . '::breadcrumb.' . $value))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = Lang::line($bundle_name . '::breadcrumb.' . $value)->get();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If it doesn't find a match, then it basically continues\r\n\t\t\t\t// with the translation search in this bundle or falls back.\r\n\t\t\t\tif(is_null($tmp))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (Lang::has($key))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = Lang::line($key)->get();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tmp = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// Formats\r\n\t\t\t\tswitch ($casing)\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 'lower':\r\n\t\t\t\t\t\t$tmp = Str::lower($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'upper':\r\n\t\t\t\t\t\t$tmp = Str::upper($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'title':\r\n\t\t\t\t\t\t$tmp = Str::title($tmp);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$tmp = Str::lower($tmp);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstatic::$segments_translated[] = $tmp;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new BreadcrumbException('No array provided to work with!');\r\n\t\t}\r\n\t}",
"abstract public function get_language_url($language = null, $url = null);",
"public function getLanguage($controller);",
"abstract public function getTranslationIn(string $locale);",
"abstract public function getTranslationIn(string $locale);",
"abstract public function getTranslationIn(string $locale);",
"public function matchLanguage()\n\t{\n\t\t$pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})'.\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)'.\n '(?P<quantifier>\\d\\.\\d))?$/';\n\t\t\n\t\tforeach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) \n\t\t{\n\t\t\t$splits = array();\n\n\t\t\tif (preg_match($pattern, $lang, $splits)) \n\t\t\t{\n\t\t\t\t$language = $splits['primarytag'];\n\t\t\t\tif(isset($this->languages[$language]))\n\t\t\t\t\treturn $language;\n\t\t\t} \n\t\t\telse \n\t\t\t\treturn 'en';\n\t\t}\n\t\t\n\t\treturn 'en';\n\t}",
"private function lang($string='')\n {\n return $this->language->get($string);\n }",
"private function match($categoryNodes, $segment)\n {\n foreach ($categoryNodes as $categoryNode) {\n if ($segment == $categoryNode->id . ':' . $categoryNode->alias) {\n return $categoryNode;\n }\n }\n return null;\n }",
"private function get_category_breaking_segment($segments)\n {\n\n // var_dump($segments);\n }",
"public function get_language_from_url( $url = '' ) {\n\t\tif ( empty( $url ) ) {\n\t\t\t$url = pll_get_requested_url();\n\t\t}\n\n\t\t$host = wp_parse_url( $url, PHP_URL_HOST );\n\t\treturn ( $lang = array_search( $host, $this->get_hosts() ) ) ? $lang : '';\n\t}",
"public function lookFor($word,$lang='tr'){\n\t\t\n\t\tif($lang=='tr')\n\t\t\t$content=file_get_contents($this->enUrl.urlencode($word));\n\t\telse\n\t\t\t$content=$this->fetchTrWord(urlencode($word));\n\t\t\n\t\t$content=mb_convert_encoding($content,'UTF-8','ISO-8859-9');\n\t\t\n\t\tif($content!=false && $this->getWordLang($content)==$lang){\n\t\t\t$this->content=$content;\n\t\t\treturn $content;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public function getLangFromHeader() {\n\t\t$arr = $this->getHttpHeader();\n\n\t\t// look through sorted list and use first one that matches our languages\n\t\tforeach ($arr as $lang => $val) {\n\t\t\t$lang = explode('-', $lang);\n\t\t\tif (in_array($lang[0], $this->arrLang)) {\n\t\t\t\treturn $lang[0];\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function localize($phrase) {\n global $translations;\n /* Static keyword is used to ensure the file is loaded only once */\n if ($translations[$phrase])\n return $translations[$phrase];\n else\n return $phrase;\n}",
"public function getHrefLang(string $lang): ?TagInterface;",
"protected function _getTranslatedUrl($lang, $path)\n {\n $translated_url_parts = array();\n $grav = Grav::instance();\n $pages = $grav['pages'];\n $page = $pages->get($path);\n $current_node = $page;\n $max_recursions = 10;\n while ($max_recursions > 0 && $current_node->slug() != 'pages' && $path != 'pages') {\n $translated_md_filepath = \"{$path}/{$current_node->template()}.{$lang}.md\";\n if (file_exists($translated_md_filepath)) {\n //$grav['language']->setActive($lang);\n $translated_page = new Page();\n $translated_page->init(new \\SplFileInfo($translated_md_filepath));\n //$translated_page->filePath($translated_md_filepath);\n $translated_slug = $translated_page->slug();\n if (!empty($translated_slug)) {\n array_unshift($translated_url_parts, $translated_slug);\n } else {\n $untranslated_slug = $current_node->slug();\n if (!empty($untranslated_slug)) {\n array_unshift($translated_url_parts, $untranslated_slug);\n }\n }\n $current_node = $current_node->parent();\n $path = dirname($path);\n }\n $max_recursions--;\n }\n if (!empty($translated_url_parts)) {\n //array_unshift($translated_url_parts, $lang);\n array_unshift($translated_url_parts, '');\n return implode('/', $translated_url_parts);\n } else {\n return '';\n }\n }",
"private function processQueryString()\n {\n // store the query string local, so we don't alter it.\n $queryString = trim($this->request->getPathInfo(), '/');\n\n // split into chunks\n $chunks = (array) explode('/', $queryString);\n\n $hasMultiLanguages = $this->getContainer()->getParameter('site.multilanguage');\n\n // single language\n if (!$hasMultiLanguages) {\n // set language id\n $language = $this->get('fork.settings')->get('Core', 'default_language', SITE_DEFAULT_LANGUAGE);\n } else {\n // multiple languages\n // default value\n $mustRedirect = false;\n\n // get possible languages\n $possibleLanguages = (array) Language::getActiveLanguages();\n $redirectLanguages = (array) Language::getRedirectLanguages();\n\n // the language is present in the URL\n if (isset($chunks[0]) && in_array($chunks[0], $possibleLanguages)) {\n // define language\n $language = (string) $chunks[0];\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // set sessions\n \\SpoonSession::set('frontend_language', $language);\n\n // remove the language part\n array_shift($chunks);\n } elseif (CommonCookie::exists('frontend_language') &&\n in_array(CommonCookie::get('frontend_language'), $redirectLanguages)\n ) {\n // set languageId\n $language = (string) CommonCookie::get('frontend_language');\n\n // redirect is needed\n $mustRedirect = true;\n } else {\n // default browser language\n // set languageId & abbreviation\n $language = Language::getBrowserLanguage();\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // redirect is needed\n $mustRedirect = true;\n }\n\n // redirect is required\n if ($mustRedirect) {\n // build URL\n // trim the first / from the query string to prevent double slashes\n $url = rtrim('/' . $language . '/' . trim($this->getQueryString(), '/'), '/');\n // when we are just adding the language to the domain, it's a temporary redirect because\n // Safari keeps the 301 in cache, so the cookie to switch language doesn't work any more\n $redirectCode = ($url == '/' . $language ? 302 : 301);\n\n // set header & redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse($url, $redirectCode)\n );\n }\n }\n\n // define the language\n defined('FRONTEND_LANGUAGE') || define('FRONTEND_LANGUAGE', $language);\n defined('LANGUAGE') || define('LANGUAGE', $language);\n\n // sets the locale file\n Language::setLocale($language);\n\n // list of pageIds & their full URL\n $keys = Navigation::getKeys();\n\n // rebuild our URL, but without the language parameter. (it's tripped earlier)\n $url = implode('/', $chunks);\n $startURL = $url;\n\n // loop until we find the URL in the list of pages\n while (!in_array($url, $keys)) {\n // remove the last chunk\n array_pop($chunks);\n\n // redefine the URL\n $url = implode('/', $chunks);\n }\n\n // remove language from query string\n if ($hasMultiLanguages) {\n $queryString = trim(mb_substr($queryString, mb_strlen($language)), '/');\n }\n\n // if it's the homepage AND parameters were given (not allowed!)\n if ($url == '' && $queryString != '') {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n }\n\n // set pages\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n\n // set parameters\n $parameters = trim(mb_substr($startURL, mb_strlen($url)), '/');\n\n // has at least one parameter\n if ($parameters != '') {\n // parameters will be separated by /\n $parameters = explode('/', $parameters);\n\n // set parameters\n $this->setParameters($parameters);\n }\n\n // pageId, parentId & depth\n $pageId = Navigation::getPageId(implode('/', $this->getPages()));\n $pageInfo = Navigation::getPageInfo($pageId);\n\n // invalid page, or parameters but no extra\n if ($pageInfo === false || (!empty($parameters) && !$pageInfo['has_extra'])) {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n\n // remove the first slash\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n }\n\n // is this an internal redirect?\n if (isset($pageInfo['redirect_page_id']) && $pageInfo['redirect_page_id'] != '') {\n // get url for item\n $newPageURL = Navigation::getURL((int) $pageInfo['redirect_page_id']);\n $errorURL = Navigation::getURL(404);\n\n // not an error?\n if ($newPageURL != $errorURL) {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $newPageURL,\n $pageInfo['redirect_code']\n )\n );\n }\n }\n\n // is this an external redirect?\n if (isset($pageInfo['redirect_url']) && $pageInfo['redirect_url'] != '') {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $pageInfo['redirect_url'],\n $pageInfo['redirect_code']\n )\n );\n }\n }",
"function translate($string, $extra = \"\", $language = '')\n{\n $translation = loadTranslation(!$language ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : $language);\n if ($translation && count($translation)) {\n $translated = '';\n if (array_key_exists($string, $translation)) {\n $translated = $translation[$string];\n $translated .= strlen($extra) ? \"<br/>\" . $extra : \"\";\n } else {\n return $translated = $language != \"en\" ? translate($string, $extra, 'en') : '';\n }\n return $translated;\n } else {\n return '';\n }\n}",
"function subtitle($url)\n{\n // include the countries array\n $countries = include \"../app/includes/countries_array.php\";\n\n // if search results were found\n if(!empty($url['search'])) return \"results found\";\n\n // if country page is open\n if(!empty($url['country']) && isset($countries[$url['country']])) return \"caps from {$countries[$url['country']]}\";\n\n // if collection page is open\n return \"caps collected\";\n}",
"public function get_translated_url_title($url_title, $lang_id_from = NULL, $lang_id_to = NULL)\n {\n $lang_id_from = $lang_id_from ?: ee()->publisher_lib->prev_lang_id;\n $lang_id_to = $lang_id_to ?: ee()->publisher_lib->lang_id;\n\n // If we're in the middle of a language switch, I don't care what was passed to this method.\n if (ee()->publisher_lib->switching)\n {\n $lang_id_from = ee()->publisher_lib->prev_lang_id;\n }\n\n $key = $lang_id_from.':'.$lang_id_to;\n\n if ( !isset($this->cache['translated_cat_url_title'][$url_title][$key]))\n {\n // Is it a Cat URL Title indicator?\n if ($seg = $this->_get_translated_cat_url_indicator($url_title, $lang_id_from, $lang_id_to))\n {\n $this->cache['translated_cat_url_title'][$seg][$key] = $seg;\n\n return $seg;\n }\n\n $qry = ee()->db->select('cat_id')\n ->where('cat_url_title', $url_title)\n ->where('publisher_lang_id', $lang_id_from)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n if ($qry->num_rows() == 1)\n {\n $cat_id = $qry->row('cat_id');\n\n $qry = ee()->db->select('cat_url_title')\n ->where('cat_id', $cat_id)\n ->where('publisher_lang_id', $lang_id_to)\n ->where('publisher_status', ee()->publisher_lib->status)\n ->get('publisher_categories');\n\n $url_title = $qry->num_rows() ? $qry->row('cat_url_title') : $url_title;\n\n $this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;\n\n return $url_title;\n }\n }\n\n $this->cache['translated_cat_url_title'][$url_title][$key] = $url_title;\n\n return $url_title;\n }",
"function loadLocale($translation) {\n\t\t\treturn include($translation);\n\t\t}",
"public function selectPluralVariant($variant, array $translations) {\n \n if (count($translations) > 2) {\n $cases = [2, 0, 1, 1, 1, 2];\n \n $index = $variant % 100 > 4 && $variant % 100 < 20 ? 2 : $cases[min($variant % 10, 5)];\n \n return $translations[$index];\n } else {\n if ($variant == 1) {\n return reset($translations);\n } else {\n return end($translations);\n }\n }\n \n }",
"function getCurrentLanguage() {\n if(strtolower($_SERVER['HTTP_HOST'][0].$_SERVER['HTTP_HOST'][1]) == \"en\") {\n return \"en\";\n }\n return \"cs\";\n}",
"function getLanguage($url, $ln = null, $type = null) {\n\t// Type 2: Change the path for the /requests/ folder location\n\t// Set the directory location\n\tif($type == 2) {\n\t\t$languagesDir = '../languages/';\n\t} else {\n\t\t$languagesDir = './languages/';\n\t}\n\t// Search for pathnames matching the .png pattern\n\t$language = glob($languagesDir . '*.php', GLOB_BRACE);\n\n\tif($type == 1) {\n\t\t// Add to array the available images\n\t\tforeach($language as $lang) {\n\t\t\t// The path to be parsed\n\t\t\t$path = pathinfo($lang);\n\t\t\t\n\t\t\t// Add the filename into $available array\n\t\t\t$available .= '<li><a href=\"'.$url.'index.php?lang='.$path['filename'].'\">'.ucfirst(strtolower($path['filename'])).'</a></li>';\n\t\t}\n\t\treturn substr($available, 0, -3);\n\t} else {\n\t\t// If get is set, set the cookie and stuff\n\t\t$lang = 'Venezuela'; // DEFAULT LANGUAGE\n\t\tif($type == 2) {\n\t\t\t$path = '../languages/';\n\t\t} else {\n\t\t\t$path = './languages/';\n\t\t}\n\t\tif(isset($_GET['lang'])) {\n\t\t\tif(in_array($path.$_GET['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_GET['lang'];\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t} else {\n\t\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t\t}\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\tif(in_array($path.$_COOKIE['lang'].'.php', $language)) {\n\t\t\t\t$lang = $_COOKIE['lang'];\n\t\t\t}\n\t\t} else {\n\t\t\tsetcookie('lang', $lang, time() + (10 * 365 * 24 * 60 * 60)); // Expire in one month\n\t\t}\n\n\t\tif(in_array($path.$lang.'.php', $language)) {\n\t\t\treturn $path.$lang.'.php';\n\t\t}\n\t}\n}",
"function LookForExistingURLSegment($URLSegment)\n {\n return Company::get()->filter(array('URLSegment' => $URLSegment, 'ID:not' => $this->ID))->first();\n }",
"function langswitch($lang)\n{\n // The page path (an absolute path, starting with '/')\n $pagePath = LocaleLinkService::getPagePath();\n\n // Check if the multi-language support is enabled\n if (!LocaleService::isMultilangEnabled()) {\n return $pagePath;\n }\n\n // Empty lang\n if (empty($lang)) {\n return $pagePath;\n }\n\n // Is it the default lang?\n if ($lang === LocaleService::getDefaultLang()) {\n return $pagePath;\n }\n\n // Get the list of available languages\n $availableLangs = LocaleService::getAvailableLangs();\n\n // Isn't the language supported?\n if (!in_array($lang, $availableLangs)) {\n return $pagePath;\n }\n\n return \"/{$lang}{$pagePath}\";\n}",
"public function catalog($language = null) {\n\t\tif (is_array($language)) {\n\t\t\t$result = array();\n\t\t\tforeach ($language as $_language) {\n\t\t\t\tif ($_result = $this->catalog($_language)) {\n\t\t\t\t\t$result[$_language] = $_result;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tif (is_string($language)) {\n\t\t\tif (isset($this->_l10nCatalog[$language])) {\n\t\t\t\treturn $this->_l10nCatalog[$language];\n\t\t\t}\n\t\t\tif (isset($this->_l10nMap[$language]) && isset($this->_l10nCatalog[$this->_l10nMap[$language]])) {\n\t\t\t\treturn $this->_l10nCatalog[$this->_l10nMap[$language]];\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_l10nCatalog;\n\t}",
"public function getContentSegment($segment = 'content');",
"function __($word) {\n global $cfg;\n if (isset($_GET['lang'])) {\n include(\"langs/\".$_GET['lang'].\".php\");\n } else include(\"langs/\".$cfg[\"default_language\"].\".php\"); \n\n return isset($translations[$word]) ? $translations[$word] : $word;\n}",
"function _get_path_to_translation_from_lang_dir($domain)\n {\n }",
"public function getcurrentwithlang()\n {\n $lang = $this->default_lang;\n if (array_key_exists('tls_lang', $_COOKIE)) {\n if (in_array($_COOKIE['tls_lang'], $this->all_lang, true)) {\n $lang = $_COOKIE['tls_lang'];\n }\n }\n $raw_url = Request::getResourceURI();\n $page_url = Path::tidy($raw_url);\n \n $site_url = Config::getSiteURL();\n $newurl = $site_url . \"/\" . $lang . $page_url;\n \n header('Location: ' . $newurl);\n exit;\n }",
"public function getFromLanguage(): string;",
"function loadContentEnglish($where, $default='') {\n // Sanitize it for security reasons\n $content = filter_input(INPUT_GET, $where, FILTER_SANITIZE_STRING);\n $default = filter_var($default, FILTER_SANITIZE_STRING);\n // If there wasn't anything on the url, then use the default\n $content = (empty($content)) ? $default : $content;\n // If you found have content, then get it and pass it back\n if ($content) {\n\t// sanitize the data to prevent hacking.\n\t$html = include 'content/en/'.$content.'.php';\n\treturn $html;\n }\n}",
"public function getParentPath($uuid, $webspaceKey, $languageCode, $segmentKey = null)\n {\n $session = $this->sessionManager->getSession();\n $contentNode = $session->getNodeByIdentifier($uuid);\n $parentNode = $contentNode->getParent();\n\n try {\n return $this->loadByContent($parentNode, $webspaceKey, $languageCode, $segmentKey);\n } catch (ResourceLocatorNotFoundException $ex) {\n // parent node don´t have a resource locator\n return;\n }\n }",
"public static function get($line, array $params = array(), $default = null, $language = null) {\n\t\t($language === null) and $language = static::get_lang ();\n\t\t\n\t\treturn isset ( static::$lines [$language] ) ? \\Str::tr ( \\Fuel::value ( \\Arr::get ( static::$lines [$language], $line, $default ) ), $params ) : $default;\n\t}",
"public function getTranslatedSlugFromResourceId(int $id, int $language_id): string;",
"private function CheckLangue(Request $request){\n $getPathArray = explode('/',$request->getPathInfo());\n $getLangue = $getPathArray[1];\n if(array_search($getLangue,$this->container->getParameter('languages'))===false)\n {\n $getPathArray[1] = $this->container->getParameter('locale');\n $urlredirect = implode(\"/\",$getPathArray);\n $this->redirect('google.fr'.$urlredirect,301);\n }\n\n }",
"public function getTranslationsForLanguage($language);",
"public function getTranslations( ?string $category = null ) : array;",
"protected static function lookup($segments) {\n $items = &static::$items;\n\n foreach($segments as $step) {\n if (is_array($items) && array_key_exists($step, $items)) {\n $items = &$items[$step]; \n } else {\n return null;\n }\n }\n\n return $items;\n }",
"public function getLang();",
"private function findRouter(Zend_Controller_Request_Abstract $request)\n {\n \t$translate = null;\n \t$arrLang = array('en', 'vi');\n \t$path = $request->getPathInfo();\n \n \t// xoa ngon ngu hien tai\n \tarray_diff($arrLang, array(Zend_Registry::get('Zend_Locale')));\n \n \tforeach ($arrLang as $lang)\n \t{\n \n \t\t$translate = new Zend_Translate(\n \t\t\t\tarray(\n \t\t\t\t\t\t'adapter' => 'ini',\n \t\t\t\t\t\t'content' => APPLICATION_PATH.'/library/Language/'.$lang.'_url.ini',\n \t\t\t\t\t\t'locale' => $lang,\n \t\t\t\t\t\t//'scan' => Zend_Translate::LOCALE_FILENAME\n \t\t\t\t)\n \t\t);\n \t\t$path = trim(urldecode($path), '/');\n \n \t\tforeach ($translate->getAdapter()->getMessages($lang) as $sName => $sRegex)\n \t\t{\n \t\t\t$regex = '#^' . $sRegex . '$#i';\n \n \t\t\tif (preg_match($regex, $path))\n \t\t\t{\n \t\t\t\t//setcookie('lang_detect', $lang, time() + 3600, '/');\n \t\t\t\tZend_Registry::set('lang_detect', $lang);\n \t\t\t\t\n \t\t\t\t// Tu tim url ma khong lam thay doi ngon ngu hien tai\n \t\t\t\t$router = Zend_Controller_Front::getInstance()->getRouter()->getRoute($sName);\n \t\t\t\t$arrMap = array();\n \t\t\t\t\n \t\t\t\tforeach ($router->getVariables() as $key => $value)\n \t\t\t\t{\n \t\t\t\t\t\t$arrMap[$key + 1] = $value;\n \t\t\t\t}\n \t\t\t\t//ini_set('display_errors', '1');\n \t\t\t\t# add found router\n \t\t\t\tDefined_RouterControl::addRouter($sName.'_'.$lang, $translate->_($sRegex), $arrMap, $router->getDefault('module'), $router->getDefault('controller'), $router->getDefault('action'));\n \t\t\t\t\n \t\t\t\t\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n \n \t}\n \t\n \t$this->unsetDetectLang();\n }",
"public function translate($category, $message, $params, $language)\n {\n $messageSource = $this->getMessageSource($category);\n\n if (!is_array($messageSource)) {\n $messageSource = [$messageSource];\n }\n\n // Processing source queue\n foreach ($messageSource as $source) {\n\n // If translated, breaking queue\n if ($translation = $source->translate($category, $message, $language)) {\n $message = $translation;\n break;\n }\n }\n\n $references = array();\n\n // Replacing references\n if (preg_match_all('/%{2}[^\\s]*%{2}/i', $message, $references, PREG_PATTERN_ORDER) > 0) {\n $references = $references[0]; // We need full matches only\n foreach ($references as $reference) {\n\n $referenceArray = explode(':', str_replace('%%', '', $reference), 2);\n\n // Reference within same category\n if (count($referenceArray) == 1) {\n array_unshift($referenceArray, $category);\n }\n\n $message = str_replace(\n $reference,\n $this->translate($referenceArray[0], $referenceArray[1], $params, $source, $language),\n $message\n );\n }\n }\n\n if ($translation === false) {\n return $this->format($message, $params, $source->sourceLanguage);\n }\n\n return $this->format($translation, $params, $language);\n }",
"protected function _extractLanguage() {\n // Default lanuage is always Lao\n $lang = 'lo';\n\n // Set the cookie name\n //$this->Cookie->name = '_osm_la';\n //echo $this->response->cookie(\"_osm_la\");\n \n // First check if the language parameter is set in the URL. The URL\n // parameter has first priority.\n $paramLang = $this->request->query(\"lang\");\n if (isset($paramLang)) {\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($paramLang, $this->_languages)) {\n // Set the language to the URL parameter\n $lang = $paramLang;\n }\n } else if ($this->Cookie->read($this->_languageCookie) != null) {\n // Check if a cookie is set and set its value as language. A Cookie\n // has second priority\n $cookieValue = $this->Cookie->read($this->_languageCookie);\n // Check if the URL parameter is a valid language identifier\n if (array_key_exists($cookieValue, $this->_languages)) {\n // Set the language to the Cookie value\n $lang = $cookieValue;\n }\n }\n\n // If neither the lang parameter nor a cookie is set, set and return\n // Lao as language.\n //$this->log(var_dump($this));\n //$this->response->cookie($this->_languageCookie => $lang ]);\n return $lang;\n }",
"public function hasContentSegment($segment);",
"public function selectPluralVariant($variant, array $translations) {\n if ($variant == 1) {\n return reset($translations);\n } else {\n return end($translations);\n }\n }",
"function local_navigation_get_string($string) {\n $title = $string;\n $text = explode(',', $string, 2);\n if (count($text) == 2) {\n // Check the validity of the identifier part of the string.\n if (clean_param($text[0], PARAM_STRINGID) !== '') {\n // Treat this as atext language string.\n $title = get_string($text[0], $text[1]);\n }\n }\n return $title;\n}",
"function isTranslation($branch)\n{\n return strpos($branch, \"translation\") !== false && strpos($branch, \"origin/integration\") !== false;\n}",
"function resolveLanguageFromDomain()\n {\n $ret = false;\n if (isset($_SERVER['HTTP_HOST'])) {\n $langCode = array_pop(explode('.', $_SERVER['HTTP_HOST']));\n\n // if such language exists, then use it\n $lang = $langCode . '-' . SGL_Translation::getFallbackCharset();\n if (SGL_Translation::isAllowedLanguage($lang)) {\n $ret = $lang;\n }\n }\n return $ret;\n }",
"public function lang($lang = null);",
"public function language(string $language);",
"protected static function getLanguageService() {}",
"public static function getLangByUrl($url = null)\n {\n if (is_null($url)) {\n return null;\n } else {\n $lang = self::find()->where(['url' => $url, 'status' => self::LANGUAGE_STATUS_ACTIVE])->one();\n if (is_null($lang)) {\n return null;\n } else {\n return $lang;\n }\n }\n }",
"public function negotiateLanguage()\n {\n $matches = $this->getMatchesFromAcceptedLanguages();\n foreach ($matches as $key => $q) {\n\n $key = ($this->configRepository->get('laravellocalization.localesMapping')[$key]) ?? $key;\n\n if (!empty($this->supportedLanguages[$key])) {\n return $key;\n }\n\n if ($this->use_intl) {\n $key = Locale::canonicalize($key);\n }\n\n // Search for acceptable locale by 'regional' => 'af_ZA' or 'lang' => 'af-ZA' match.\n foreach ( $this->supportedLanguages as $key_supported => $locale ) {\n if ( (isset($locale['regional']) && $locale['regional'] == $key) || (isset($locale['lang']) && $locale['lang'] == $key) ) {\n return $key_supported;\n }\n }\n }\n // If any (i.e. \"*\") is acceptable, return the first supported format\n if (isset($matches['*'])) {\n reset($this->supportedLanguages);\n\n return key($this->supportedLanguages);\n }\n\n if ($this->use_intl && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $http_accept_language = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\n if (!empty($this->supportedLanguages[$http_accept_language])) {\n return $http_accept_language;\n }\n }\n\n if ($this->request->server('REMOTE_HOST')) {\n $remote_host = explode('.', $this->request->server('REMOTE_HOST'));\n $lang = strtolower(end($remote_host));\n\n if (!empty($this->supportedLanguages[$lang])) {\n return $lang;\n }\n }\n\n return $this->defaultLocale;\n }",
"public function getMultilingual();",
"function language_url($url) {\n\n if(isset($_COOKIE['language'])) {\n return '/' . $_COOKIE['language'] . $url;\n } else {\n return $url;\n }\n }",
"function loadTranslation($language = 'en')\n{\n $content = json_decode(file_get_contents(TRANSLATIONS_FOLDER . DS . $language . '.json'), true);\n if ($content && count($content)) {\n return $content;\n } else {\n return $language == 'en' ? array() : loadTranslation('en');\n }\n}",
"public function getTextsWithBaseTexts($language);",
"public function getTranslation( $identifier, ?string $defaultTranslation = null ) : string;",
"protected abstract function getTranslationIdentifier();",
"public function loadLang(){\n\n if($this->id == -1 || empty($this->databasePath))\n return \"\";\n\n $sqlQuery = 'SELECT L.lang_code as lang FROM books_languages_link BLL, languages L WHERE BLL.lang_code = L.id AND BLL.book = '.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['lang'];\n \n return \"\";\n }",
"function kcsite_get_lang_slug($preceding_slash = false, $lang = false){\n\t$slash1 = $preceding_slash == true ? '/' : '';\n\t//$lith_output = '';\n\tif($lang) {\n\t\t$lang_slug = $lang;\n\t} else {\n\t\t$lang_slug = pll_current_language('slug');\n\t}\n\treturn $lang_slug == 'lt' ? '' : $slash1.$lang_slug;\n}",
"private function loadTranslation($language)\n {\n /** @var $translation ActiveRecord */\n $translation = null;\n /** @var \\yii\\db\\ActiveQuery $relation */\n $relation = $this->owner->getRelation($this->relation);\n /** @var ActiveRecord $class */\n $class = $relation->modelClass;\n $oldAttributes = $this->owner->getOldAttributes();\n $searchFields = [$this->languageField => $language];\n\n foreach ($relation->link as $languageModelField => $mainModelField) {\n if (empty($oldAttributes)) {\n $searchFields[$languageModelField] = $this->owner->$mainModelField;\n } else {\n $searchFields[$languageModelField] = $oldAttributes[$mainModelField];\n }\n }\n\n $translation = $class::findOne($searchFields);\n\n if ($translation === null) {\n $translation = new $class;\n $translation->setAttributes($searchFields, false);\n }\n\n return $translation;\n }",
"public function processLangCode($lang)\n\t{\n\t\t$lang = strtolower($lang);\n\t\tif(isset($this->languages[$lang]))\n\t\t\treturn $lang;\n\t\telse\n\t\t\treturn DEFAULT_LANG;\n\t}",
"protected function checkIfLanguagesExist() {}",
"abstract public function get_app_language();",
"public static function l18n($translations, $languages = array('en'))\n {\n if (!is_array($translations)) {\n return $translations;\n }\n\n $langTranslations = array();\n $retVal = '';\n\n foreach ($translations as $key => $value) {\n $parts = explode('-', $key);\n list($lang)= $parts;\n $langTranslations[$lang] = $value;\n }\n\n foreach ($languages as $lang) {\n $culture = explode('-', $lang);\n\n if (array_key_exists($lang, $translations)) {\n $retVal = $translations[$lang];\n break;\n }\n\n if (array_key_exists($culture[0], $translations)) {\n $retVal = $translations[$culture[0]];\n break;\n }\n\n if (array_key_exists($culture[0], $langTranslations)) {\n $retVal = $langTranslations[$culture[0]];\n break;\n }\n }\n\n return empty($retVal)?array_shift($translations):$retVal;\n }",
"function getTranslation(){\n global $wpdb;\n global $DOPBSP;\n \n if (isset($_GET['page'])){\n $current_page = $_GET['page'];\n\n switch($current_page){\n case 'dopbsp-addons':\n $DOPBSP_curr_page = 'Addons';\n break;\n case 'dopbsp-calendars':\n $DOPBSP_curr_page = 'Calendars';\n break;\n case 'dopbsp-coupons':\n $DOPBSP_curr_page = 'Coupons';\n break;\n case 'dopbsp-discounts':\n $DOPBSP_curr_page = 'Discounts';\n break;\n case 'dopbsp-emails':\n $DOPBSP_curr_page = 'Emails';\n break;\n case 'dopbsp-events':\n $DOPBSP_curr_page = 'Events';\n break;\n case 'dopbsp-extras':\n $DOPBSP_curr_page = 'Extras';\n break;\n case 'dopbsp-fees':\n $DOPBSP_curr_page = 'Fees';\n break;\n case 'dopbsp-forms':\n $DOPBSP_curr_page = 'Forms';\n break;\n case 'dopbsp-locations':\n $DOPBSP_curr_page = 'Locations';\n break;\n case 'dopbsp-reservations':\n $DOPBSP_curr_page = 'Reservations';\n break;\n case 'dopbsp-reservations':\n $DOPBSP_curr_page = 'Reviews';\n break;\n case 'dopbsp-rules':\n $DOPBSP_curr_page = 'Rules';\n break;\n case 'dopbsp-search':\n $DOPBSP_curr_page = 'Search';\n break;\n case 'dopbsp-settings':\n $DOPBSP_curr_page = 'Settings';\n break;\n case 'dopbsp-staff':\n $DOPBSP_curr_page = 'Staff';\n break;\n case 'dopbsp-templates':\n $DOPBSP_curr_page = 'Templates';\n break;\n case 'dopbsp-themes':\n $DOPBSP_curr_page = 'Themes';\n break;\n case 'dopbsp-tools':\n $DOPBSP_curr_page = 'Tools';\n break;\n case 'dopbsp-translation':\n $DOPBSP_curr_page = 'Translation';\n break;\n default:\n $DOPBSP_curr_page = 'Dashboard';\n break;\n }\n }\n else{\n if (isset($_GET['action'])\n && $_GET['action'] == 'edit'){\n $DOPBSP_curr_page = 'Calendars';\n }\n else{\n $DOPBSP_curr_page = 'None';\n }\n }\n \n if (!is_super_admin()){\n $user_roles = array_values(wp_get_current_user()->roles);\n $DOPBSP_user_role = $user_roles[0];\n }\n else{\n $DOPBSP_user_role = 'administrator';\n }\n?> \n <script type=\"text/JavaScript\">\n var DOPBSP_DEVELOPMENT_MODE = <?php echo DOPBSP_DEVELOPMENT_MODE ? 'true':'false'; ?>,\n DOPBSP_CONFIG_HELP_DOCUMENTATION_URL = '<?php echo DOPBSP_CONFIG_HELP_DOCUMENTATION_URL; ?>',\n DOPBSP_curr_page = '<?php echo $DOPBSP_curr_page; ?>',\n DOPBSP_user_ID = <?php echo wp_get_current_user()->ID; ?>,\n DOPBSP_user_role = '<?php echo $DOPBSP_user_role; ?>',\n DOPBSP_plugin_url = '<?php echo $DOPBSP->paths->url; ?>',\n DOPBSP_translation_text = new Array();\n \n<?php\n $language = $DOPBSP->classes->backend_language->get();\n $translation = $wpdb->get_results('SELECT * FROM '.$DOPBSP->tables->translation.'_'.$language);\n\n foreach ($translation as $item){\n $text = stripslashes($item->translation);\n $text = str_replace('<<single-quote>>', \"\\'\", $text);\n $text = str_replace('<script>', \"\", $text);\n $text = str_replace('</script>', \"\", $text);\n?>\n \n DOPBSP_translation_text['<?php echo $item->key_data; ?>'] = '<?php echo $text; ?>';\n<?php \n }\n?>\n </script>\n<?php \n }",
"function ver_categoria ( $uri ) {\n\tglobal $categorias;\n\t//ver si figura la variable cat en el url, en ese caso es categoria\n\t$cat = isset($_REQUEST['cat']) ? $_REQUEST['cat'] : 'none';\n\n\t$parseUrl = explode('/', $uri);\n\t$RequestURI = $parseUrl[1];\n\n\tfor ($i=0; $i < count($categorias); $i++) { \n\t\tif ( $categorias[$i]['slug'] == $RequestURI ) {\n\t\t$cat = $RequestURI;\n\t\tbreak;\n\t\t}\n\t}\n\n\treturn $cat;\n\n}",
"function lixgetlang() {\n $lang = 'rus';\n \n if ($_GET[lang] != 'rus' && $_GET[lang] != 'eng' && $_GET[lang] != 'deu') {\n if (lixlpixel_detect_lang() != 'ru') { $lang = 'eng'; }\n else { $lang = 'rus'; }\n } else {\n $lang = $_GET[lang];\n }\n \n return $lang;\n}",
"public function languageWhere() {}",
"public function languageWhere() {}",
"static protected function translate($s){\nif(!self::$strings)return $s;\nif(!array_key_exists($s,self::$strings))return $s;\nreturn self::$strings[$s];\n}",
"public function get_cat_url_indicator()\n {\n if(isset(ee()->publisher_model->current_language['cat_url_indicator']) &&\n ee()->publisher_model->current_language['cat_url_indicator'] != '')\n {\n return ee()->publisher_model->current_language['cat_url_indicator'];\n }\n\n return ee()->config->item('reserved_category_word');\n }",
"private function localise_langOlWiPrefix()\n {\n // Get the labels for the value field and the lang_ol field\n $valueField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $langOlField = $this->sql_filterFields[ $this->curr_tableField ][ 'lang_ol' ];\n\n // Get the language devider\n $devider = $this->pObj->objLocalise->conf_localisation[ 'TCA.' ][ 'value.' ][ 'devider' ];\n\n // Get the language prefix\n $prefix = $GLOBALS[ 'TSFE' ]->lang . ':'; // Value i.e.: 'de:'\n // LOOP rows\n foreach ( $this->rows as $uid => $row )\n {\n // Get the language overlay value\n $langOlValue = $row[ $langOlField ];\n\n ///////////////////////////////////////////////////////\n //\n // Get language overlay value for the current language\n // Build the pattern\n // i.e:\n // preg_match( ~(\\Aen:|\\|en:)(.*)\\|~U, en:Policy|fr:Politique|it:Politica, $matches )\n // * (\\Aen:|\\|en:):\n // Search for 'en:' at beginning or '|en:' everywhere\n // * (.*)\n // Get the whole string ...\n // * \\|~U\n // ... until the first pipe\n $pattern = '~(\\A' . $prefix . '|\\\\' . $devider . $prefix . ')(.*)(\\\\' . $devider . '|\\\\z)~U';\n // Build the pattern\n // IF: Override default language with language overlay value\n if ( preg_match( $pattern, $langOlValue, $matches ) )\n {\n $this->rows[ $uid ][ $valueField ] = trim( $matches[ 2 ] );\n }\n // IF: Override default language with language overlay value\n // Get language overlay value for the current language\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n if ( isset( $matches[ 2 ] ) )\n {\n $prompt = 'preg_match( ' . $pattern . ', \\'' . $langOlValue . '\\', $matches )';\n t3lib_div :: devLog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'result of $matches[2] : ' . $matches[ 2 ];\n t3lib_div :: devLog( '[OK/FILTER] ' . $prompt, $this->pObj->extKey, -1 );\n }\n if ( !isset( $matches[ 2 ] ) )\n {\n $prompt = 'preg_match( ' . $pattern . ', \\'' . $langOlValue . '\\', $matches ) hasn\\'t any result!';\n t3lib_div :: devLog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n }\n }\n // DRS\n }\n // LOOP rows\n }",
"public function getTranslations($msv, $default_lang='', $system=-1) {\n\t\t\tglobal $db;\n\t\t\t$testing=false;\n\t\t\t//$testing=true;\n\t\t\t$labels=array();\n\t\t\tif ($testing) print \"getTrans($msv, $default_lang, $system)<br>\";\n\n\t\t\t// 1 - Collect standard translations in english\n\t\t\t$query=\"select id, shortname, longname, longname as eng from labels WHERE \".(($system>-1)?\"system=$system\":\"system<2\").\" order by longname\";\n\t\t\tif ($testing) print \"$query<br>\\n\";\n\t\t\t$labels=$this->getLabels($db->get_results($query), $labels);\n\t\t\t\n\t\t\t// 2 - See if we have default site translations for any labels\n\t\t\t//if ($default_lang!=\"en\") {\n\t\t\t\t$query=\"select shortname, ld.longname from labels l left join labels_default ld on l.id=ld.label_id where ld.lang='$default_lang' AND \".(($system>-1)?\"system=$system\":\"system<2\").\" order by l.longname\";\n\t\t\t\tif ($testing) print \"$query<br>\\n\";\n\t\t\t\t$labels=$this->getLabels($db->get_results($query), $labels, 'default');\n\t\t\t//}\n\t\t\t\n\t\t\t// 3 - Get microsite version specific labels.\t\n\t\t\t// Dont do this if we are running for msv=1 as msv 1 has no translations and is allowed to modify defaults only.\n\t\t\t//if ($msv!=1 || $system==2) {\n\t\t\t\t$query=\"select shortname, lt.longname from labels l left join labels_translations lt on l.id=lt.label_id where lt.msv=$msv AND \".(($system>-1)?\"system=$system\":\"system<2\").\" order by l.longname\";\n\t\t\t\tif ($testing) print \"$query<br>\\n\";\n\t\t\t\t$labels=$this->getLabels($db->get_results($query), $labels, 'site');\n\t\t\t//}\n\n\t\t\tif ($testing) print_r($labels);\n\t\t\treturn $labels;\n\t\t}",
"protected abstract function getTranslations();",
"private function getIdByHAL(){\n\t\tif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n\t\t{\n\t\t\t$FirstHAL = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\t\t\t$iso = $FirstHAL[0];\n\t\t\tif ($iso != \"en-us\")\n\t\t\t\tforeach ($this->xml_file as $lang)\n\t\t\t\t\tforeach ($lang->isos->iso as $anIso)\n\t\t\t\t\t\tif ($anIso == $iso)\n\t\t\t\t\t\t\treturn $lang['id'];\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}",
"private function _get_default_cat_url_indicator($url_title)\n {\n foreach (ee()->publisher_model->languages as $lang_id => $language)\n {\n if ($language['cat_url_indicator'] == $url_title)\n {\n return ee()->publisher_model->languages[ee()->publisher_lib->default_lang_id]['cat_url_indicator'];\n }\n }\n\n return FALSE;\n }",
"function prefered_language ($available_languages,$http_accept_language=\"auto\") { \n // if $http_accept_language was left out, read it from the HTTP-Header \n if ($http_accept_language == \"auto\") $http_accept_language = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; \n\n // standard for HTTP_ACCEPT_LANGUAGE is defined under \n // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 \n // pattern to find is therefore something like this: \n // 1#( language-range [ \";\" \"q\" \"=\" qvalue ] ) \n // where: \n // language-range = ( ( 1*8ALPHA *( \"-\" 1*8ALPHA ) ) | \"*\" ) \n // qvalue = ( \"0\" [ \".\" 0*3DIGIT ] ) \n // | ( \"1\" [ \".\" 0*3(\"0\") ] ) \n preg_match_all(\"/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?\" . \n \"(\\s*;\\s*q\\s*=\\s*(1\\.0{0,3}|0\\.\\d{0,3}))?\\s*(,|$)/i\", \n $http_accept_language, $hits, PREG_SET_ORDER); \n\n // default language (in case of no hits) is the first in the array \n $bestlang = $available_languages[0]; \n $bestqval = 0; \n\n foreach ($hits as $arr) { \n // read data from the array of this hit \n $langprefix = strtolower ($arr[1]); \n if (!empty($arr[3])) { \n $langrange = strtolower ($arr[3]); \n $language = $langprefix . \"-\" . $langrange; \n } \n else $language = $langprefix; \n $qvalue = 1.0; \n if (!empty($arr[5])) $qvalue = floatval($arr[5]); \n \n // find q-maximal language \n if (in_array($language,$available_languages) && ($qvalue > $bestqval)) { \n $bestlang = $language; \n $bestqval = $qvalue; \n } \n // if no direct hit, try the prefix only but decrease q-value by 10% (as http_negotiate_language does) \n else if (in_array($langprefix,$available_languages) && (($qvalue*0.9) > $bestqval)) { \n $bestlang = $langprefix; \n $bestqval = $qvalue*0.9; \n } \n } \n return $bestlang; \n}",
"function get_lang_key($key) {\n $CI = &get_instance();\n return $CI->lang->line($key);\n}",
"private function getPhraseByJson($keyString, $subKey = [])\n {\n $return = null;\n\n $useLanguageArray = $this->preloadedLanguage;\n\n if (is_array($subKey)) {\n foreach (array_change_key_case($subKey, CASE_LOWER) as $keyName) {\n if (isset($useLanguageArray[$keyName])) {\n $useLanguageArray = array_change_key_case($useLanguageArray[$keyName], CASE_LOWER);\n }\n }\n }\n\n $keyStringVariant = strtolower(preg_replace('/_/', '', $keyString));\n\n foreach ($useLanguageArray as $translationType => $translationItem) {\n if (is_array($translationItem)) {\n if (is_array($useLanguageArray) &&\n (isset($useLanguageArray[$keyString]) || isset($useLanguageArray[$keyStringVariant]))\n ) {\n // Either one of these should be returned since it has landed here properly.\n if (isset($useLanguageArray[$keyString])) {\n $return = $useLanguageArray[$keyString];\n } elseif (isset($useLanguageArray[$keyStringVariant])) {\n $return = $useLanguageArray[$keyStringVariant];\n }\n break;\n }\n foreach ($translationItem as $translationCategory => $translationCategoryItem) {\n if ((is_string($translationCategoryItem) && strtolower($translationCategoryItem) === strtolower($keyString)) ||\n $translationCategory === $keyString\n ) {\n $return = $translationCategoryItem;\n break;\n }\n\n if (is_string($translationType) && strtolower($translationType) === strtolower($keyString)) {\n $return = $translationItem;\n break;\n }\n }\n if (!empty($return)) {\n break;\n }\n } elseif ($translationType === $keyString) {\n $return = $translationItem;\n break;\n }\n }\n\n return $return;\n }",
"function PageByCurrentLocale($pageURL) {\n\t\tif($pg = Translatable::get_one_by_locale('Page', Translatable::default_locale(), \"URLSegment = '{$pageURL}'\")) return $pg->getTranslation(Translatable::get_current_locale());\n\t\t\n\t\treturn null;\n\t}",
"function load_language($language,$class){\n\t}",
"public function getSenseByWord($word, $source_lang, $dest_lang=NULL){\n\n\t\t\tglobal $msg;\n\n\t\t\tif (!$word || !$source_lang){\n\t\t\t\t$msg->log(\"002\", __METHOD__, \"word, source_lang\");\n\t\t\t\t$this->message\t= \"Error code 001: missing parameters (word or source language). [BabelNetRequest.getSenseByWord]\";\n\t\t\t\t$this->errlog\t.= \"[\".date(\"d-m-o H:i:s\").\"] \".$this->message.\"\\n\";\n\t\t\t\t$this->status\t= FALSE;\n\t\t\t\treturn FALSE;\n\t\t\t}else{\n\n\t\t\t\tif (!$dest_lang) $dest_lang = $source_lang;\n\n\t\t\t\t$params = array (\n\t\t\t\t\t\t\t\t\t\t\t\"word\"\t\t\t\t=> $word,\n\t\t\t\t\t\t\t\t\t\t\t\"lang\"\t\t\t\t=> $source_lang,\n\t\t\t\t\t\t\t\t\t\t\t\"filterLangs\"\t\t=> $dest_lang,\n\t\t\t\t\t\t\t\t\t\t\t\"key\"\t\t\t\t=> $this->api_key,\n\t\t\t\t\t\t\t\t\t\t\t\"source\"\t\t\t=> \"WIKI\",\n\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$request = $this->url.$this->getMode(\"sense_by_word\").\"?\".http_build_query($params);\n\t\t\t\t//echo $request.\"<br>\";\n\t\t\t\t$this->http->setURL($request);\n\t\t\t\t$response = $this->http->send(TRUE);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}",
"function SI_determineLanguage() {\n\tglobal $_SERVER;\n\tif (isset($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"])) {\n\t\t// Capture up to the first delimiter (, found in Safari)\n\t\tpreg_match(\"/([^,;]*)/\",$_SERVER[\"HTTP_ACCEPT_LANGUAGE\"],$langs);\n\t\t$lang_choice=$langs[0];\n\t\t}\n\telse { $lang_choice=\"empty\"; }\n\treturn $lang_choice;\n\t}",
"public function isTranslated();",
"function _getLanguage() {\n global $basePath, $arrLanguages;\n\n $language = $this->defaultLanguage;\n\n if (isset($_SESSION['installer']['langId'])) {\n $language = $arrLanguages[$_SESSION['installer']['langId']]['lang'];\n } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $browserLanguage = substr(strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']),0,2);\n\n foreach ($arrLanguages as $arrLang) {\n if ($browserLanguage == $arrLang['lang']) {\n $language;\n break;\n }\n }\n }\n\n if ($this->_checkLanguageExistence($language)) {\n return $language;\n } else {\n return $this->defaultLanguage;\n }\n }",
"function fsgs_local_navigation_get_string($string) {\n $title = $string;\n $text = explode(',', $string, 2);\n if (count($text) == 2) {\n // Check the validity of the identifier part of the string.\n if (clean_param($text[0], PARAM_STRINGID) !== '') {\n // Treat this as atext language string.\n $title = get_string($text[0], $text[1]);\n }\n } \n return $title;\n}",
"public function translate()\n {\n $query = $this->query;\n if($this->verbose) Yii::debug(\" *** Query is '$query', using language '$this->language'... ***\", __METHOD__);\n if( ! $query ) return \"\";\n $tokenizer = new Tokenizer($query);\n $tokens = $tokenizer->tokenize();\n $operators = $this->getOperators();\n $hasOperator = false;\n $parsedTokens = [];\n $dict = $this->getDictionary();\n if($this->verbose) Yii::debug($dict, __METHOD__);\n do {\n $token = isset($tokens[0]) ? $tokens[0] : \"\";\n if($this->verbose) Yii::debug(\"Looking at '$token'...\", __METHOD__);\n // do not translate quoted expressions\n if ( in_array( $token[0], [\"'\", '\"']) ) {\n array_shift($tokens);\n } else {\n // compare multi-word token\n $offset = 1;\n for($i=0; $i<count($tokens); $i++){\n $compare = implode( \" \", array_slice( $tokens, 0, $i+1 ));\n $compare = mb_strtolower( $compare, \"UTF-8\");\n if ($this->verbose) Yii::debug(\"Comparing '$compare'...\", __METHOD__);\n if ($pos = strpos($compare, \"/\") or $pos = strpos($compare, \"*\")){\n $compare_key = substr( $compare, 0, $pos);\n } else {\n $compare_key = $compare;\n }\n if( isset( $dict[$compare_key] ) ) {\n $token = $dict[$compare_key];\n if( $compare_key == $compare){\n $offset = $i+1;\n }\n if($this->verbose) Yii::debug(\"Found '$token'.\", __METHOD__);\n }\n }\n $tokens = array_slice($tokens, $offset);\n if($this->verbose) Yii::debug(\"Using '$token', rest: \" . implode(\"|\",$tokens));\n }\n if (in_array($token, $operators)) {\n if($this->verbose) Yii::debug(\"Found operator '$token'.\", __METHOD__);\n $hasOperator = true;\n }\n $parsedTokens[] = $token;\n } while (count($tokens));\n if($this->verbose) Yii::debug(\"Parsed tokens: \" . implode(\"|\", $parsedTokens));\n\n // Re-assemble translated query string\n if ($hasOperator) {\n $cqlQuery = implode(\" \", $parsedTokens);\n $this->containsOperators = true;\n } else {\n // Queries that don't contain any operators or booleans are put into quotes\n $cqlQuery = '\"' . implode(\" \", $parsedTokens) . '\"';\n $this->containsOperators = false;\n }\n if($this->verbose) Yii::debug(\"CQL query: '$cqlQuery'\", __METHOD__);\n $this->parsedTokens = $parsedTokens;\n return $cqlQuery;\n }",
"public static function get($string, ?string $lang = NULL): string\n {\n $values = [];\n\n // Check if $string is array [text, values]\n if (Arr::isArray($string)) {\n if (isset($string[1]) && Arr::isArray($string[1])) {\n $values = $string[1];\n }\n $string = $string[0];\n }\n\n // Set Target Language if not set\n if (!$lang) {\n // Use the global target language\n $lang = static::$lang;\n }\n\n // Load the translation table for this language\n $table = static::load($lang);\n\n // Return the translated string if it exists\n $string = $table[$string] ?? $string;\n\n return empty($values) ? $string : strtr($string, $values);\n }",
"function get_lang($name) {\n global $lang;\n return $lang->get_phrase($name);\n}",
"public function languageDetection($data) {\n $parameters=array(\n 'data'=>$data \n );\n $content = json_encode($parameters);\n \n $jsonreply=$this->CallWebService('getLanguage',$content);\n \n return $this->ParseReply($jsonreply);\n }",
"function lixlpixel_detect_lang()\n{\n lixlpixel_get_env_var('HTTP_ACCEPT_LANGUAGE');\n lixlpixel_get_env_var('HTTP_USER_AGENT');\n\n $_AL=strtolower($GLOBALS['HTTP_ACCEPT_LANGUAGE']);\n $_UA=strtolower($GLOBALS['HTTP_USER_AGENT']);\n\n // Try to detect Primary language if several languages are accepted.\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(strpos($_AL, $K)===0)\n return $K;\n }\n \n // Try to detect any language if not yet detected.\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(strpos($_AL, $K)!==false)\n return $K;\n }\n foreach($GLOBALS['_LANG'] as $K)\n {\n if(preg_match(\"//[\\[\\( ]{$K}[;,_\\-\\)]//\",$_UA))\n return $K;\n }\n\n // Return default language if language is not yet detected.\n return $GLOBALS['_DLANG'];\n}",
"protected function getLanguageSelection() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}",
"protected function getLanguageService() {}"
] | [
"0.5604929",
"0.5416463",
"0.5253464",
"0.49420857",
"0.49232253",
"0.49037632",
"0.49037632",
"0.49037632",
"0.48873144",
"0.4858703",
"0.47926423",
"0.47646707",
"0.47542813",
"0.47526997",
"0.46980676",
"0.46759644",
"0.46690223",
"0.46371606",
"0.46225125",
"0.46145132",
"0.4593073",
"0.4548255",
"0.4528357",
"0.4521131",
"0.45170182",
"0.45115986",
"0.44959095",
"0.44940457",
"0.448056",
"0.44686174",
"0.4464041",
"0.4462791",
"0.4458978",
"0.44349322",
"0.44192252",
"0.44117218",
"0.44080573",
"0.4400336",
"0.43984136",
"0.43848136",
"0.4380983",
"0.4372558",
"0.43678194",
"0.43594176",
"0.4351257",
"0.43491837",
"0.4348989",
"0.43482915",
"0.43376213",
"0.43264446",
"0.4324622",
"0.43186027",
"0.4316587",
"0.43145368",
"0.4314053",
"0.43098813",
"0.43070304",
"0.43042412",
"0.4302548",
"0.42927527",
"0.4285146",
"0.42820755",
"0.42810002",
"0.4276858",
"0.4274878",
"0.42711377",
"0.42701218",
"0.42677423",
"0.42666328",
"0.42610306",
"0.42602366",
"0.42578322",
"0.42546585",
"0.42546585",
"0.42542955",
"0.4252056",
"0.4247362",
"0.42361885",
"0.42352748",
"0.42333955",
"0.4228059",
"0.42269257",
"0.42150885",
"0.4205934",
"0.42043003",
"0.42032713",
"0.4197486",
"0.41973156",
"0.4191867",
"0.41889927",
"0.4183524",
"0.4177502",
"0.41753867",
"0.41729975",
"0.41668153",
"0.4161741",
"0.4161302",
"0.41563064",
"0.41563064",
"0.41562542"
] | 0.5209089 | 3 |
Get the current cateogry reserved category word. | public function get_cat_url_indicator()
{
if(isset(ee()->publisher_model->current_language['cat_url_indicator']) &&
ee()->publisher_model->current_language['cat_url_indicator'] != '')
{
return ee()->publisher_model->current_language['cat_url_indicator'];
}
return ee()->config->item('reserved_category_word');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }",
"public static function getCategory()\n {\n return self::$category;\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }",
"public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}",
"public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}",
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"public function get_cat_name() {\n $c = $this->cat;\n $tmp = \"\";\n switch($c) {\n case 1:\n $tmp = \"News\";\n break;\n case 2:\n $tmp = \"Eventi\";\n break;\n case 3:\n $tmp = \"Pubblicazioni\";\n break;\n }\n return $tmp;\n }",
"public function getCategory() {\n return $this->randomQuote->category_name;\n }",
"public function getCurrentCategory()\n {\n return $this->registry->registry('current_category');\n }",
"function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}",
"private function getCategory() {\n return '';\n }",
"public function token_the_category() {\n\t\treturn implode( ', ', wp_list_pluck( (array)get_the_category(), 'name' ) );\n\t}",
"private function retrieve_category() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$cat = $this->get_terms( $this->args->ID, 'category' );\n\t\t\tif ( $cat !== '' ) {\n\t\t\t\t$replacement = $cat;\n\t\t\t}\n\t\t}\n\n\t\tif ( ( ! isset( $replacement ) || $replacement === '' ) && ( isset( $this->args->cat_name ) && ! empty( $this->args->cat_name ) ) ) {\n\t\t\t$replacement = $this->args->cat_name;\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getCurrentCategory()\n {\n return $this->category;\n }",
"function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}",
"public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }",
"public function getCategoryName()\n {\n return $this->cat->title;\n }",
"public function get_category(){\n\t\treturn $this->category;\n\t}",
"public function getCategory(){\r\n return Mage::registry('current_category');\r\n }",
"public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}",
"public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }",
"function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}",
"public function getCategory()\n {\n if (!$this->_category) {\n $this->_category = Mage::registry('current_category');\n }\n return $this->_category;\n }",
"public function categoryName() {\n $categories = array(\n 'Fantasy',\n 'Technology',\n 'Thriller',\n 'Documentation',\n );\n\n return $categories[array_rand($categories)];\n }",
"public function getCategory()\n {\n return $this->_category;\n }",
"function get_category_id() {\n\tglobal $wpdb;\n\n\t$sql = \"SELECT term_id\n\t\tFROM $wpdb->terms\n\t\tWHERE name LIKE 'webonary'\";\n\n\t$catid = $wpdb->get_var( $sql);\n\n\treturn $catid;\n}",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }",
"public function get_category()\n {\n return $this->primary_category();\n }",
"public function getCategoryName()\n {\n return ($this->category !== null?$this->category->name:'-');\n }",
"public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}",
"public function getCat()\n {\n return $this->cat = get_the_category($this->id);\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getFormCategory()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->category));\n\t}",
"public function getCurrentCat()\n {\n if (empty($this->multifilterSession->getTopCategory()) && empty($this->multifilterSession->getCategories())) {\n $currentCat = $this->coreRegistry->registry('current_category');\n return $currentCat->getId();\n } else {\n return $this->multifilterSession->getTopCategory();\n }\n }",
"public function getCategory()\n {\n\n return $this->category;\n }",
"public function getCategory() {\n\t\treturn $this->category;\n\t}",
"public function getCategoryId(): string\n {\n return $this->categoryId;\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function getMainCategoryAttribute()\n {\n $mainCategory = 'Uncategorized';\n\n if (! empty($this->terms)) {\n $taxonomies = array_values($this->terms);\n\n if (! empty($taxonomies[0])) {\n $terms = array_values($taxonomies[0]);\n\n $mainCategory = $terms[0];\n }\n }\n\n return $mainCategory;\n }",
"public function getCategory() {\n return $this->category;\n }",
"function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}",
"function fs_get_category_id( $cat_name ) {\r\n\t$term = get_term_by( 'name', $cat_name, 'category' );\r\n\treturn $term->term_id;\r\n}",
"public function getCatId()\n {\n return $this->getParamCatId();\n }",
"public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getActiveCategory()\n {\n return $this->_activeCategory;\n }",
"function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}",
"function get_category_id( $cat_name ){\n\t$term = get_term_by( 'name', $cat_name, 'category' );\n\treturn $term->term_id;\n}",
"function get_category_id( $cat_name ){\n\t$term = get_term_by( 'name', $cat_name, 'category' );\n\treturn $term->term_id;\n}",
"function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }",
"public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}",
"public function getCategoryName(): ?string\n {\n return $this->categoryName;\n }",
"public function appCategory()\n {\n return File::get_app_category($this->getExtension());\n }",
"public function get_category()\n {\n return C__CATG__INVOICE;\n }",
"public function get_category()\n {\n return 'Information Display';\n }",
"public function getCategory() {}",
"public function get_category()\n {\n return 'New Features';\n }",
"public function get_category()\n {\n return 'New Features';\n }",
"function static_cat_name() {\n global $wp;\n $current_url = home_url(add_query_arg(array(),$wp->request));\n if (stripos($current_url, 'th') !== false) {\n return 'posts-th';\n } else {\n return 'posts';\n }\n}",
"public function getCategory()\n {\n return $this->readOneof(2);\n }",
"public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }",
"public function getCategory(): string;",
"public function getCategoryName()\n {\n $oCategory = $this->getCategory();\n\n if ($oCategory instanceof oxCategory) {\n return $oCategory->getTitle();\n }\n\n return null;\n }",
"function alaya_cat_name($cate_ID){\n\t$current_cat = get_category($cate_ID);\n\t$cate_name = $current_cat->name;\n\t$cate_name = apply_filters('alaya_cat_name', $cate_name);\n\treturn $cate_name;\n}",
"public function get_category_id(){\n\t\treturn $this->_categoryid;\n\t}",
"public function getCategory()\n {\n if (array_key_exists(\"category\", $this->_propDict)) {\n if (is_a($this->_propDict[\"category\"], \"\\Beta\\Microsoft\\Graph\\Model\\WindowsMalwareCategory\") || is_null($this->_propDict[\"category\"])) {\n return $this->_propDict[\"category\"];\n } else {\n $this->_propDict[\"category\"] = new WindowsMalwareCategory($this->_propDict[\"category\"]);\n return $this->_propDict[\"category\"];\n }\n }\n return null;\n }",
"public function getCategoryName()\n {\n if (is_null($this->categoryName)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_CATEGORY_NAME);\n if (is_null($data)) {\n return null;\n }\n $this->categoryName = (string) $data;\n }\n\n return $this->categoryName;\n }",
"function getCategoryClass()\n {\n global $category_class;\n \n if ($category_class) {\n // nothing\n } elseif ($category = get_constructor_category()) {\n if (sizeof($category) > 0)\n $category_class = 'category-' .join(' category-', $category);\n } else {\n $category_class = '';\n }\n \n return $category_class;\n }",
"public function get_category()\n {\n return 'Graphical';\n }",
"public function get_category()\n {\n return 'Graphical';\n }",
"public function getCategory(){\n return $this->category;\n }",
"function getCategory() \n {\n return $this->instance->getCategory();\n }",
"function get_category() {\n return self::CATEGORY_CLUSTER;\n }",
"public function getCategory()\n {\n }",
"public function get_category()\n {\n return C__CATG__SHARE_ACCESS;\n }",
"function retrieve_category_id($name) {\n\tglobal $wpdb;\n\t\n\t// Query the term_id of the category needed\n\t$query = \"SELECT wpt.term_id FROM `wp_terms` AS wpt\"\n \t\t. \" JOIN `wp_term_taxonomy` AS wptt\"\n \t\t. \"\t\tON wpt.term_id = wptt.term_id\"\n \t\t. \" WHERE wptt.taxonomy = 'category' AND name = %s\";\n\t$sql = $wpdb->prepare($query, $name);\n\t$id = $wpdb->get_results($sql)[0]->term_id;\n\treturn $id;\n\t\n}",
"public function getCategory(): string|null;",
"public function get_category_id() {\n return (int)get_config('block_homework_diary', 'course_category');\n }",
"public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }"
] | [
"0.71971595",
"0.7196051",
"0.70822376",
"0.70822376",
"0.70822376",
"0.7017728",
"0.6988207",
"0.69708556",
"0.69260186",
"0.6912472",
"0.6896427",
"0.68930423",
"0.6873917",
"0.6863673",
"0.684672",
"0.68096",
"0.6789635",
"0.67117554",
"0.6699043",
"0.66979045",
"0.6637381",
"0.663582",
"0.66153204",
"0.6589345",
"0.65837646",
"0.65796846",
"0.6576296",
"0.6575149",
"0.6570082",
"0.65661263",
"0.65646064",
"0.6537189",
"0.65327954",
"0.649391",
"0.6492142",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64848995",
"0.64820224",
"0.64820224",
"0.64578825",
"0.6445117",
"0.6403351",
"0.6392218",
"0.63916117",
"0.63873243",
"0.638345",
"0.6382101",
"0.63769376",
"0.636776",
"0.634314",
"0.63368",
"0.63218635",
"0.63071036",
"0.6291781",
"0.6272755",
"0.6272755",
"0.6260048",
"0.6259776",
"0.6259388",
"0.62508875",
"0.6238102",
"0.62116313",
"0.62022144",
"0.61986625",
"0.61986625",
"0.6189098",
"0.6183844",
"0.6182678",
"0.6181968",
"0.6173789",
"0.61734986",
"0.6172804",
"0.6161712",
"0.61567783",
"0.615438",
"0.6153544",
"0.6153544",
"0.6145473",
"0.61340404",
"0.61229306",
"0.61168516",
"0.6096015",
"0.6092813",
"0.6081634",
"0.60786587",
"0.60742736"
] | 0.6634513 | 22 |
See if a translation exists for the requested category | public function has_translation($data, $language_id = FALSE)
{
return TRUE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function category_exists() {\n\t\t$users_name = trim($this->input->post ( 'category_name' ));\n\n\t\t$where = array ('category_name' => trim ( $users_name ));\n\t\t\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('username_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"protected function checkIfLanguagesExist() {}",
"function categoryExists($cat) { // Return true if the given category exists\n\t$cat = dbEscape($cat);\n\treturn(dbResultExists(\"SELECT * FROM categories WHERE name='$cat'\"));\n}",
"public function isTranslated();",
"public function hasCategory(): bool;",
"public function hasLang() {\n return $this->_has(1);\n }",
"function store_lang_exists($key)\n {\n return isset(ee()->lang->language[$key]);\n }",
"public function cate_exists() {\n\t\t$category_name = trim($this->input->post ( 'category_name' ));\n\n\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array ( 'category_name' => trim ( $category_name ));\n\n\t\tif ($edit_id != \"\") {\n\t\t\t$where = array_merge ( $where, array ( \"category_id !=\" => $edit_id ) );\n\t\t} \n\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('cate_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"function category_exists($cat_name, $category_parent = \\null)\n {\n }",
"public function hasLanguage() : bool;",
"public static function existsCategory($id)\n\t{\n\t\treturn (bool) BackendModel::getDB()->getVar(\n\t\t\t'SELECT COUNT(i.id)\n\t\t\t FROM faq_categories AS i\n\t\t\t WHERE i.id = ? AND i.language = ?',\n\t\t\tarray((int) $id, BL::getWorkingLanguage())\n\t\t);\n\t}",
"function isCategoryExist($categoryName)\n {\n $allCategories = $this->data->getAllCategories();\n while ($category = $allCategories->fetch_assoc())\n {\n if ($category['CategoryName'] == $categoryName)\n {\n return true;\n }\n }\n return false;\n }",
"public function checkCategoryExist($ssCategory)\n {\n try\n {\n return Doctrine_Query::create()\n ->select(\"MU.*\")\n ->from(\"Model_Category MU\")\n ->where(\"MU.category_name =?\",$ssCategory)\n ->fetchArray();\n }\n catch( Exception $e )\n {\n echo $e->getMessage();\n return false;\n }\n }",
"public function existCategorie($categories){\n\t\t\n\t\tglobal $wpdb;\n\n\t\t$ok = 0;\n\t\t\n\t\tif(!empty($categories))\n\t\t{\n\t\t\tforeach($categories as $cat)\n\t\t\t{ \n\t\t\t\t$category = $this->utils->cleanString($cat);\n\t\t\t\t\n\t\t\t\t$result = $this->findCategory($category);\n\t\t\t\t\n\t\t\t\tif( !$result )\n\t\t\t\t{\n\t\t\t\t\t$this->insertCategory($category);\n\t\t\t\t}\t\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t \n\t\treturn true;\n\t}",
"private function hasKeyTranslated($key): bool\n {\n return (bool) Lang::hasForLocale($key, $this->translateTo);\n }",
"public function hasCategory()\n {\n return $this->category !== null;\n }",
"public static function existsCategory($id)\n {\n return (bool) BackendModel::getContainer()->get('database')->getVar(\n 'SELECT COUNT(i.id)\n FROM slideshow_categories AS i\n WHERE i.id = ? AND i.language = ?',\n array((int) $id, BL::getWorkingLanguage())\n );\n }",
"public function hasTranslator();",
"function ajx_exists( $id = false )\n\t{\n\t\t// get language name\n\t\t$name = $_REQUEST['key'];\n\t\t$language_id = $_REQUEST['language_id'];\n\t\t\n\t\tif ( $this->is_valid_name( $name, $id, $language_id )) {\n\n\t\t// if the language name is valid,\n\t\t\t\n\t\t\techo \"true\";\n\t\t} else {\n\t\t// if invalid language name,\n\t\t\t\n\t\t\techo \"false\";\n\t\t}\n\t}",
"public function hasLang() {\n return $this->_has(5);\n }",
"public function isCategory($category): bool;",
"public static function existsCategory($category) {\n $n = self::where('name', '=', $category)->where('parent_category_id', '=', 17)->count();\n return $n>0;\n }",
"public function cat_match($category){\n\n\t\t\t$sql = mysql_query(\"SELECT * FROM `categories` WHERE `cat` = '$category'\");\n\n\t\t\t$count_query = mysql_num_rows($sql);\n\n\t\t\t\tif ($count_query == 0) {\n\t\t\t\t\t# code...\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t} else {\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t}",
"public function hasLocalizedStrings() {\n return $this->_has(1);\n }",
"public function checkProductExistsByName()\n {\n $category = $this::find()\n ->select('id')\n ->where(['name' => $this->name])\n ->one();\n if($category !== NULL) {\n return true;\n }\n return false;\n }",
"function is_translatable()\n {\n }",
"function _checkLanguageExistence($language) {\n global $basePath;\n\n if (file_exists($basePath.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$language.'.lang.php')) {\n return true;\n } else {\n return false;\n }\n }",
"public function checkExistLanguageTitle($language_title, $id = 0)\n {\n \t//$language_title = iconv('windows-1251', 'utf-8', strtolower(iconv('utf-8', 'windows-1251', $language_title)));\n \t//$language_title = mb_detect_encoding($language_title, 'utf-8');\n\n \tif($id){\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE lang_id!=? AND LOWER(title) = ?', array($id, $language_title)); \t \t\t\n \t} else {\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE LOWER(title) = ?', $language_title); \t\n \t}\n\n\t\tif(!empty($result)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n }",
"public function categoriaExiste($id)\n\t{\n\t\tglobal $conn, $hashids;\n\n\t\tif (!empty($id)) {\n\t\t\t$id = $hashids->decrypt($id);\n\t\t\t$id = $id[0];\n\t\t}\n\n\t\t$sql = \"SELECT SQL_CACHE NULL FROM `\".TP.\"_categoria` WHERE `cat_id`=?\";\n\t\tif (!$res = $conn->prepare($sql))\n\t\t\techo __FUNCTION__.$conn->error;\n\t\telse {\n\t\t\t$res->bind_param('i', $id);\n\t\t\t$res->execute();\n\t\t\t$res->store_result();\n\t\t\t$num = $res->num_rows;\n\t\t\t$res->close();\n\t\t}\n\n\t\tif ($num>0) return false;\n\t\telse return true;\n\t}",
"public function CategoryExists ($array, $name) {\n foreach ($array as $elem) {\n if($elem->name === $name) {\n return true;\n }\n }\n return false;\n }",
"public function hasFrontendTranslation() {\r\n\t\tif($this->jLanguage != null) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function hasTranslator(): bool;",
"public function termExists($slug,$id=NULL){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->addInCondition('slug', array($this->post_slug($slug)));\n\t\tif($id){\n\t\t\t$criteria->condition .= \" AND cat_id != '\".(int)$id.\"' \";\n\t\t}\n\t\t$cat = NeCategory::model()->count($criteria);\n\t\tif($cat>0){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function has_category($category = '', $post = \\null)\n {\n }",
"public static function IsCategoryExist($category_name) {\n $categories = ORM::factory('category')->find_all();\n $retval = false;\n foreach ($categories as $category)\n if (strtolower($category_name) == strtolower($category->name))\n $retval = true;\n return $retval;\n }",
"public function wpml_element_has_translations( $null, $id, $type ) {\n\t\t$pll_type = ( 'post' == $type || pll_is_translated_post_type( $type ) ) ? 'post' : ( 'term' == $type || pll_is_translated_taxonomy( $type ) ? 'term' : false );\n\t\treturn ( $pll_type && $translations = call_user_func( \"pll_get_{$pll_type}_translations\", $id ) ) ? count( $translations ) > 1 : false;\n\t}",
"static function have($lang)\n\t{\n\t\tif (!self::valid($lang)) {\n\t\t\terror(\"Invalid language id: '$lang'\");\n\t\t\treturn false;\n\t\t}\n\t\t$path = self::path($lang);\n\t\treturn file_exists($path);\n\t}",
"private function isUserCategoryExists($ucat_name) {\n\t\t$stmt = $this->conn->prepare(\"SELECT ucat_name from user_category WHERE ucat_name = ? and (status=1 or status=2) \");\n $stmt->bind_param(\"s\", $ucat_name);\n $stmt->execute();\n\t\t$stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return !($num_rows == 0); //if no any user number of rows ==0; then get negative of it to send false\n }",
"protected function checkForValidTranslationInstance($translation)\n {\n return ($translation !== null &&\n $translation instanceof CNabuCommerceProductCategoryLanguage &&\n $translation->matchValue($this, 'nb_commerce_product_category_id')\n );\n }",
"public function isValidCat($cat){\r\n \treturn isset($this->categories[$cat]); \r\n\t}",
"public function hasTranslationChanges();",
"public function offsetExists($translateKey): bool\n {\n return $this->exists($translateKey);\n }",
"function lookupTransClass($transClassKey){\r\n\t\t$resource = \"lktransclassifications/$transClassKey\";\r\n\t\t$transClassCategory = $this->getResource($resource);\r\n\t\tif($transClassCategory){\r\n\t\t\treturn $transClassCategory->Description;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function lang_exists( $conds = array()) {\n\n\t\t$sql = \"SELECT * FROM rt_language WHERE `name` = '\" . $conds['name'] . \"' \";\n\n\n\t\t$query = $this->db->query($sql);\n\n\t\treturn $query;\n\t}",
"public function translate($category, $message, $language)\n {\n if ($this->forceTranslation || $language !== $this->sourceLanguage) {\n return $this->translateMessage($category, $message, $language);\n }\n\n return false;\n }",
"public function is_category($category = '')\n {\n }",
"public function has_language() {\r\n\t\treturn (is_lang($this->language));\r\n\t}",
"protected function isKeyReturningTranslationText($key)\n {\n return $this->hasTranslatedAttributes() && in_array($key, $this->getTranslatedAttributes());\n }",
"public function checkLanguageExist($id, $language) {\n\t\t$query = $this->db->get_where ( \"languages\", array (\n\t\t\t\t\"language\" => $language\n\t\t) );\n\t\t$lang1 = $this->getLangById ( $id );\n\t\tif ($query->num_rows () > 0) {\n\t\t\t$lang= $query->row ();\n\t\t\tif ($lang->language == $lang1->language)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public static function LanguageExists($lang_abbrev)\n\t{\n\t\tglobal $objLogin;\n\t\t\n\t\tif($objLogin->IsLoggedInAs('owner','mainadmin','admin')){\n\t\t\t$used_on = ' AND (used_on = \\'global\\' || used_on = \\'back-end\\')';\t\t\t\t\n\t\t}else{\n\t\t\t$used_on = ' AND (used_on = \\'global\\' || used_on = \\'front-end\\')';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT abbreviation\n\t\t\t\tFROM '.TABLE_LANGUAGES.'\n\t\t\t\tWHERE abbreviation = \\''.$lang_abbrev.'\\' '.$used_on.' AND is_active = 1';\n\t\tif(database_query($sql, ROWS_ONLY) > 0){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function nameExistInParent(){\n\n\t\t$cat = $this->add('xepan\\commerce\\Model_Category');\n\t\t$cat->addCondition('parent_category_id',$this['parent_category_id']?:null);\n\t\t$cat->addCondition('name',$this['name']);\n\t\t$cat->addCondition('id','<>',$this->id);\n\t\t$cat->tryLoadAny();\n\n\t\treturn $cat->loaded();\n\n\t\treturn $this->ref('parent_category_id')->loaded()? \n\t\t$this->ref('parent_category_id')->ref('SubCategories')\n\t\t\t\t->addCondition('name',$this['name'])\n\t\t\t\t->addCondition('id','<>',$this->id)\n\t\t\t\t->tryLoadAny()->loaded(): false;\n\t}",
"public static function contentExist($aVal = \"\", $aLang = 'MA') {\n $lRet = 0;\n \n $lSql = 'SELECT * FROM `al_cms_content` WHERE `content`='.esc($aVal).' AND `mand`='.intval(MID);\n $lQry = new CCor_Qry($lSql);\n foreach ($lQry as $lRow) {\n $lSql = 'SELECT `language` FROM `al_cms_ref_lang` WHERE `content_id`='.esc($lRow['content_id']).' AND `parent_id`='.esc($lRow['parent_id']);\n $lLang = CCor_Qry::getStr($lSql);\n if($lLang == $aLang) {\n $lRet = intval($lRow['content_id']);\n }\n }\n \n return $lRet;\n }",
"public function validCategory($data) {\n $categories = $this->categories();\n return array_key_exists(current($data), $categories);\n }",
"public function isCategory( $name ) {\n $query = $this->db->query( \"SELECT DISTINCT category_id FROM \" . DB_PREFIX . \"category_description WHERE name = '\" . $name . \"'\" );\n\n return $query->row;\n }",
"public function hasLanguages() {\n return $this->_has(2);\n }",
"protected function checkTranslatedShortcut() {}",
"public function iN_CheckLangIDExist($langID) {\n\t\t$langID = mysqli_real_escape_string($this->db, $langID);\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_langs WHERE lang_id = '$langID' AND lang_status = '1'\") or die(mysqli_error($this->db));\n\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t/*Return result if icon id exist or not*/\n\t\treturn isset($data['lang_name']) ? $data['lang_name'] : FALSE;\n\t}",
"public function isNewCategory(): bool {\n return !$this->category->exists;\n }",
"public function exists(string $section): bool;",
"public function isMultilingual()\n {\n return class_exists('Wl')\n && !empty($this->multilingual) && (null === $this->table || $this->table->isMultilingual());\n }",
"function has_categorys()\n\t{\n\t\t\t$categorias = $this->combofiller->categorias();\t\t\t\n\t\t\tforeach($categorias as $key => $value)\n\t\t\t{\n\t\t\t\tif ($this->input->post('' . $key . ''))\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn FALSE;\t\n\t}",
"function categoryAssociationExists($monographId, $categoryId) {\n\t\t$result = $this->retrieve(\n\t\t\t'SELECT COUNT(*) FROM submission_categories WHERE submission_id = ? AND category_id = ?',\n\t\t\tarray((int) $monographId, (int) $categoryId)\n\t\t);\n\t\t$returner = isset($result->fields[0]) && $result->fields[0] == 1 ? true : false;\n\n\t\t$result->Close();\n\t\treturn $returner;\n\t}",
"public static function checkCategory($aCont) {\n if(strpos($aCont['layout'], 'nutri') > -1) return TRUE;\n \n $lSql = 'SELECT c.`content_id` FROM `al_cms_ref_category` rc INNER JOIN `al_cms_content` c ON c.content_id=rc.content_id ';\n $lSql.= 'WHERE c.`content`='.esc($aCont['content']).' AND rc.`category`='.esc($aCont['category']).' AND `mand`='.intval(MID);\n $lRes = CCor_Qry::getInt($lSql);\n \n return ($lRes > 0) ? TRUE : FALSE;\n }",
"public function exists($tag) { //+\n\t\treturn array_key_exists($tag, $this->arShortcodes);\n\t}",
"function multilingual(): bool\n {\n return count(supportedLocaleKeys()) > 1;\n }",
"public function hasCollection(string $group): bool\n {\n return Arr::has($this->locales, $group);\n }",
"public function checkExistLanguageShortTitle($language_short_title, $id = 0)\n {\n \t$language_short_title = iconv('windows-1251', 'utf-8', strtolower(iconv('utf-8', 'windows-1251', $language_short_title)));\n \tif($id){\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE lang_id!=? AND LOWER(short_title) = ?', array($id, $language_short_title)); \t \t\t\n \t} else {\n\t\t\t$result = $this -> db -> fetchRow('SELECT * FROM '.self::LANGUAGES_TABLE.' WHERE LOWER(short_title) = ?', $language_short_title); \t\n \t}\n\n\t\tif(!empty($result)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n }",
"function check_language_redirection_exists($country)\r\n\t{\r\n\t\t$query = $this->db->query(\"SELECT id FROM language_redirection WHERE country = ?\", array($country));\r\n\t\t\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function check_lang_name_exists($lang_name)\n {\n $lang_data = $this->db->select(\"*\")->where('lang', $lang_name)->get('languages')->row();\n if ($lang_data) {\n return true;\n }\n return false;\n }",
"function checkLanguage($lang) {\n global $DIR_LANG;\n # important note that '\\' must be matched with '\\\\\\\\' in preg* expressions\n\n return file_exists($DIR_LANG . remove_all_directory_separator($lang) . '.php');\n}",
"public function hasLangFile($key) {\n return isset($this->files[$key]);\n }",
"public function hasLocalizations()\n {\n return !!$this->numLocalizations();\n }",
"public function checkSubcatNameExist($category_id,$sub_catname)\n{\n\ttry\n\t{\n\t\t$ifExist = subcategory::where('category_id','=',$category_id)->where('sub_category_name',$sub_catname)->get();\n\t\t//$ifExist = subcategory::where('category_id','=','1')->where('sub_category_name','=','Office Partition')->get();\n\t\t// return $ifExist;\n\t\tif(count($ifExist) <= 0)\n\t\t{\n\t\t\treturn '0';//no data\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '1'; //with data\n\t\t}\n\t}\n\tcatch(\\Exception $e)\n\t{\n\t\treturn '0';\n\t}\n}",
"function does_exists($id, $type) {\n\n global $course_id;\n switch ($type) {\n case 'forum':\n $sql = Database::get()->querySingle(\"SELECT id FROM forum\n WHERE id = ?d\n AND course_id = ?d\", $id, $course_id);\n break;\n case 'topic':\n $sql = Database::get()->querySingle(\"SELECT id FROM forum_topic\n WHERE id = ?d\", $id);\n break;\n }\n if (!$sql) {\n return 0;\n } else {\n return 1;\n }\n}",
"function have_category() {\n global $categories_index, $discussion, $categories, $categories_count;\n\n $categories_count = count(get_categories());\n $categories = get_categories();\n\n if ($categories && $categories_index + 1 <= $categories_count) {\n $categories_index++;\n return true;\n } else {\n $categories_count = 0;\n return false;\n }\n}",
"function lookupInvoiceCategory($categoryKey){\r\n\t\t$resource = \"lkinvoicecategories/$categoryKey\";\r\n\t\t$invoiceCategory = $this->getResource($resource);\r\n\t\tif($invoiceCategory){\r\n\t\t\treturn $invoiceCategory->Description;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function thisTopicWasAlreadyExisted():bool\n {\n \t$column = $this->topic->getColumn();\n\t\t$tableName = $this->topic->getTableName();\n\t\t$columIdSubCat = 'id_sub_category';\n\n\t\t$is_exist = (int)(new Requestor())->getContentWith2Where('id', 'f_topics', 'content', $this->topic->getContent(), 'id_sub_category', $this->topic->getIdSubCategory());\n\n\t\tif ($is_exist > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n }",
"public function existKategoria($kat)\r\n {\r\n $this->db->select('count(IDkategoria) AS liczba');\r\n $this->db->from('kategoria');\r\n $this->db->where('nazwaKategorii', $kat);\r\n $query = $this->db->get();\r\n\r\n return $query->row('liczba');\r\n }",
"public function hasLocalizedInfo($lang = false) {\r\n if ($lang) {\r\n return isset($this->localized[$lang]) ? true : false;\r\n }\r\n\r\n return count($this->localized) ? true : false;\r\n }",
"public function hasTranslations()\n {\n return !empty($this->translations);\n }",
"public function hasTranslation($caption, $languageId)\n {\n $caption = $this->_normalizeCaption($caption);\n $count = $this->_translationTable->count(array(\n 'caption = ?' => $caption,\n 'language_id = ?' => $languageId\n ));\n return $count > 0;\n }",
"function isUnique( $pageID, $key, $languageID ) \n {\n $condition = 'page_id='.$pageID.' AND language_id='.$languageID;\n return $this->isUniqueFieldValue( $key, 'label_key', $condition );\n }",
"private static function existsCategoria($nome, $IDpadre){\n if($IDpadre=='any'){\n $dbResponse=\\Singleton::DB()->query(\"SELECT COUNT(*) as num FROM `categorie` WHERE categorie.nome='$nome';\");\n while($r = mysqli_fetch_assoc($dbResponse)) {$rows[] = $r; }\n if($rows[0]['num']==0) return FALSE;\n else return TRUE;\n\n }\n else\n {\n $dbResponse=\\Singleton::DB()->query(\"SELECT COUNT(*) as num FROM `categorie` WHERE categorie.nome='$nome' and categorie.padre=$IDpadre;\");\n while($r = mysqli_fetch_assoc($dbResponse)) {$rows[] = $r; }\n if($rows[0]['num']==0) return FALSE;\n else return TRUE;\n }\n }",
"public function languageExists($language)\n {\n return $this->getLanguage($language) ? true : false;\n }",
"public function has ($namespace) {\n return isset($this->messages[$namespace]);\n }",
"public function categoryExists($categoryID) {\n\t\t$this->load->model('BreweriesModel', '', true);\n\t\t// get the brewery information\n\t\t$rs = $this->BreweriesModel->getCategoryCheck($categoryID);\n\t\t// check if it really exists\n\t\t$boolean = count($rs) > 0 ? true : false;\n\t\t// check the boolean\n\t\tif($boolean === false) {\n\t\t\t$this->form_validation->set_message('categoryExists', 'The %s you have chosen doesn\\'t exists. Please choose another.');\n\t\t}\n\t\treturn $boolean;\n\t}",
"function in_comic_category() {\n\tglobal $post, $category_tree;\n\t\n\t$comic_categories = array();\n\tforeach ($category_tree as $node) {\n\t\t$comic_categories[] = end(explode(\"/\", $node));\n\t}\n\treturn (count(array_intersect($comic_categories, wp_get_post_categories($post->ID))) > 0);\n}",
"public function hasLanguage()\n {\n return $this->language !== null;\n }",
"public function isCategoryPage();",
"function is_movie_category( $term = '' ) {\n return is_tax( 'movie_cat', $term );\n }",
"public function hasCategory($categoryId) {\n\t\t$quizCategories = $this->quizCategoriesTable->find('quizId', $this->id);\n\n\t\tforeach ($quizCategories as $quizCategory) {\n\t\t\tif ($quizCategory->categoryId == $categoryId) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"function _layout_builder_bundle_has_no_translations($entity_type_id, $bundle) {\n $entity_update_manager = \\Drupal::entityDefinitionUpdateManager();\n $entity_type = $entity_update_manager->getEntityType($entity_type_id);\n if (!$entity_type->isTranslatable()) {\n return TRUE;\n }\n $query = \\Drupal::entityTypeManager()->getStorage($entity_type_id)->getQuery();\n $bundle_key = $entity_type->getKey('bundle');\n if ($entity_type->hasKey('default_langcode')) {\n if ($bundle_key) {\n $query->condition($bundle_key, $bundle);\n }\n if ($entity_type->isRevisionable()) {\n $query->allRevisions();\n }\n $query->condition($entity_type->getKey('default_langcode'), 0)\n ->accessCheck(FALSE)\n ->range(0, 1);\n $results = $query->execute();\n return empty($results);\n }\n // A translatable entity type should always have a default_langcode key. If it\n // doesn't we have no way to determine if there are translations.\n return FALSE;\n}",
"function file_in_language($file){\n\t\t$lang = $this->get_languages();\n\t\tif($lang!==FALSE){\n\t\t\tforeach($lang as $l){\n\t\t\t\t$names = get_filenames(APPPATH.\"language/{$l['dir']}/\");\n\t\t\t\tif(in_array($file,$names)){\n\t\t\t\t\t$in_lang[]=$l['dir'];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $in_lang;\n\t\t}\n\t\treturn FALSE;\n\t}",
"static public function phraseExists ($key, $group = NULL, $culture = NULL, $driver = NULL) {\n Assert::isString($key);\n Assert::isString($group, TRUE);\n Assert::isString($culture, TRUE);\n Assert::isString($driver, TRUE);\n \n /**\n * If no drivers have been loaded yet, the chances are that the application hasn't finished\n * booting yet or literals aren't in use\n */\n if (self::$_initialised == FALSE) {\n return FALSE;\n }\n\n if ($culture === NULL) {\n $culture = Culture_Info::current();\n }\n\n if (self::cultureExists($culture) == FALSE) {\n throw new Exception(\"Culture does not exist\");\n }\n\n if ($driver !== NULL && self::$_cultureDrivers[$culture][$driver]->phraseExists($key, $group) == TRUE) {\n return TRUE;\n }\n\n // Look in the current/selected language\n foreach (self::$_cultureDrivers[$culture] as $driver) {\n if ($driver->phraseExists($key, $group) == TRUE) {\n return TRUE;\n }\n }\n\n // Look in the invariant language\n foreach (self::$_cultureDrivers[Culture_Info::invariantCulture] as $driver) {\n if ($driver->phraseExists($key, $group) == TRUE) {\n return TRUE;\n }\n }\n\n return FALSE;\n }",
"public function checkIsset($attribute, $params) {\n //check translates isset\n if (is_numeric($this->post_id)) {\n \n $criteria = new CDbCriteria();\n $params = array();\n $criteria->addCondition(\"language_id = :language_id\");\n $params[':language_id'] = $this->language_id;\n $criteria->addCondition(\"post_id = :post_id\");\n $params[':post_id'] = $this->post_id;\n \n if (!$this->getIsNewRecord()) {\n $criteria->addCondition(\"id != :id\");\n $params[':id'] = $this->id;\n }\n \n $criteria->params = $params;\n \n if ($this->exists($criteria)) {\n $this->addError($attribute, \"Translate for this language exist\");\n } else {\n return true;\n }\n }\n }",
"function is_video_category( $term = '' ) {\n return is_tax( 'video_cat', $term );\n }",
"private function check_category_taxonomy($category_name){\n\t\t$query = $this->db->prepare(\"SELECT count(`taxonomy_id`) FROM `nw_taxonomy` WHERE `taxonomy_value` = ?\");\n\t\t$query->bindValue(1, $category_name);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 0){\n\t\t\t\treturn true;\n\t\t\t}else if($rows >= 1){\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}",
"public function hasTranslation($text_id, $lng = \"\")\n {\n if (empty($lng)) {\n $lng = $this->getCurrentLanguage();\n }\n\n return !empty(self::$texts[$lng][$text_id]);\n }",
"public function hasLanguage($lang)\n {\n return isset($this->langList[$lang]);\n }",
"public function isTranslated()\n {\n return $this->translated;\n }"
] | [
"0.6547997",
"0.6489683",
"0.64836377",
"0.64222354",
"0.6324979",
"0.6221469",
"0.6196649",
"0.61543757",
"0.6046865",
"0.6046182",
"0.6012702",
"0.59357196",
"0.5923772",
"0.5906664",
"0.58937204",
"0.58692455",
"0.5863791",
"0.58507186",
"0.58064294",
"0.5799449",
"0.5787888",
"0.57726806",
"0.57620496",
"0.57335687",
"0.57281023",
"0.5725125",
"0.5694149",
"0.56907326",
"0.56847507",
"0.5629461",
"0.5628073",
"0.56126076",
"0.5594928",
"0.55928093",
"0.5581148",
"0.55811477",
"0.5574793",
"0.5574272",
"0.557261",
"0.5555881",
"0.55494964",
"0.554013",
"0.5531323",
"0.55300075",
"0.5519448",
"0.5517722",
"0.550129",
"0.5473278",
"0.5470781",
"0.5444194",
"0.5430651",
"0.5426802",
"0.5423813",
"0.5406641",
"0.54061437",
"0.540603",
"0.54046345",
"0.53959084",
"0.53932726",
"0.5374176",
"0.53664464",
"0.53639776",
"0.53590375",
"0.53560853",
"0.5351936",
"0.5345696",
"0.53456056",
"0.5343568",
"0.5343001",
"0.53254616",
"0.532255",
"0.53216624",
"0.532088",
"0.52945256",
"0.5287195",
"0.5285195",
"0.5273555",
"0.5266451",
"0.5261043",
"0.5257469",
"0.5239057",
"0.5233503",
"0.52276987",
"0.5225605",
"0.5211784",
"0.52040553",
"0.5202314",
"0.5193752",
"0.51919186",
"0.51698315",
"0.5168819",
"0.51630765",
"0.5159169",
"0.5156018",
"0.51535416",
"0.51474935",
"0.5143328",
"0.5132961",
"0.5132835",
"0.5124812"
] | 0.6255262 | 5 |
After installation migrate all existing data to the Publisher tables | public function migrate_data($entry_ids = array(), $where = array(), $delete_old = FALSE)
{
// Delete old rows. delete() resets the where(), so reset them.
if ($delete_old && !empty($where) && !empty($entry_ids))
{
ee()->db->where_in('entry_id', $entry_ids)
->delete('publisher_category_posts');
}
if ( !empty($entry_ids))
{
ee()->db->where_in('entry_id', $entry_ids);
}
$qry = ee()->db->get('category_posts');
if ($qry->num_rows())
{
foreach ($qry->result_array() as $row)
{
$data = $row;
$data['publisher_lang_id'] = $this->default_language_id;
$data['publisher_status'] = ee()->publisher_setting->default_view_status();
$this->insert_or_update('publisher_category_posts', $data, $row, 'cat_id');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }",
"public function migrate() {}",
"public function migrateDb();",
"public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}",
"public function migrate()\n\t{\n\t}",
"protected function migrateTables()\n {\n foreach ($this->tables as $table) {\n \\DB::getPdo()->exec(\"INSERT IGNORE INTO {$this->newDbName}.{$table} SELECT * FROM {$this->oldDbName}.{$table}\");\n }\n }",
"public function migrate()\n {\n $this->syncRepository();\n $this->copyVariables();\n $this->copyDeployKeys();\n $this->reEnableBuilds();\n }",
"public function migrateDatabase();",
"function migrate(){\n\n create_table();\n save_migration_tables();\n\n}",
"public function migrate()\n {\n $this->prepareWizardsTable();\n\n $this->processProcessing();\n $this->processLogs();\n $this->processConfigData();\n\n $this->prepareOrdersTables();\n $this->prepareOrdersConfigTable();\n $this->processOrdersData();\n }",
"public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }",
"protected function publishDb()\n {\n $timestamp = date('Y_m_d_His', time());\n $migrationStub = __DIR__.'/../database/migrations/create_pages_tables.php';\n $migrationTarget = $this->app->databasePath().'/migrations/'.$timestamp.'_create_pages_tables.php';\n\n $modelFactoryStub = __DIR__.'/../database/factories/PageFactory.php';\n $modelFactoryTarget = $this->app->databasePath().'/factories/PageFactory.php';\n\n $seederStub = __DIR__.'/../database/seeds/PagesTableSeeder.php';\n $seederTarget = $this->app->databasePath().'/seeds/PagesTableSeeder.php';\n\n $this->publishes([\n $migrationStub => $migrationTarget,\n $modelFactoryStub => $modelFactoryTarget,\n $seederStub => $seederTarget,\n ], 'ds.pages.db');\n }",
"public static function update_schema(): void {\n\t\tglobal $wpdb;\n\n\t\t$table_name = static::table_name();\n\t\t$table_fields = static::FIELDS;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t\t$table_fields\n\t\t\tPRIMARY KEY (id)\n\t\t) $charset_collate;\";\n\n\t\tif ( md5( $sql ) === get_option( static::TABLE . '_schemaver', '' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( static::TABLE . '_schemaver', md5( $sql ) );\n\t}",
"public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }",
"public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }",
"public function run()\n {\n Publisher::truncate();\n\n DB::connection('old')->table('publishers')->get()->each(function($publisher) {\n Publisher::create([\n 'id' => $publisher->id,\n 'name' => $publisher->name\n ]);\n });\n }",
"public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }",
"public function acfedu_create_fill_db() {\n\t\t\t\t$this->acfedu_check_table();\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n //require_once( 'lib/import_nl.php' );\n //require_once( 'lib/import_be.php' );\n //require_once( 'lib/import_lux.php' );\n require_once( 'lib/import_id.php' );\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\t\t\t}",
"public static function install_database_for_addons(){\n\t\t$sqls = self::get_table_queries_for_addons();\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n foreach($sqls as $sql){\n error_log(print_r(dbDelta( $sql ), true));\n }\n\t}",
"public static function run_install()\n {\n global $wpdb;\n\n // Create Base Table in mysql\n //$charset_collate = $wpdb->get_charset_collate();\n //require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n }",
"public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }",
"function standardsreader_db_install() {\n\tglobal $wpdb;\n\tglobal $sr_db_version;\n\tdefine( 'DIEONDBERROR', true );\n\t$wpdb->show_errors();\n\t\n\t$main_table_name = $wpdb->prefix . 'standardsreader_maps';\n\t$competency_table = $wpdb->prefix . 'standardsreader_map_comps';\n\t\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$sql = \"CREATE TABLE $main_table_name (\n\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\tuser_id mediumint(9) NOT NULL,\n\t\tset_name tinytext NOT NULL,\n\t\tset_description text DEFAULT '' NOT NULL,\n\t\tset_public tinyint(1) DEFAULT 1 NOT NULL,\n\t\tset_deleted tinyint(1) DEFAULT 0 NOT NULL,\n\t\tset_created text DEFAULT '' NOT NULL,\n\t\tUNIQUE KEY id (id)\n\t) $charset_collate;\";\n\t\n\t$compSql = \"CREATE TABLE $competency_table (\n\t\tmap_id mediumint(9) NOT NULL,\n\t\tcomp_slug text DEFAULT '' NOT NULL, \n\t\torder_comps mediumint(9) NOT NULL\n\t) $charset_collate;\";\n\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t$r1 = dbDelta( $sql );\n\t$r2 = dbDelta($compSql);\n\t\n\techo $wpdb->print_error();\n\n\tadd_option( 'standardsreader_db_version', $sr_db_version );\n}",
"public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }",
"public function create_or_upgrade_tables() {\n\t\tif ( is_multisite() ) {\n\t\t\t$this->create_table( $this->ms_table );\n\t\t}\n\n\t\t$this->create_table( $this->table );\n\t}",
"protected function publishMigrations()\n {\n if (class_exists('CreatePagesTables')) {\n return;\n }\n $timestamp = date('Y_m_d_His', time());\n $stub = __DIR__.'/../database/migrations/create_pages_tables.php';\n $target = $this->app->databasePath().'/migrations/'.$timestamp.'_create_pages_tables.php';\n $this->publishes([$stub => $target], 'ds.pages.migrations');\n }",
"public function install() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->createTable();\r\n\t}\r\n }",
"public function up()\n {\n $subscribers = Subscriber::all();\n\n $defaultCategory = Category::first();\n\n foreach ($subscribers as $key => $subscriber) {\n $subscriber->subscriptions()->add($defaultCategory, [\n 'verification_key' => $subscriber->verification_key,\n 'is_verified' => $subscriber->is_verified,\n 'valid_till' => $subscriber->valid_till,\n ]);\n }\n\n Schema::table('wapp_userconnect_subscribers', function (Blueprint $table) {\n $table->dropColumn('verification_key');\n $table->dropColumn('is_verified');\n $table->dropColumn('verified_at');\n $table->dropColumn('valid_till');\n });\n }",
"function mikado_create_db_tables() {\n\tinclude_once (WP_PLUGIN_DIR . '/mikado/lib/install-db.php');\t\t\t\n\tmikado_install_db();\n}",
"static function install_db() {\r\n\t\tglobal $wpdb;\r\n\t\t$options = get_option( 'mf_timeline' );\r\n\t\t$table = $wpdb->prefix . 'mf_timeline_stories';\r\n\t\t\r\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS `{$table}` (\r\n\t\t\t`story_id` mediumint(9) NOT NULL AUTO_INCREMENT,\r\n\t\t\t`story_title` text NOT NULL,\r\n\t\t\t`story_content` text,\r\n\t\t\t`timeline_date` date NOT NULL DEFAULT '0000-00-00',\r\n\t\t\t`featured` int(1) NOT NULL DEFAULT '0',\r\n\t\t\t`story_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n\t\t\tPRIMARY KEY (`story_id`),\r\n\t\t\tKEY `timeline_date` (`timeline_date`,`story_modified`)\r\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;\";\r\n\t\t\r\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\tdbDelta( $sql );\r\n\t\t\r\n\t\t// Update the user's db version to version 1 and run the upgrade script.\r\n\t\tif( !isset( $options['db_version'] ) || empty( $options['db_version'] ) ) {\r\n\t\t\t$options['db_version'] = 1;\r\n\t\t\tupdate_option( 'mf_timeline', $options );\r\n\r\n\t\t\tself::upgrade_db();\r\n\t\t}\r\n\t}",
"protected function migrateLegacyImportRecords() {}",
"public function up()\n {\n //legacy app clean up\n dbexec('DELETE FROM `#__migrator_versions` WHERE component = \"opensocial\"');\n\n dbexec('ALTER TABLE `#__nodes` CHANGE `meta` `meta` text DEFAULT NULL');\n dbexec('ALTER TABLE `#__edges` CHANGE `meta` `meta` text DEFAULT NULL');\n dbexec('ALTER TABLE `#__components` CHANGE `params` `meta` text DEFAULT NULL');\n dbexec('ALTER TABLE `#__components` DROP COLUMN `link`');\n dbexec('ALTER TABLE `#__components` DROP COLUMN `menuid`');\n dbexec('ALTER TABLE `#__components` DROP COLUMN `admin_menu_link`');\n dbexec('ALTER TABLE `#__components` DROP COLUMN `admin_menu_alt`');\n dbexec('ALTER TABLE `#__components` DROP COLUMN `admin_menu_img`');\n\n //deleting legacy data\n dbexec('DELETE FROM `#__components` WHERE `option` IN (\"com_config\",\"com_cpanel\",\"com_plugins\",\"com_templates\",\"com_components\", \"com_languages\")');\n\n $this->_updateMeta('components');\n\n dbexec('UPDATE `#__components` SET meta = REPLACE(meta, \\'\"allowUserRegistration\":\\', \\'\"allow_registration\":\\') WHERE `option` = \\'com_people\\'');\n\n //legacy data clean up\n dbexec('DELETE FROM `#__plugins` WHERE `element` = \"invite\" ');\n dbexec('ALTER TABLE `#__plugins` DROP COLUMN `access`');\n dbexec('ALTER TABLE `#__plugins` DROP COLUMN `client_id`');\n dbexec('ALTER TABLE `#__plugins` DROP COLUMN `checked_out`');\n dbexec('ALTER TABLE `#__plugins` DROP COLUMN `checked_out_time`');\n\n $this->_updateMeta('plugins');\n\n dbexec('DROP TABLE IF EXISTS `#__templates_menu`');\n dbexec('DROP TABLE IF EXISTS `#__session`');\n dbexec('DROP TABLE IF EXISTS `#__sessions`');\n\n $query = \"CREATE TABLE `#__sessions` (\"\n .\"`id` SERIAL,\"\n .\"`session_id` char(64) NOT NULL,\"\n .\"`node_id` bigint(11) NOT NULL DEFAULT 0,\"\n .\"`username` varchar(255) DEFAULT NULL,\"\n .\"`usertype` varchar(255),\"\n .\"`time` INT(11) DEFAULT 0,\"\n .\"`guest` tinyint(2) DEFAULT '1',\"\n .\"`meta` longtext,\"\n .\"PRIMARY KEY (`id`),\"\n .\"KEY `whosonline` (`guest`,`usertype`,`username`),\"\n .\"UNIQUE KEY `session_id` (`session_id`),\"\n .\"KEY `node_id` (`node_id`),\"\n .\"KEY `username` (`username`)\"\n .\") ENGINE=InnoDB CHARACTER SET=utf8\";\n dbexec($query);\n\n //for people the alias is the same as username\n dbexec(\"UPDATE `#__nodes` SET alias = person_username WHERE type LIKE '%com:people.domain.entity.person' \");\n\n dbexec('DROP TABLE IF EXISTS `#__people_people`');\n\n $query = \"CREATE TABLE `#__people_people` (\"\n .\"`people_person_id` SERIAL,\"\n .\"`node_id` BIGINT UNSIGNED NOT NULL,\"\n .\"`userid` INT(11) DEFAULT NULL,\"\n .\"`email` varchar(255) DEFAULT NULL,\"\n .\"`username` varchar(255) DEFAULT NULL,\"\n .\"`password` varchar(255) DEFAULT NULL,\"\n .\"`usertype` varchar(50) DEFAULT NULL,\"\n .\"`gender` varchar(50) DEFAULT NULL,\"\n .\"`given_name` varchar(255) DEFAULT NULL,\"\n .\"`family_name` varchar(255) DEFAULT NULL,\"\n .\"`network_presence` tinyint(3) NOT NULL DEFAULT 0,\"\n .\"`last_visit_date` datetime DEFAULT NULL,\"\n .\"`time_zone` int(11) DEFAULT NULL,\"\n .\"`language` varchar(100) DEFAULT NULL,\"\n .\"`activation_code` varchar(255) DEFAULT NULL,\"\n .\"PRIMARY KEY (`people_person_id`),\"\n .\"KEY `usertype` (`usertype`),\"\n .\"UNIQUE KEY `username` (`username`),\"\n .\"UNIQUE KEY `email` (`email`),\"\n .\"UNIQUE KEY `node_id` (`node_id`),\"\n .\"KEY `last_visit_date` (`last_visit_date`)\"\n .\") ENGINE=InnoDB CHARACTER SET=utf8\";\n dbexec($query);\n\n $query = \"INSERT INTO `#__people_people` (\"\n .\"`node_id`,`userid`,`username`,`usertype`,`gender`,\"\n .\"`email`,`given_name`,`family_name`,\"\n .\"`last_visit_date`,`time_zone`,`language` )\"\n .\" SELECT \"\n .\"`id`,`person_userid`,`person_username`,`person_usertype`,`actor_gender`,\"\n .\"`person_useremail`,`person_given_name`,`person_family_name`,\"\n .\"`person_lastvisitdate`,`person_time_zone`,`person_language` \"\n .\" FROM `#__nodes` ORDER BY `id`\";\n dbexec($query);\n\n $query = \"UPDATE `#__people_people` AS `p` \"\n .\"INNER JOIN `#__users` AS `u` ON `u`.`id` = `p`.`userid`\"\n .\" SET \"\n .\"`p`.`password` = `u`.`password`,\"\n .\"`p`.`last_visit_date` = `u`.`lastvisitDate`,\"\n .\"`p`.`activation_code` = `u`.`activation`\";\n dbexec($query);\n\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_userid`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_username`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_useremail`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_usertype`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_lastvisitdate`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `actor_gender`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_given_name`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_family_name`');\n dbexec('ALTER TABLE `#__nodes` DROP COLUMN `person_network_presence`');\n\n dbexec('ALTER TABLE `#__nodes` CHANGE `person_time_zone` `timezone` int(3) DEFAULT NULL');\n dbexec('ALTER TABLE `#__nodes` CHANGE `person_language` `language` VARCHAR(50) DEFAULT NULL');\n\n dbexec('ALTER TABLE `#__people_people` DROP COLUMN `userid`');\n\n dbexec('DROP TABLE IF EXISTS `#__users`');\n\n //update user and authentication plugins\n dbexec(\"UPDATE `#__plugins` SET `element` = 'anahita' WHERE `element` = 'joomla'\");\n dbexec(\"UPDATE `#__plugins` SET `name` = 'User - Anahita' WHERE `folder` = 'user' AND `element` = 'anahita'\");\n\n dbexec('ALTER TABLE `#__nodes` CHANGE name name VARCHAR(255) CHARACTER SET utf8mb4');\n dbexec('ALTER TABLE `#__nodes` CHANGE alias alias VARCHAR(255) CHARACTER SET utf8mb4');\n dbexec('ALTER TABLE `#__nodes` CHANGE body body MEDIUMTEXT CHARACTER SET utf8mb4');\n dbexec('ALTER TABLE `#__nodes` CHANGE excerpt excerpt TEXT CHARACTER SET utf8mb4');\n }",
"public function up()\n\t{\n\t\t//\n\t\tDB::query(\"insert into app_apps_applications (id, app_nicename, app_folder, created_at, updated_at)\n\t\t values (1, 'My First Application', 'yourappname', '2013-06-10 12:00:00', '2013-06-10 12:00:00');\");\n\n DB::query(\"insert into app_apps_fbapps (id, fbappid, fbsecret, fbnamespace, app_apps_application_id, created_at, updated_at) \n \tvalues (1, 'fbkey', 'fbsecret', '01', 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00');\");\n \n // Insert 3 application instances\n DB::query(\"insert into app_user_apps_publishes (id, status, app_user_apps_publish_page_id, app_apps_fbapp_id, app_apps_application_id, created_at, updated_at)\n \tvalues\n \t(1, 'A', '0001', 1, 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00'),\n \t(2, 'A', '0002', 1, 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00'),\n \t(3, 'A', '0003', 1, 1, '2013-06-10 12:00:00', '2013-06-10 12:00:00')\n \t;\");\n\n\t}",
"public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }",
"public function safeUp()\n {\n $this->createTable('site', array(\n 'client_id' => self::MYSQL_TYPE_UINT,\n 'domain' => 'string NOT NULL'\n ));\n\n $this->addForeignKey('site_client_id', 'site', 'client_id', 'client', 'id', 'CASCADE', 'RESTRICT');\n\n $this->createTable('site_contract', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'contract_id' => self::MYSQL_TYPE_UINT,\n ));\n\n $this->addForeignKey('site_contract_site_id', 'site_contract', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n $this->addForeignKey('site_contract_contract_id', 'site_contract', 'contract_id', 'contract', 'id', 'CASCADE', 'RESTRICT');\n }",
"protected function silentCacheFrameworkTableSchemaMigration() {}",
"public function up()\n {\n $this->table('articles')\n ->addColumn('title', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('details', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('categories', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('football_ragistrations', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('student_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created_to', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('friends', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('amount', 'float', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('city', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('menus')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('status', 'tinyinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('picnic_ragistrations', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('student_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('amount', 'decimal', [\n 'default' => null,\n 'null' => false,\n 'precision' => 10,\n 'scale' => 2,\n ])\n ->addColumn('created_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('products', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('category_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('profiles')\n ->addColumn('user_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('mobile', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('skills')\n ->addColumn('user_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 30,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('spouses', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('friend_id', 'smallinteger', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('students')\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('age', 'decimal', [\n 'default' => null,\n 'null' => false,\n 'precision' => 10,\n 'scale' => 3,\n ])\n ->addColumn('country', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('created_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('updated_at', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('submenus')\n ->addColumn('menu_id', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('status', 'boolean', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n\n $this->table('users')\n ->addColumn('username', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => false,\n ])\n ->addColumn('email', 'string', [\n 'default' => null,\n 'limit' => 25,\n 'null' => false,\n ])\n ->addColumn('amount', 'integer', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('password', 'string', [\n 'default' => null,\n 'limit' => 100,\n 'null' => false,\n ])\n ->addColumn('image', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ])\n ->addColumn('status', 'tinyinteger', [\n 'default' => '1',\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('modified', 'datetime', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n }",
"protected function bootMigrationsPublishing()\n {\n $this->publishes([\n __DIR__.'/../database/migrations/create_countries_table.php.stub' \n => database_path('migrations/'.date('Y_m_d_His', time()).'_create_countries_table.php'),\n __DIR__.'/../database/migrations/create_two_factor_table.php.stub' \n => database_path('migrations/'.date('Y_m_d_His', time()).'_create_two_factor_table.php'),\n __DIR__.'/../database/migrations/create_users_social_table.php.stub' \n => database_path('migrations/'.date('Y_m_d_His', time()).'_create_users_social_table.php'),\n ], 'migrations');\n }",
"private function createMainDatabaseRecords()\n {\n // get the .sql file\n $sql = (string) @file_get_contents( $this->plugin->getPath() . \"/Setup/install.sql\" );\n\n // insert it\n $this->db->exec( $sql );\n }",
"public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}",
"public function migrate()\n\t{\n\t\t$this->process( $this->mysql );\n\t}",
"private function activateCreateAlterTables()\n {\n $PluginDbStructure = new \\RdDownloads\\App\\Models\\PluginDbStructure();\n $schemas = $PluginDbStructure->get();\n unset($PluginDbStructure);\n\n if (is_array($schemas) && !empty($schemas) && !is_null($this->getDbVersion())) {\n global $wpdb;\n // require file that needs for use dbDelta() function.\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n\n foreach ($schemas as $index => $item) {\n if (isset($item['statement']) && isset($item['tablename'])) {\n $sql = str_replace('%TABLE%', $item['tablename'], $item['statement']);\n\n if (isset($item['is_multisite']) && $item['is_multisite'] === true) {\n // if set to multisite table then it will create prefix_sitenumber_tablename.\n $prefix = $wpdb->prefix;\n } else {\n // if set not to multisite then it will create prefix_tablename.\n $prefix = $wpdb->base_prefix;\n }\n\n $sql = str_replace('%PREFIX%', $prefix, $sql);\n dbDelta($sql);\n unset($sql);\n\n if (function_exists('maybe_convert_table_to_utf8mb4')) {\n maybe_convert_table_to_utf8mb4($prefix . $item['tablename']);\n }\n unset($prefix);\n }\n }// endforeach;\n unset($index, $item);\n }\n\n unset($schemas);\n }",
"protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }",
"public function __invoke()\n {\n $this->migrate();\n }",
"protected function migrateTable()\n {\n DB::schema()->create('models', function ($table) {\n $table->id();\n $table->string('default');\n $table->text('input');\n });\n\n Model::create(['default' => 'model', 'input' => ['en' => 'translation', 'nl' => 'vertaling']]);\n }",
"public function migrateJobsDatabase()\n {\n $this->migrationsRepository = $this->app->make('migration.repository');\n $this->migrationsRepository->createRepository();\n\n $migrator = new StructuredMigrator(\n $this->migrationsRepository,\n $this->app->make('db'),\n new JobsMigrationBatch()\n );\n\n $migrator->run();\n }",
"public function up()\n\t{\n// $import->import();\n\t}",
"public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }",
"public static function setup_db()\r\n {\r\n $installed_ver = get_option( CART_CONVERTER . \"_db_version\" );\r\n\r\n // prevent create table when re-active plugin\r\n if ( $installed_ver != CART_CONVERTER_DB_VERSION ) {\r\n CartModel::setup_db();\r\n EmailModel::setup_db();\r\n //MailTemplateModel::setup_db();\r\n \r\n add_option( CART_CONVERTER . \"_db_version\", CART_CONVERTER_DB_VERSION );\r\n }\r\n }",
"private function bootDatabase(): void\n {\n $baseDir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;\n $migrationsDir = $baseDir . 'database' . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n\n if ($this->app['config']->get('laravel-database-emails.manual_migrations')) {\n $this->publishes([\n $migrationsDir => \"{$this->app->databasePath()}/migrations\",\n ], 'laravel-database-emails-migrations');\n } else {\n $this->loadMigrationsFrom([$migrationsDir]);\n }\n }",
"public function refreshDatabase()\n {\n $this->validateDatabase();\n $this->copySqliteCreate();\n $this->runMigrations();\n\n copy($this->baseSqlite(), $this->copySqlite());\n }",
"function install() {\r\n\t\tglobal $wpdb;\r\n\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n\t\t$table= $wpdb->prefix . 'wik_faves';\r\n\t\t\t\t\r\n\t\t$q= '';\r\n\t\tif( $wpdb->get_var( \"show tables like '$table'\" ) != $table ) {\r\n\t\t\t$q= \"CREATE TABLE \" . $table . \"( \r\n\t\t\t\tid int NOT NULL AUTO_INCREMENT,\r\n\t\t\t\ttitle varchar(255) NOT NULL,\r\n\t\t\t\tfeed_url varchar(255) NOT NULL,\r\n\t\t\t\tfavicon varchar(255) NOT NULL,\r\n\t\t\t\tsortorder tinyint(9) NOT NULL,\r\n\t\t\t\tUNIQUE KEY id (id)\r\n\t\t\t);\";\r\n\t\t}\r\n\t\t\tif( $q != '' ) {\r\n\t\t\t\tdbDelta( $q );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$dfaves= array(\r\n\t\t\t\t\t\tarray('title' => 'Chris Pirillo', \r\n\t\t\t\t\t\t\t\t\t'feed_url' => 'http://feeds.pirillo.com/ChrisPirillo', \r\n\t\t\t\t\t\t\t\t\t'sortorder' => '1'),\r\n\t\t\t\t\t\tarray('title' => 'Lockergnome.com', \r\n\t\t\t\t\t\t\t\t\t'feed_url' => 'http://feed.lockergnome.com/nexus/all', \r\n\t\t\t\t\t\t\t\t\t'sortorder' => '2'),\r\n\t\t\t\t\t\tarray('title' => 'Lockergnome Coupons', \r\n\t\t\t\t\t\t\t\t\t'feed_url' => 'http://feeds.feedburner.com/NewCoupons', \r\n\t\t\t\t\t\t\t\t\t'sortorder' => '3'),\t\t\t\t\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\tforeach( $dfaves as $fave ) {\r\n\t\t\t\t\tif( !$wpdb->get_var( \"SELECT id FROM $table WHERE feed_url = '\" . $fave['feed_url'] . \"'\" ) ) {\r\n\t\t\t\t\t$i= \"INSERT INTO \" . $table . \" (id,title,feed_url,sortorder) VALUES('', '\" . $fave['title'] . \"','\" . $fave['feed_url'] . \"', '\" . $fave['sortorder'] . \"')\";\r\n\t\t\t\t\t$query= $wpdb->query( $i );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\r\n\t}",
"public function up()\n {\n $result = $this->fetchAll(\"SELECT * FROM `visualisation_settings` WHERE `model` = 'BusinessContinuityPlanAudit' ORDER BY `id` DESC\");\n\n if (!empty($result) && count($result) > 1 && !empty($result[0]['id'])) {\n $this->query(\"DELETE FROM `visualisation_settings` WHERE `id` = {$result[0]['id']}\");\n }\n }",
"protected function importDatabaseData() {}",
"function alter_tables_if_required() {\r\n global $wpdb;\r\n $options = get_option('nus_altered_table');\r\n $altercolumns = false;\r\n if(!$options) {\r\n $altercolumns = true;\r\n }\r\n\r\n if($altercolumns) {\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TEMP_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n $wpdb->query(\"ALTER TABLE \" . NUS_TRACKER_TABLE .\" MODIFY nus_feed_id varchar(255) NOT NULL\");\r\n add_option('nus_altered_table', 'altered');\r\n }\r\n\r\n\r\n}",
"function wp_super_edit_install_db_tables() {\n\tglobal $wpdb, $wp_super_edit;\n\n\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n\tif ( !is_object( $wp_super_edit ) ) {\n\t\t$wp_super_edit = new wp_super_edit_admin();\n\t}\n\n\tif ( $wp_super_edit->is_installed ) return;\n\n\tif ( $wpdb->supports_collation() ) {\n\t\tif ( ! empty($wpdb->charset) )\n\t\t\t$charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n\t\tif ( ! empty($wpdb->collate) )\n\t\t\t$charset_collate .= \" COLLATE $wpdb->collate\";\n\t}\n\n\t$install_sql=\"CREATE TABLE $wp_super_edit->db_options (\n\t id bigint(20) NOT NULL auto_increment,\n\t name varchar(60) NOT NULL,\n\t value text NOT NULL,\n\t PRIMARY KEY (id,name),\n\t UNIQUE KEY name (name)\n\t) $charset_collate;\n\tCREATE TABLE $wp_super_edit->db_plugins (\n\t id bigint(20) NOT NULL auto_increment,\n\t name varchar(60) NOT NULL,\n\t url text NOT NULL,\n\t nicename varchar(120) NOT NULL,\n\t description text NOT NULL,\n\t provider varchar(60) NOT NULL,\n\t status varchar(20) NOT NULL default 'no',\n\t callbacks varchar(120) NOT NULL,\n\t PRIMARY KEY (id,name),\n\t UNIQUE KEY name (name)\n\t) $charset_collate;\n\tCREATE TABLE $wp_super_edit->db_buttons (\n\t id bigint(20) NOT NULL auto_increment,\n\t name varchar(60) NOT NULL,\n\t nicename varchar(120) NOT NULL,\n\t description text NOT NULL,\n\t provider varchar(60) NOT NULL,\n\t plugin varchar(60) NOT NULL,\n\t status varchar(20) NOT NULL default 'no',\n\t PRIMARY KEY (id,name),\n\t UNIQUE KEY id (id)\n\t) $charset_collate;\n\tCREATE TABLE $wp_super_edit->db_users (\n\t id bigint(20) NOT NULL auto_increment,\n\t user_name varchar(60) NOT NULL,\n\t user_nicename varchar(60) NOT NULL,\n\t user_type text NOT NULL,\n\t editor_options text NOT NULL,\n\t PRIMARY KEY (id,user_name),\n\t UNIQUE KEY id (id)\n\t) $charset_collate;\";\n\t\n\tdbDelta($install_sql);\n\t\n\t$wp_super_edit->is_installed = true;\n\t\t\n}",
"static function upgrade_db() {\r\n\t\tglobal $wpdb, $mf_timeline_db_version;\r\n\t\t$options = get_option( 'mf_timeline' );\r\n\r\n\t\tif( $options['db_version'] < $mf_timeline_db_version ) {\r\n\t\t\tswitch( true ) {\r\n\t\t\t\t/**\r\n\t\t\t\t * Version: 2\r\n\t\t\t\t * Purpose: Added author column to the stories table.\r\n\t\t\t\t * @author Matt Fairbrass\r\n\t\t\t\t */\r\n\t\t\t\tcase ($options['db_version'] < 2) :\r\n\t\t\t\t\t$table = $wpdb->prefix . 'mf_timeline_stories';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$sql = \"ALTER TABLE {$table} ADD `story_author` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0',\r\n\t\t\t\t\tADD INDEX ( `story_author` )\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( $wpdb->query($sql) !== false ) {\r\n\t\t\t\t\t\t$options['db_version'] = 2;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_option( 'mf_timeline', $options );\r\n\t\t}\r\n\t}",
"public function safeUp()\n\t{\n\n\t\t$sql=\"ALTER TABLE `article` DROP INDEX `hid`;ALTER TABLE `article` DROP INDEX `IDX_CID_SHOW_TIME`;ALTER TABLE `article` DROP INDEX `IDX_SHOW_TIME`;ALTER TABLE `article` ADD INDEX `IND_SHOWTIME_STATUS_CID` (`show_time`,`status`,`cid`);\";\n\t\t$this->execute($sql);\n\t\t$this->refreshTableSchema('article');\n\t}",
"public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }",
"public function migrate() {\n \n\n /**\n * create table for cities\n */\n if (!Capsule::schema()->hasTable('city')) {\n Capsule::schema()->create('city', function($table)\n {\n $table->integer('id', true);\n $table->string('name');\n $table->string('lat');\n $table->string('lng');\n $table->integer('zoom_level');\n });\n }\n\n /**\n * create table for series\n */\n if (!Capsule::schema()->hasTable('serie')) {\n Capsule::schema()->create('serie', function($table)\n {\n\n $table->integer('id', true);\n $table->string('distance')->default('');\n $table->string('image')->default('');\n $table->string('name')->default('');\n $table->timestamp('updated_at')->default(Capsule::raw('CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP'));\n $table->timestamp('created_at')->default(Capsule::raw('CURRENT_TIMESTAMP'));\n //FK\n $table->integer('city_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('city_id')->references('id')->on('city')->onDelete('cascade');\n // We'll need to ensure that MySQL uses the InnoDB engine to\n // support the indexes, other engines aren't affected.\n $table->engine = 'InnoDB';\n });\n }\n\n /**\n * create table photos\n */\n if (!Capsule::schema()->hasTable('photo')) {\n Capsule::schema()->create('photo', function($table)\n {\n $table->integer('id', true);\n $table->string('url');\n $table->string('description');\n $table->string('lat');\n $table->string('lng');\n //FK\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n\t\t\n\t\t/**\n * create table partie\n */\n if (!Capsule::schema()->hasTable('partie')) {\n Capsule::schema()->create('partie', function($table)\n {\n $table->integer('id', true);\n $table->string('token');\n $table->integer('nb_photos');\n $table->integer('state');\n $table->string('player_username');\n $table->integer('score');\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n\n /**\n * create table palier\n */\n if (!Capsule::schema()->hasTable('palier')) {\n Capsule::schema()->create('palier', function($table)\n {\n $table->integer('id', true);\n $table->integer('coef');\n $table->integer('points');\n\n //FK\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n\n /**\n * create table temps\n */\n if (!Capsule::schema()->hasTable('temps')) {\n Capsule::schema()->create('temps', function($table)\n {\n $table->integer('id', true);\n $table->integer('nb_seconds');\n $table->integer('coef');\n\n //FK\n $table->integer('serie_id');\n\n $table->engine = 'InnoDB';\n\n //Foreign keys declaration\n $table->foreign('serie_id')->references('id')->on('serie')->onDelete('cascade');\n });\n }\n /**\n * create table temps\n */\n if (!Capsule::schema()->hasTable('user')) {\n Capsule::schema()->create('user', function($table)\n {\n $table->integer('id', true);\n $table->string('username');\n $table->string('password');\n\n $table->engine = 'InnoDB';\n\n });\n }\n\n }",
"public function migrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Database/Migrations');\n\n $this->publishes([\n __DIR__.'/Database/Migrations/' => database_path('migrations')\n ], $this->packageName.'-migrations');\n }",
"public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}",
"function install_main_table() {\n global $wpdb;\n\n $charset_collate = '';\n if ( ! empty($wpdb->charset) )\n $charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n if ( ! empty($wpdb->collate) )\n $charset_collate .= \" COLLATE $wpdb->collate\";\t\n $table_name = $wpdb->prefix . \"store_locator\";\n $sql = \"CREATE TABLE $table_name (\n sl_id mediumint(8) unsigned NOT NULL auto_increment,\n sl_store varchar(255) NULL,\n sl_address varchar(255) NULL,\n sl_address2 varchar(255) NULL,\n sl_city varchar(255) NULL,\n sl_state varchar(255) NULL,\n sl_zip varchar(255) NULL,\n sl_country varchar(255) NULL,\n sl_latitude varchar(255) NULL,\n sl_longitude varchar(255) NULL,\n sl_tags mediumtext NULL,\n sl_description text NULL,\n sl_email varchar(255) NULL,\n sl_url varchar(255) NULL,\n sl_hours varchar(255) NULL,\n sl_phone varchar(255) NULL,\n sl_fax varchar(255) NULL,\n sl_image varchar(255) NULL,\n sl_private varchar(1) NULL,\n sl_neat_title varchar(255) NULL,\n sl_linked_postid int NULL,\n sl_pages_url varchar(255) NULL,\n sl_pages_on varchar(1) NULL,\n sl_option_value longtext NULL,\n sl_lastupdated timestamp NOT NULL default current_timestamp,\t\t\t\n PRIMARY KEY (sl_id),\n KEY (sl_store(255)),\n KEY (sl_longitude(255)),\n KEY (sl_latitude(255))\n ) \n $charset_collate\n \";\n\n // If we updated an existing DB, do some mods to the data\n //\n if ($this->dbupdater($sql,$table_name) === 'updated') {\n // We are upgrading from something less than 2.0\n //\n if (floatval($this->db_version_on_start) < 2.0) {\n dbDelta(\"UPDATE $table_name SET sl_lastupdated=current_timestamp \" . \n \"WHERE sl_lastupdated < '2011-06-01'\"\n );\n } \n if (floatval($this->db_version_on_start) < 2.2) {\n dbDelta(\"ALTER $table_name MODIFY sl_description text \");\n }\n } \n\n //set up google maps v3\n $old_option = get_option('sl_map_type');\n $new_option = 'roadmap';\n switch ($old_option) {\n case 'G_NORMAL_MAP':\n $new_option = 'roadmap';\n break;\n case 'G_SATELLITE_MAP':\n $new_option = 'satellite';\n break;\n case 'G_HYBRID_MAP':\n $new_option = 'hybrid';\n break;\n case 'G_PHYSICAL_MAP':\n $new_option = 'terrain';\n break;\n default:\n $new_option = 'roadmap';\n break;\n }\n update_option('sl_map_type', $new_option);\n }",
"public static function migrateDatabase()\n {\n DB::statement(\"CREATE TABLE IF NOT EXISTS `videos` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `premium` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `failed_jobs` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `uuid` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,\n `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`),\n UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `images` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,\n `storage` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `migrations` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `batch` int(11) NOT NULL,\n PRIMARY KEY (`id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `movies` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `year` smallint(5) unsigned NOT NULL,\n `rating` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `length` mediumint(8) unsigned NOT NULL,\n `cast` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `genre` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `thumbnail` bigint(20) unsigned NOT NULL,\n `video` bigint(20) unsigned NOT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n `trailer` bigint(20) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `movies_thumbnail_foreign` (`thumbnail`),\n KEY `movies_video_foreign` (`video`),\n KEY `movies_trailer_foreign` (`trailer`),\n CONSTRAINT `movies_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`),\n CONSTRAINT `movies_trailer_foreign` FOREIGN KEY (`trailer`) REFERENCES `videos` (`id`),\n CONSTRAINT `movies_video_foreign` FOREIGN KEY (`video`) REFERENCES `videos` (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `password_resets` (\n `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n KEY `password_resets_email_index` (`email`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `series` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `year` smallint(5) unsigned NOT NULL,\n `rating` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `cast` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `genre` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n `thumbnail` bigint(20) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `series_thumbnail_foreign` (`thumbnail`),\n CONSTRAINT `series_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `settings` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `setting` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"\tCREATE TABLE IF NOT EXISTS `subscriptions` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `user_id` bigint(20) unsigned NOT NULL,\n `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_plan` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `quantity` int(11) DEFAULT NULL,\n `trial_ends_at` timestamp NULL DEFAULT NULL,\n `ends_at` timestamp NULL DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `subscriptions_user_id_stripe_status_index` (`user_id`,`stripe_status`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `subscription_items` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `subscription_id` bigint(20) unsigned NOT NULL,\n `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `stripe_plan` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `quantity` int(11) DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `subscription_items_subscription_id_stripe_plan_unique` (`subscription_id`,`stripe_plan`),\n KEY `subscription_items_stripe_id_index` (`stripe_id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `subscription_types` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `product_id` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n ) \");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `subscription_plans` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `stripe_price_id` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,\n `benefits` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `subscription_type_id` bigint(20) unsigned NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `price` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `currency` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `billing_interval` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`),\n KEY `subscription_plans_subscription_type_id_foreign` (`subscription_type_id`),\n CONSTRAINT `subscription_plans_subscription_type_id_foreign` FOREIGN KEY (`subscription_type_id`) REFERENCES `subscription_types` (`id`)\n )\");\n\n DB::statement(\"\tCREATE TABLE IF NOT EXISTS `translations` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `language` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n PRIMARY KEY (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `users` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `email_verified_at` timestamp NULL DEFAULT NULL,\n `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,\n `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `stripe_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `card_brand` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `card_last_four` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n `trial_ends_at` timestamp NULL DEFAULT NULL,\n `roles` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'user',\n `language` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `users_email_unique` (`email`),\n KEY `users_stripe_id_index` (`stripe_id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `seasons` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `order` smallint(6) NOT NULL,\n `series_id` bigint(20) unsigned NOT NULL,\n `thumbnail` bigint(20) unsigned NOT NULL,\n `trailer` bigint(20) unsigned NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `year` smallint(5) unsigned NOT NULL,\n PRIMARY KEY (`id`),\n KEY `seasons_series_id_foreign` (`series_id`),\n KEY `seasons_thumbnail_foreign` (`thumbnail`),\n KEY `seasons_trailer_foreign` (`trailer`),\n CONSTRAINT `seasons_series_id_foreign` FOREIGN KEY (`series_id`) REFERENCES `series` (`id`),\n CONSTRAINT `seasons_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`),\n CONSTRAINT `seasons_trailer_foreign` FOREIGN KEY (`trailer`) REFERENCES `videos` (`id`)\n )\");\n\n DB::statement(\"CREATE TABLE IF NOT EXISTS `episodes` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,\n `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL,\n `season_id` bigint(20) unsigned NOT NULL,\n `thumbnail` bigint(20) unsigned NOT NULL,\n `video` bigint(20) unsigned NOT NULL,\n `length` mediumint(8) unsigned NOT NULL,\n `created_at` timestamp NULL DEFAULT NULL,\n `updated_at` timestamp NULL DEFAULT NULL,\n `public` tinyint(1) NOT NULL DEFAULT '0',\n `order` smallint(6) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `episodes_season_id_foreign` (`season_id`),\n KEY `episodes_thumbnail_foreign` (`thumbnail`),\n KEY `episodes_video_foreign` (`video`),\n CONSTRAINT `episodes_season_id_foreign` FOREIGN KEY (`season_id`) REFERENCES `seasons` (`id`),\n CONSTRAINT `episodes_thumbnail_foreign` FOREIGN KEY (`thumbnail`) REFERENCES `images` (`id`),\n CONSTRAINT `episodes_video_foreign` FOREIGN KEY (`video`) REFERENCES `videos` (`id`)\n )\");\n\n //v0.2.0 \n if(!Schema::hasColumn('movies', 'premium'))\n DB::statement(\"ALTER TABLE movies ADD premium BOOLEAN NOT NULL DEFAULT 1\");\n\n if(!Schema::hasColumn('movies', 'auth'))\n DB::statement(\"ALTER TABLE movies ADD auth BOOLEAN NOT NULL DEFAULT 1\");\n \n if(!Schema::hasColumn('episodes', 'premium'))\n DB::statement(\"ALTER TABLE episodes ADD premium BOOLEAN NOT NULL DEFAULT 1\");\n\n if(!Schema::hasColumn('episodes', 'auth'))\n DB::statement(\"ALTER TABLE episodes ADD auth BOOLEAN NOT NULL DEFAULT 1\");\n \n if(!Schema::hasColumn('videos', 'auth')) \n DB::statement(\"ALTER TABLE videos ADD auth BOOLEAN NOT NULL DEFAULT 1\");\n\n if(!Schema::hasColumn('videos', 'premium')) \n DB::statement(\"ALTER TABLE videos ADD premium BOOLEAN NOT NULL DEFAULT 1\");\n \n }",
"public function install()\n {\n $sql = $this->getSchemaDefinition();\n if (false === $this->deleteExisting && $this->hasExistingTables()) {\n $this->error = 'The database already has tables, call install($deleteExisting = true) to overwrite them';\n return false;\n }\n \n $this->uninstall($this->deleteExisting);\n $this->getAdminReq()->insertUpdateData($sql);\n \n $this->resetExistingTables();\n return true;\n }",
"function wpei_install_db(){\n\tglobal $wpdb, $app_db_province,$app_db_city;\n\n\tif($wpdb->get_var(\"show tables like '$app_db_province'\") != $app_db_province ) {\n\n $sql = \"CREATE TABLE $app_db_province (\n id int(11) NOT NULL AUTO_INCREMENT,\n province_name varchar(255) NOT NULL,\n status tinyint(4) NOT NULL DEFAULT '1',\n PRIMARY KEY (id),\n UNIQUE KEY province_name (province_name)\n );\";\n\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n }\n\n\tif($wpdb->get_var(\"show tables like '$app_db_city'\") != $app_db_city ) {\n $sql2 = \"CREATE TABLE $app_db_city (\n id int(11) NOT NULL AUTO_INCREMENT,\n city_name varchar(255) NOT NULL,\n shipping_rate float NOT NULL,\n province_id int(11) NOT NULL,\n PRIMARY KEY (id)\n );\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql2);\n }\n}",
"protected function seedTablesStructure()\n {\n $getStructureDump = new Process(\"mysqldump -u {$this->user} -p{$this->password} --no-data {$this->oldDbName} > {$this->oldDbName}.dump\");\n $getStructureDump->run();\n\n $fillStructureDump = new Process(\"mysql -u {$this->user} -p{$this->password} {$this->newDbName} < {$this->oldDbName}.dump\");\n $fillStructureDump->run();\n\n $removeDumpFile = new Process(\"rm -f {$this->oldDbName}.dump\");\n $removeDumpFile->run();\n }",
"private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}",
"public function change()\n {\n $this->table('news', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'biginteger', ['identity' => true])\n ->addColumn('title', 'string', ['limit' => 255])\n ->create();\n\n $this->table('news1', ['id' => false, 'primary_key' => ['id']])\n ->addColumn('id', 'biginteger', ['identity' => true])\n ->addColumn('title', 'string', ['limit' => 255])\n ->create();\n }",
"function pw_sample_plugin_create_table() {\n\tglobal $wpdb;\n$charset_collate = $wpdb->get_charset_collate();\n\n$sql = \"CREATE TABLE `book_meta_dataa` (\n\t\tID INTEGER NOT NULL AUTO_INCREMENT,\n\t\tauthor_name TEXT NOT NULL,\n\t\tprice bigint(64),\n\t\tpublisher text DEFAULT '',\n\t\tisbn text DEFAULT '',\n\t\tyr text DEFAULT '',\n\t\tedi text DEFAULT '',\n\t\tur text DEFAULT '',\n\tPRIMARY KEY (ID)\n) $charset_collate;\";\n\nrequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\ndbDelta($sql);\n\t\n }",
"public function up() {\n\n\t$works = $this->select_all(\"SELECT * FROM works\");\n\n\tif($works) {\n\n\t\tforeach ($works as $row) {\n\n\t\t\t$id = $row['id'];\n\t\t\t$name = mysql_real_escape_string($row['title']);\n\t\t\t$controller = 'works';\n\t\t\t$classification = mysql_real_escape_string($row['classification']);\n\t\t\t$catalog_level = 'item';\n\t\t\t$slug = $row['slug'];\n\t\t\t$earliest_date = $row['earliest_date'];\n\t\t\t$latest_date = $row['latest_date'];\n\t\t\t$earliest_date_format = $row['earliest_date_format'];\n\t\t\t$latest_date_format = $row['latest_date_format'];\n\t\t\t$date_created = $row['date_created'];\n\t\t\t$date_modified = $row['date_modified'];\n\t\t\t$user_id = $row['user_id'];\n\t\t\n\t\t\t$this->execute(\"INSERT INTO archives (id, name, controller, classification, catalog_level, slug, earliest_date, latest_date, earliest_date_format, latest_date_format, date_created, date_modified, user_id) VALUES ('$id', '$name', '$controller', '$classification', '$catalog_level', '$slug', '$earliest_date', '$latest_date', '$earliest_date_format', '$latest_date_format', '$date_created', '$date_modified', '$user_id')\");\n\n\t\t}\n\n\t}\n\n\t//The previous inserts created entries in the archives_histories table, but we want to re-construct this manually from the works_histories table\t\n\n\t$works_histories = $this->select_all(\"SELECT * FROM works_histories\");\n\n\tif($works_histories) {\n\n\t\t$this->execute(\"DELETE FROM archives_histories WHERE controller = 'works'\");\n\n\t\tforeach ($works_histories as $row) {\n\n\t\t\t$id = $row['id'];\n\t\t\t$archive_id = $row['work_id'];\n\t\t\t$name = mysql_real_escape_string($row['title']);\n\t\t\t$controller = 'works';\n\t\t\t$classification = mysql_real_escape_string($row['classification']);\n\t\t\t$catalog_level = 'item';\n\t\t\t$slug = $row['slug'];\n\t\t\t$earliest_date = $row['earliest_date'];\n\t\t\t$latest_date = $row['latest_date'];\n\t\t\t$earliest_date_format = $row['earliest_date_format'];\n\t\t\t$latest_date_format = $row['latest_date_format'];\n\t\t\t$date_created = $row['date_created'];\n\t\t\t$date_modified = $row['date_modified'];\n\t\t\t$user_id = $row['user_id'];\n\t\t\t$start_date = $row['start_date'];\n\t\t\t$end_date = $row['end_date'];\n\t\t\t\n\t\t\t$this->execute(\"INSERT INTO archives_histories (id, archive_id, name, controller, classification, catalog_level, slug, earliest_date, latest_date, earliest_date_format, latest_date_format, date_created, date_modified, user_id, start_date, end_date) VALUES ('$id', '$archive_id', '$name', '$controller', '$classification', '$catalog_level', '$slug', '$earliest_date', '$latest_date', '$earliest_date_format', '$latest_date_format', '$date_created', '$date_modified', '$user_id', '$start_date', '$end_date')\");\n\n\t\t}\n\n\t}\n\n\t//Re-do the Works table\n\n\t$this->execute(\"CREATE TEMPORARY TABLE tmp_works AS (SELECT * FROM works)\");\n\t$this->execute(\"CREATE TEMPORARY TABLE tmp_works_histories AS (SELECT * FROM works_histories)\");\n\n\t$this->execute(\"DROP TRIGGER WorksHistoriesTableInsert\");\n\t$this->execute(\"DROP TRIGGER WorksHistoriesTableDelete\");\n\t$this->execute(\"DROP TRIGGER WorksHistoriesTableUpdate\");\n\n\t$tables = array('works', 'works_histories');\n\n\tforeach ($tables as $table) {\n\t\t$this->execute(\"DROP TABLE $table\");\n\n\t\t$t = $this->create_table($table, array(\"id\" => false));\n\n\t\tif ($table == 'works') {\n\t\t\t$t->column(\"id\", \"integer\", array(\"unsigned\" => true, \"primary_key\" => true, \"null\" => false));\n\t\t}\n\n\t\tif ($table == 'works_histories' ) {\n\t\t\t$t->column(\"id\", \"integer\", array(\"unsigned\" => true, \"primary_key\" => true, \"auto_increment\" => true));\n\t\t\t$t->column(\"work_id\", \"integer\", array(\"unsigned\" => true, \"null\" => false));\n\t\t}\n\n\t\t$t->column(\"title\", \"string\", array(\"limit\" => 1024, \"null\" => false));\n\t\t$t->column(\"artist\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"creation_number\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"materials\", \"string\", array(\"limit\" => 1024, \"null\" => false));\n\t\t$t->column(\"techniques\", \"string\", array(\"limit\" => 1024, \"null\" => false));\n\t\t$t->column(\"color\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"format\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"shape\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"size\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"state\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"location\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"quantity\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"annotation\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"inscriptions\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"height\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"width\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"depth\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"length\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"circumference\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"diameter\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"volume\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"weight\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"area\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"base\", \"float\", array(\"null\" => false));\n\t\t$t->column(\"running_time\", \"string\", array(\"null\" => false));\n\t\t$t->column(\"measurement_remarks\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"attributes\", \"text\", array(\"null\" => false));\n\t\t$t->column(\"remarks\", \"text\", array(\"null\" => false));\n\n\t\tif ($table == 'works_histories' ) {\n\t\t\t$t->column(\"start_date\", \"integer\", array(\"unsigned\" => true));\n\t\t\t$t->column(\"end_date\", \"integer\", array(\"unsigned\" => true));\n\t\t}\n\n\t\t$t->finish();\n\t\t\n\t\tif ($table == 'works') {\n\n\t\t\t$tmp_works = $this->select_all(\"SELECT * FROM tmp_works\");\n\n\t\t} elseif ($table == 'works_histories') {\n\n\t\t\t$tmp_works = $this->select_all(\"SELECT * FROM tmp_works_histories\");\n\n\t\t}\t\n\n\t\tif($tmp_works) {\n\t\t\n\t\t\tforeach ($tmp_works as $row) {\n\n\t\t\t\t$id = $row['id'];\n\t\t\t\t$title = mysql_real_escape_string($row['title']);\n\t\t\t\t$artist = mysql_real_escape_string($row['artist']);\n\t\t\t\t$creation_number = mysql_real_escape_string($row['creation_number']);\n\t\t\t\t$materials = mysql_real_escape_string($row['materials']);\n\t\t\t\t$quantity = mysql_real_escape_string($row['quantity']);\n\t\t\t\t$location = mysql_real_escape_string($row['location']);\n\t\t\t\t$annotation = mysql_real_escape_string($row['annotation']);\n\t\t\t\t$height = $row['height'];\n\t\t\t\t$width = $row['width'];\n\t\t\t\t$depth = $row['depth'];\n\t\t\t\t$diameter = $row['diameter'];\n\t\t\t\t$weight = $row['weight'];\n\t\t\t\t$running_time = mysql_real_escape_string($row['running_time']);\n\t\t\t\t$measurement_remarks = mysql_real_escape_string($row['measurement_remarks']);\n\t\t\t\t$remarks = mysql_real_escape_string($row['remarks']);\n\t\t\t\t\n\t\t\t\tif ($table == 'works') {\n\t\t\t\t\t$this->execute(\"INSERT INTO works (id, title, artist, creation_number, materials, quantity, location, height, width, depth, diameter, weight, running_time, measurement_remarks, annotation, remarks) VALUES ('$id', '$title', '$artist', '$creation_number', '$materials', '$quantity', '$location', '$height', '$width', '$depth', '$diameter', '$weight', '$running_time', '$measurement_remarks', '$annotation', '$remarks') \");\n\t\t\t\t} elseif ($table == 'works_histories') {\n\n\t\t\t\t\t$work_id = $row['work_id'];\n\t\t\t\t\t$start_date = $row['start_date'];\n\t\t\t\t\t$end_date = $row['end_date'];\n\n\t\t\t\t\t$this->execute(\"INSERT INTO works_histories (id, work_id, title, artist, creation_number, materials, quantity, location, height, width, depth, diameter, weight, running_time, measurement_remarks, annotation, remarks, start_date, end_date) VALUES ('$id', '$work_id', '$title', '$artist', '$creation_number', '$materials', '$quantity', '$location', '$height', '$width', '$depth', '$diameter', '$weight', '$running_time', '$measurement_remarks', '$annotation', '$remarks', '$start_date', '$end_date') \");\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t}\n\n\t//Any end dates that are 0 should instead be NULL\n\n\t$this->execute(\"UPDATE archives_histories SET end_date = NULL where end_date = 0\");\n\t$this->execute(\"UPDATE works_histories SET end_date = NULL where end_date = 0\");\n\n\t//Finally, create the triggers for Works Histories\n\t\t\n\t$this->execute(\"CREATE TRIGGER WorksHistoriesTableInsert AFTER INSERT ON works FOR EACH ROW BEGIN DECLARE N int(11); SET N = UNIX_TIMESTAMP(); INSERT INTO works_histories (work_id, title, artist, creation_number, materials, techniques, color, format, shape, size, state, location, quantity, annotation, inscriptions, height, width, depth, length, circumference, diameter, volume, weight, area, base, running_time, measurement_remarks, attributes, remarks, start_date, end_date) VALUES (NEW.id, NEW.title, NEW.artist, NEW.creation_number, NEW.materials, NEW.techniques, NEW.color, NEW.format, NEW.shape, NEW.size, NEW.state, NEW.location, NEW.quantity, NEW.annotation, NEW.inscriptions, NEW.height, NEW.width, NEW.depth, NEW.length, NEW.circumference, NEW.diameter, NEW.volume, NEW.weight, NEW.area, NEW.base, NEW.running_time, NEW.measurement_remarks, NEW.attributes, NEW.remarks, N, NULL); END\");\n\t$this->execute(\"CREATE TRIGGER WorksHistoriesTableDelete AFTER DELETE ON works FOR EACH ROW BEGIN DECLARE N int(11); SET N = UNIX_TIMESTAMP(); UPDATE works_histories SET end_date = N WHERE work_id = OLD.id AND end_date IS NULL; END\");\n\t$this->execute(\"CREATE TRIGGER WorksHistoriesTableUpdate AFTER UPDATE ON works FOR EACH ROW BEGIN DECLARE N int(11); SET N = UNIX_TIMESTAMP(); UPDATE works_histories SET end_date = N WHERE work_id = OLD.id AND end_date IS NULL; INSERT INTO works_histories (work_id, title, artist, creation_number, materials, techniques, color, format, shape, size, state, location, quantity, annotation, inscriptions, height, width, depth, length, circumference, diameter, volume, weight, area, base, running_time, measurement_remarks, attributes, remarks, start_date, end_date) VALUES (NEW.id, NEW.title, NEW.artist, NEW.creation_number, NEW.materials, NEW.techniques, NEW.color, NEW.format, NEW.shape, NEW.size, NEW.state, NEW.location, NEW.quantity, NEW.annotation, NEW.inscriptions, NEW.height, NEW.width, NEW.depth, NEW.length, NEW.circumference, NEW.diameter, NEW.volume, NEW.weight, NEW.area, NEW.base, NEW.running_time, NEW.measurement_remarks, NEW.attributes, NEW.remarks, N, NULL); END\");\t\n\n }",
"public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }",
"public function upgrade()\n {\n \tif (!Schema::hasColumn('products', 'sku')) {\n\n Schema::table('products', function (Blueprint $table) {\n $table->string('sku', 40)->nullable();\n });\n\n }\n }",
"public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }",
"public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }",
"public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}",
"public function upgrade() {\n//\t\tupdate it's database table, you will need to run this:\n//\t\t\n//\t\t$est = AttributeType::getByHandle('attribute_handle');\n//\t\t$path = $est->getAttributeTypeFilePath(FILENAME_ATTRIBUTE_DB);\n//\t\tPackage::installDB($path);\n\n\t\tparent::upgrade();\n\t\t//$pkg = Package::getByHandle($this->pkgHandle);\n\t\t//$this->installAdditionalPageAttributes($pkg);\n\t}",
"public function install()\n {\n $tables = $this->getTables();\n foreach($tables as $table) {\n ORM::registerTableOnFly($table);\n }\n $tables['pages']->bindTable('template', 'id', 'templates', OrmTable::MANY_TO_ONE, false, true);\n $pagesBind = $this->tables['pages']->bindTable('parent', 'id', 'pages', OrmTable::MANY_TO_ONE, false, true);\n $pagesBind->setCustomLeftField(\"parentPage\");\n\n $pageToIncludeBind = $tables['pages']->bindTable('id', 'page', 'includes', OrmTable::ONE_TO_MANY, true, true);\n $pageToIncludeBind->setCustomLeftField(\"includes\");\n\n\n //@TODO includes table must be binded to blocks, blocks to templates. Templates need no bind to includes.\n $templateToIncludeBind = $tables['templates']->bindTable('id', 'template', 'includes', OrmTable::ONE_TO_MANY, true, true);\n $templateToIncludeBind->setCustomLeftField(\"includes\");\n\n $templateToBlockBind = $tables['templates']->bindTable('id', 'template', 'blocks', OrmTable::ONE_TO_MANY, true, true);\n $templateToBlockBind->setCustomLeftField(\"blocks\");\n\n foreach($tables as $table) {\n ORM::createTable($table);\n }\n $this->addBaseDataToDatabase();\n }",
"public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }",
"function ois_install_database() {\r\n global $wpdb;\r\n\r\n $table_name = $wpdb->prefix . 'optinskin';\r\n\r\n // create the table.\r\n // this table is specifically for storing impressions and submissions data.\r\n\r\n $sql = \"CREATE TABLE $table_name (\r\n skin int(4),\r\n ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\r\n post int(4),\r\n submission int(2));\";\r\n //echo $sql;\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n dbDelta( $sql );\r\n}",
"abstract public function installSQL();",
"public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }",
"private function prepareDatabase()\n {\n if ($database = $this->getStringOption('database')) {\n $this->migrator->setConnection($database);\n }\n\n if ( ! $this->migrator->repositoryExists()) {\n $this->call('migrate:install', [\n '--database' => $database,\n ]);\n }\n }",
"protected function publishMigrations()\n {\n if (class_exists('CreateBouncerTables')) {\n return;\n }\n\n $timestamp = date('Y_m_d_His', time());\n\n $stub = __DIR__.'/../migrations/create_bouncer_tables.php';\n\n $target = $this->app->databasePath().'/migrations/'.$timestamp.'_create_bouncer_tables.php';\n\n $this->publishes([$stub => $target], 'bouncer.migrations');\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 updateDatabase() {\r\n // All the extra function remove an unnecessary layer of arrays\r\n $tables_in_database = DB::tablesInDatabase();\r\n\r\n // List of matched tables\r\n $matched = [];\r\n\r\n /** @var Table $table */\r\n foreach (DB::tableInstances() as $i => $table) {\r\n $this->table = $table;\r\n $this->table_name = $table::getName();\r\n\r\n if(in_array($this->table_name, $tables_in_database)) {\r\n array_push($matched, $table->class());\r\n\r\n // Go through and check each table\r\n $this->updateExistingTable();\r\n }\r\n }\r\n\r\n // Loops over to see if any new tables have appeared and if so add them\r\n foreach (array_diff(DB::tables(), $matched) as $table) {\r\n DB::createTableIfNotExists($table);\r\n\r\n echo \"Created $table \\n\";\r\n if($this->log_changes) Logger::migration(\"Created $table\");\r\n }\r\n\r\n // Loops over and find tables defined in the Database but not added to the DB::$table_instances array\r\n // If found it removes them from the Database\r\n foreach (array_diff($tables_in_database, DB::tablesByName()) as $table) {\r\n // Checks for reference tables used in Many to Many relationships\r\n // If found continue as they should not be dropped\r\n if(in_array($table, DB::getReferenceTables())) continue;\r\n\r\n // FIXME: drop reference table first to stop foreign key constraint error\r\n\r\n $sql = \"DROP TABLE $table\";\r\n\r\n $q = DB::connection()->query($sql);\r\n\r\n if($q === false) {\r\n //throw new ColumnNotFoundError(\"Error given column(s) do not exist in table\");\r\n throw new SQLQueryError(DB::connection()->error());\r\n } else {\r\n echo \"Dropped $table \\n\";\r\n if ($this->log_changes) Logger::migration(\"Dropped $table\");\r\n }\r\n }\r\n }",
"public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}",
"public function migrate()\n {\n $db = new \\SQLite3(\"ATM.db\");\n\n $query = \"CREATE TABLE IF NOT EXISTS \" . $this->table_name . \" \";\n $fields = array();\n\n foreach($this->fields as $name=>$type) {\n $fields[] = \"$name $type\";\n }\n\n $query .= \"(\" . implode(\", \", $fields) . \")\";\n\n $db->exec($query);\n }",
"public static function es_upgrade_database_for_3_3_6() {\n\n\t\tglobal $wpdb;\n\n\t\t$template_table_exists = $wpdb->query( \"SHOW TABLES LIKE '{$wpdb->prefix}es_templatetable'\" );\n\t\tif ( $template_table_exists > 0 ) {\n\n\t\t\t// To check if column es_templ_slug exists or not\n\t\t\t$es_template_col = \"SHOW COLUMNS FROM {$wpdb->prefix}es_templatetable LIKE 'es_templ_slug' \";\n\t\t\t$results_template_col = $wpdb->get_results($es_template_col, 'ARRAY_A');\n\t\t\t$template_num_rows = $wpdb->num_rows;\n\n\t\t\t// If column doesn't exists, then insert it\n\t\t\tif ( $template_num_rows != '1' ) {\n\t\t\t\t// Template table\n\t\t\t\t$wpdb->query( \"ALTER TABLE {$wpdb->prefix}es_templatetable\n\t\t\t\t\t\t\t\tADD COLUMN `es_templ_slug` VARCHAR(255) NULL\n\t\t\t\t\t\t\t\tAFTER `es_email_type` \" );\n\t\t\t}\n\t\t}\n\n\t\tupdate_option( 'current_sa_email_subscribers_db_version', '3.3.6' );\n\n\t}",
"public function sync()\n {\n $sql = null;\n $module = new \\ZPM\\Core\\Setup\\Schema();\n $modData = new \\ZPM\\Core\\Setup\\Info();\n\n $module->install();\n }",
"public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }",
"public function safeUp()\n\t{\n $this->execute(\"\n /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n /*!40101 SET NAMES utf8mb4 */;\n /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n\n DROP TABLE IF EXISTS `Rating`;\n DROP TABLE IF EXISTS `RatingParams`;\n DROP TABLE IF EXISTS `RatingParamsValues`;\n\n /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;\n /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;\n /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n \");\n\t}",
"public function up()\n\t{\n\t\tSchema::table('reports', function($table)\n\t\t{\n\n\n\t\t});\n\t}",
"public function install()\r\n {\r\n if (!get_option('ohs_newsletter_installed')) {\r\n global $wpdb;\r\n $charset_collate = $wpdb->get_charset_collate();\r\n $fullTableName = $wpdb->prefix . self::$tableName;\r\n\r\n $sql = \"CREATE TABLE $fullTableName (\r\n id mediumint(9) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n first_name varchar(100) NOT NULL,\r\n last_name varchar(100) NOT NULL,\r\n email varchar(100) NOT NULL,\r\n validation_code varchar(200) NOT NULL,\r\n PRIMARY KEY id (id)\r\n ) $charset_collate;\";\r\n\r\n dbDelta($sql);\r\n add_option('ohs_newsletter_installed', 1);\r\n\r\n add_option('ohs_newsletter_sendgrid_api', \"\");\r\n add_option('ohs_newsletter_sendgrid_list', \"\");\r\n add_option('ohs_newsletter_redirect', \"\");\r\n }\r\n }",
"function wc_multi_warehouse_install() {\n global $wpdb;\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n $charset_collate = $wpdb->get_charset_collate();\n $sql = \"\n CREATE TABLE `{$wpdb->prefix}wc_warehouse` (\n `id` int(4) UNSIGNED NOT NULL AUTO_INCREMENT,\n `code` varchar(50) NOT NULL,\n `name` varchar(255) NOT NULL DEFAULT '',\n `email` varchar(255) NOT NULL DEFAULT '',\n `public` char(1) NOT NULL DEFAULT '1',\n `sort` int(4) NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n UNIQUE KEY code_unique (code)\n ) $charset_collate;\n \";\n dbDelta($sql);\n\n}",
"public function prepDatabases () {\n\t\tforeach( $this->wikiDBs as $wikiID => $db ) {\n\n\t\t\t$this->output( \"\\n#\\n# Adding initial offset to user IDs in $wikiID\\n#\" );\n\n\t\t\t$prepTables = $this->tablesToModify\n\t\t\t\t+ array( \"user\" => $this->userTable )\n\t\t\t\t+ array( \"user_properties\" => $this->userPropsTable );\n\n\t\t\tforeach ( $prepTables as $tableName => $tableInfo ) {\n\t\t\t\t$idField = $tableInfo['idField'];\n\t\t\t\t$db->query( \"UPDATE $tableName SET $idField = $idField + $this->initialOffset WHERE $idField != 0 AND $idField IS NOT NULL\" );\n\t\t\t}\n\n\t\t\t$db->query( \"UPDATE ipblocks SET ipb_user = ipb_user + $this->initialOffset WHERE ipb_user != 0 AND ipb_user IS NOT NULL\");\n\t\t\t$db->query( \"UPDATE ipblocks SET ipb_by = ipb_by + $this->initialOffset WHERE ipb_by != 0 AND ipb_by IS NOT NULL\");\n\n\t\t\t// DROP external_user table. See https://www.mediawiki.org/wiki/Manual:External_user_table\n\t\t\t$db->query( \"DROP TABLE IF EXISTS external_user\" );\n\n\t\t}\n\t}",
"function fatherly_fcr_install()\n{\n global $wpdb;\n\n $table_name = $wpdb->prefix . 'feed_content_recirculation_posts';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n $sql = \"CREATE TABLE `$table_name` (\n `id` BIGINT(20) NOT NULL AUTO_INCREMENT,\n `post_url` varchar(255) NOT NULL,\n `post_id` BIGINT(20) UNSIGNED NOT NULL,\n `processed` INT(1) DEFAULT 0 NOT NULL,\n PRIMARY KEY(`id`)\n );\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n dbDelta($sql);\n fatherly_fcr_populate_data();\n }\n}",
"static private function create_tables(){\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n self::create_views_table();\n }",
"public function safeUp()\n {\n $this->execute(\"\n create table region(\n code_reg integer primary key,\n name_reg text\n );\n \");\n $this->execute(\"\n create table school(\n id integer primary key,\n name text,\n boss text,\n code_reg integer,\n phone text\n );\n \");\n $this->createIndex('school_fk_reg', 'school', 'code_reg');\n }",
"public function up()\n {\n $this->loadSql(dirname(__FILE__).'/002_links_manager.sql');\n }",
"public function up()\n\t{\n\t\tSchema::drop('jobs');\n\t\tSchema::drop('job_location');\n\t\tSchema::drop('job_skill');\n\t\tSchema::drop('locations');\n\t\tSchema::drop('location_program');\n\t\tSchema::drop('location_scholarship');\n\t\tSchema::drop('positions');\n\t\tSchema::drop('programs');\n\t\tSchema::drop('program_subject');\n\t\tSchema::drop('scholarships');\n\t\tSchema::drop('scholarship_subject');\n\t\tSchema::drop('skills');\n\t\tSchema::drop('subjects');\n \t}",
"public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }"
] | [
"0.7127602",
"0.67704934",
"0.67459655",
"0.6691139",
"0.66507757",
"0.66355306",
"0.6624413",
"0.6605965",
"0.6597763",
"0.6481162",
"0.64573586",
"0.6447139",
"0.6413748",
"0.6400397",
"0.6264884",
"0.6250992",
"0.62434053",
"0.62201613",
"0.6197998",
"0.61958283",
"0.61751044",
"0.6174881",
"0.6156829",
"0.6109454",
"0.6092857",
"0.60922706",
"0.6080902",
"0.6067969",
"0.6067747",
"0.6066123",
"0.60650074",
"0.6064622",
"0.6062822",
"0.60554874",
"0.60538447",
"0.6051747",
"0.60429424",
"0.60356814",
"0.6026389",
"0.6026389",
"0.60175437",
"0.6015787",
"0.6014957",
"0.60083264",
"0.59981716",
"0.5990498",
"0.598786",
"0.598524",
"0.5980538",
"0.59599",
"0.5954644",
"0.5954279",
"0.59542143",
"0.59464365",
"0.5939113",
"0.59371614",
"0.59258956",
"0.5913918",
"0.59003276",
"0.59000564",
"0.5897915",
"0.5895224",
"0.58879715",
"0.5886006",
"0.58814615",
"0.5878662",
"0.5877077",
"0.58770514",
"0.58671767",
"0.58645153",
"0.5861187",
"0.5858415",
"0.58526003",
"0.5849931",
"0.5842765",
"0.5828188",
"0.5820564",
"0.5819004",
"0.5816031",
"0.58129054",
"0.5809868",
"0.58058834",
"0.58056664",
"0.58011466",
"0.57938284",
"0.5793727",
"0.57924825",
"0.5791678",
"0.5788021",
"0.5787342",
"0.5780934",
"0.57764316",
"0.5770604",
"0.57702386",
"0.57688725",
"0.5765263",
"0.57618064",
"0.57614964",
"0.5761233",
"0.57605684",
"0.5755972"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
//
} | {
"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()
{
//
} | {
"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 é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)
{
$id_news_reply = 0;
if (empty($request->content)) {
$id_news_reply = DB::table('news_replies')-> insertGetId(array(
'id_news' => $request->id_news,
'id_user' => $request->id_user,
'title' => $request->title,
'content' => "",
));
}else{
$id_news_reply = DB::table('news_replies')-> insertGetId(array(
'id_news' => $request->id_news,
'id_user' => $request->id_user,
'title' => $request->title,
'content' => $request->content,
));
}
$file_pendukung = $request->file('file_pendukung');
if (!empty($file_pendukung)) {
foreach ($file_pendukung as $key => $file) {
$destinationPath = 'Uploads';
$movea = $file->move($destinationPath,$file->getClientOriginalName());
$url_file = "Uploads/{$file->getClientOriginalName()}";
$new_file_pendukung = new FileNewsReplie;
$new_file_pendukung->id_news_reply = $id_news_reply;
$new_file_pendukung->name = $file->getClientOriginalName();
$new_file_pendukung->url = $url_file;
$new_file_pendukung->save();
}
}
return redirect()->action(
'BeritaController@show', ['id' => $request->id_news]
);
} | {
"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.72855324",
"0.71447515",
"0.7132799",
"0.6641042",
"0.66208744",
"0.6566955",
"0.65249777",
"0.6509032",
"0.6447701",
"0.63756555",
"0.6373163",
"0.63650846",
"0.63650846",
"0.63650846",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676"
] | 0.0 | -1 |
Display the specified resource. | public function show(NewsReplie $newsReplie)
{
//
} | {
"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(NewsReplie $newsReplie)
{
//
} | {
"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, NewsReplie $newsReplie)
{
//
} | {
"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(NewsReplie $newsReplie)
{
//
} | {
"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 deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\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 function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\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 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 $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 File::find($id)->remove();\n \n return redirect()->route('files.index');\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 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 delete($path, $data = null);",
"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 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\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 destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function remove($filePath){\n return Storage::delete($filePath);\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 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(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\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 }",
"public function remove($id);",
"public function remove($id);",
"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 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 }",
"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 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 {\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 }",
"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 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.6671365",
"0.6660839",
"0.66361386",
"0.6632988",
"0.6624729",
"0.6542195",
"0.6541645",
"0.6466739",
"0.6288393",
"0.61767083",
"0.6129533",
"0.608954",
"0.6054169",
"0.60443425",
"0.60073143",
"0.59338665",
"0.59317696",
"0.592145",
"0.5920155",
"0.59065086",
"0.5897853",
"0.58968836",
"0.58958197",
"0.58958197",
"0.58958197",
"0.58958197",
"0.58800334",
"0.5869308",
"0.5861188",
"0.5811069",
"0.5774596",
"0.5763277",
"0.5755447",
"0.5747713",
"0.5742094",
"0.573578",
"0.5727048",
"0.57164854",
"0.5712422",
"0.57092893",
"0.57080173",
"0.5707143",
"0.5704078",
"0.5696418",
"0.5684556",
"0.5684556",
"0.56790006",
"0.5678463",
"0.5658492",
"0.564975",
"0.5648406",
"0.56480885",
"0.5641393",
"0.5638992",
"0.56302536",
"0.56228197",
"0.5616424",
"0.5607389",
"0.56033397",
"0.5602035",
"0.55991143",
"0.55988586",
"0.5590501",
"0.5581284",
"0.55681103",
"0.5566215",
"0.55644745",
"0.5563726",
"0.55593926",
"0.55583876",
"0.5548547",
"0.5542015",
"0.5541403",
"0.5541403",
"0.55397224",
"0.55390894",
"0.55376494",
"0.5531044",
"0.5529739",
"0.55279493",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527892",
"0.5527671",
"0.5527155",
"0.5526666",
"0.55245256",
"0.552101",
"0.55183184"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
//
$elementosListas = [
[
'nombre' => "Cedula Ciudadania",
'elemento_lista_id' => "CC",
'tipo_lista_id' => "TI"
],
[
'nombre' => "Tarjeta Identidad",
'elemento_lista_id' => "TID",
'tipo_lista_id' => "TI"
],
[
'nombre' => "NIT",
'elemento_lista_id' => "NIT",
'tipo_lista_id' => "TI"
],
[
'nombre' => "Empleado",
'elemento_lista_id' => "EM",
'tipo_lista_id' => "TT"
],
[
'nombre' => "Contratista",
'elemento_lista_id' => "CO",
'tipo_lista_id' => "TT"
],
[
'nombre' => "Paciente",
'elemento_lista_id' => "PA",
'tipo_lista_id' => "TT"
],
[
'nombre' => "Huila",
'elemento_lista_id' => "HUI",
'tipo_lista_id' => "DEP"
],
[
'nombre' => "Tolima",
'elemento_lista_id' => "TOL",
'tipo_lista_id' => "DEP"
],
[
'nombre' => "Ibague",
'elemento_lista_id' => "IBA",
'tipo_lista_id' => "CI"
],
[
'nombre' => "Neiva",
'elemento_lista_id' => "NEV",
'tipo_lista_id' => "CI"
],
[
'nombre' => "Gran contribuyent",
'elemento_lista_id' => "GC",
'tipo_lista_id' => "TC"
],
[
'nombre' => "Responsable de iva",
'elemento_lista_id' => "RI",
'tipo_lista_id' => "TC"
],
[
'nombre' => "Régimen especial",
'elemento_lista_id' => "RE",
'tipo_lista_id' => "TC"
]
];
ElementosListas::insert($elementosListas);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }",
"public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }",
"public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }",
"public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }",
"public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }",
"public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }",
"public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}",
"public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }",
"public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }",
"public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }",
"public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }",
"public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }",
"public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }",
"public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}",
"public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }",
"public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }",
"public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }",
"public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }",
"public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }",
"public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }",
"public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }",
"public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}",
"public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }",
"public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }",
"public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }"
] | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.7841468",
"0.7834583",
"0.7827792",
"0.7819104",
"0.78088796",
"0.7802872",
"0.7802348",
"0.78006834",
"0.77989215",
"0.7795819",
"0.77903426",
"0.77884805",
"0.77862066",
"0.7778816",
"0.7777486",
"0.7765202",
"0.7762492",
"0.77623445",
"0.77621746",
"0.7761383",
"0.77606887",
"0.77596676",
"0.7757001",
"0.7753607",
"0.7749522",
"0.7749292",
"0.77466977",
"0.7729947",
"0.77289546",
"0.772796",
"0.77167094",
"0.7714503",
"0.77140456",
"0.77132195",
"0.771243",
"0.77122366",
"0.7711113",
"0.77109736",
"0.7710777",
"0.7710086",
"0.7705484",
"0.770464",
"0.7704354",
"0.7704061",
"0.77027386",
"0.77020216",
"0.77008796",
"0.7698617",
"0.76985973",
"0.76973504",
"0.7696405",
"0.7694293",
"0.7692694",
"0.7691264",
"0.7690576",
"0.76882726",
"0.7687433",
"0.7686844",
"0.7686498",
"0.7685065",
"0.7683827",
"0.7679184",
"0.7678287",
"0.76776296",
"0.76767945",
"0.76726556",
"0.76708084",
"0.76690495",
"0.766872",
"0.76686716",
"0.7666299",
"0.76625943",
"0.7662227",
"0.76613766",
"0.7659881",
"0.7656644",
"0.76539344",
"0.76535016",
"0.7652375",
"0.7652313",
"0.7652022"
] | 0.0 | -1 |
escape function for raw output | function escape ($val, $charset = 'UTF-8') {
return htmlspecialchars ($val, ENT_QUOTES, $charset);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function quote_escaped()\n {\n }",
"public static function escape($value) {}",
"public static function escape($som) {}",
"public function escape($value);",
"public function escape($value);",
"abstract protected function _escape($s);",
"public function escape($text);",
"public static function escape($s) {}",
"public abstract function escape($string);",
"public function escape($output)\n\t{\n\t\treturn $output;\n\t}",
"public function escape($string);",
"public function escape($string);",
"public function addEscape($func);",
"public function renderEscaped(): string\n {\n $this->escapeHtml(true);\n\n return $this->render();\n }",
"protected abstract function escape($string);",
"function escape($data) {\n\t\tif ( !isset($data) ) return '';\n if ( is_numeric($data) ) return $data;\n\n $non_displayables = array(\n '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15\n '/%1[0-9a-f]/', // url encoded 16-31\n '/[\\x00-\\x08]/', // 00-08\n '/\\x0b/', // 11\n '/\\x0c/', // 12\n '/[\\x0e-\\x1f]/' // 14-31\n );\n \n foreach ( $non_displayables as $regex )\n $data = preg_replace( $regex, '', $data );\n $search = array(\"\\\\\", \"\\x00\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\");\n $replace = array(\"\\\\\\\\\",\"\\\\0\",\"\\\\n\", \"\\\\r\", \"\\'\", '\\\"', \"\\\\Z\");\n\n return str_replace($search, $replace, $data);\n\t}",
"public function escaped() {\n\t\tif ( null !== $this->escaped ) {\n\t\t\treturn $this->escaped;\n\t\t}\n\n\t\t$this->escaped = empty( $this->escape_callback )\n\t\t\t? $this->__toString()\n\t\t\t: call_user_func( $this->escape_callback, $this->__toString() );\n\n\t\treturn $this->escaped;\n\t}",
"public function escape($data)\n {\n }",
"public function escape()\n {\n return strval($this);\n }",
"function esc($value)\n{\n return htmlentities($value);\n}",
"public function _escape($data)\n {\n }",
"function like_escape($text)\n {\n }",
"abstract public function escapeString($value);",
"public function escape()\n\t{\n\t\treturn ! $this->escaped ? esc_html($this->content) : $this->content;\n\t}",
"public abstract function escapeString($value);",
"function escape($value) {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n}",
"function html_escape($v) {\n\treturn escape($v, TRUE);\n}",
"function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}",
"abstract public function getEscaped($text, $extra = false);",
"public function _real_escape($data)\n {\n }",
"function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }",
"public function escape(string $str): string;",
"public function escape(&$data)\n {\n }",
"function html_escape($value)\n{\n return apply_filters('html_escape', $value);\n}",
"protected function escapeCharacter () : string {\n return '\\\\';\n }",
"function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}",
"function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }",
"abstract public function escapeString($string);",
"protected function escape( $value )\n\t{\n\t\treturn e( $value );\n\t}",
"public function e()\n\t{\n\t\treturn $this->escape();\n\t}",
"private function _escape($data)\n {\n return htmlspecialchars($data, ENT_QUOTES);\n }",
"function escape($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n}",
"function sysEncode( $str ){\n\treturn( addslashes( htmlspecialchars( $str ) ) );\n}",
"public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true);",
"abstract public function escape_string( $str );",
"public static function echoEscaped($input) {\r\n\t\t//htmlentities escapes all characters which have HTML character entity \r\n\t\techo htmlentities($input, ENT_QUOTES | ENT_HTML5 | ENT_IGNORE, 'ISO-8859-1', false);\r\n\t}",
"function db_output($string) {\n return htmlspecialchars($string);\n }",
"public function escape($data) {\r\n\t\treturn $this->connection->real_escape_string ( $data );\r\n\t}",
"public function _weak_escape($data)\n {\n }",
"public function escapeString($string);",
"public function getEscape() {\n return $this->escape;\n }",
"public function getEscape()\n {\n return $this->_escape;\n }",
"function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}",
"public function placeholder_escape()\n {\n }",
"function renderVerbatim( $input ) {\n return str_replace(\"\\n\",'',wfMsg(trim($input)));\n}",
"function escape($content = null) {\n return Sanitize::stripAll($content);\n }",
"function escape( $val ) {\r\n\r\n\t\tif( !$this->connected )\r\n\t\t\t$this->connect();\r\n\r\n return $this->socket->real_escape_string($val);\r\n\r\n\t}",
"function html_escape($var, bool $double_encode = true)\n {\n if ($double_encode === false) {\n throw new NotSupportedException(\n '$double_encode = false is not supported.'\n );\n }\n\n return esc($var, 'html');\n }",
"function escape($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}",
"function e($str) {\n echo htmlspecialchars($str, ENT_QUOTES);\n}",
"public function test_escaping() \n\t{\n\t\tCCRouter::on( 'this/u$l/conta([num])n+special/[any]', function(){\n\t\t\techo \"Escaping works\";\n\t\t});\n\t\t\n\t\t$response = CCRequest::uri( 'this/u$l/conta(1)n+special/chars' )->perform()->response()->body;\n\t\t$this->assertEquals( $response , \"Escaping works\" );\n\t}",
"function Dwoo_Plugin_escape(Dwoo_Core $dwoo, $value='', $format='html', $charset=null)\n{\n\tif ($charset === null) {\n\t\t$charset = $dwoo->getCharset();\n\t}\n\n\tswitch($format)\n\t{\n\n\tcase 'html':\n\t\treturn htmlspecialchars((string) $value, ENT_QUOTES, $charset);\n\tcase 'htmlall':\n\t\treturn htmlentities((string) $value, ENT_QUOTES, $charset);\n\tcase 'url':\n\t\treturn rawurlencode((string) $value);\n\tcase 'urlpathinfo':\n\t\treturn str_replace('%2F', '/', rawurlencode((string) $value));\n\tcase 'quotes':\n\t\treturn preg_replace(\"#(?<!\\\\\\\\)'#\", \"\\\\'\", (string) $value);\n\tcase 'hex':\n\t\t$out = '';\n\t\t$cnt = strlen((string) $value);\n\t\tfor ($i=0; $i < $cnt; $i++) {\n\t\t\t$out .= '%' . bin2hex((string) $value[$i]);\n\t\t}\n\t\treturn $out;\n\tcase 'hexentity':\n\t\t$out = '';\n\t\t$cnt = strlen((string) $value);\n\t\tfor ($i=0; $i < $cnt; $i++)\n\t\t\t$out .= '&#x' . bin2hex((string) $value[$i]) . ';';\n\t\treturn $out;\n\tcase 'javascript':\n\t\treturn strtr((string) $value, array('\\\\'=>'\\\\\\\\',\"'\"=>\"\\\\'\",'\"'=>'\\\\\"',\"\\r\"=>'\\\\r',\"\\n\"=>'\\\\n','</'=>'<\\/'));\n\tcase 'mail':\n\t\treturn str_replace(array('@', '.'), array(' (AT) ', ' (DOT) '), (string) $value);\n\tdefault:\n\t\treturn $dwoo->triggerError('Escape\\'s format argument must be one of : html, htmlall, url, urlpathinfo, hex, hexentity, javascript or mail, \"'.$format.'\" given.', E_USER_WARNING);\n\n\t}\n}",
"public function getEscape() {\n\t\treturn $this->_escape;\n\t}",
"function escape($text) {\n\t$text = htmlspecialchars($text, ENT_QUOTES);\n\t$text = addslashes($text);\n\treturn $text;\n}",
"static public function esc($txt) {\n return htmlspecialchars($txt);\n }",
"function attribute_escape($text)\n {\n }",
"public function escape($data) {\n return $this->wjdb->real_escape_string($data);\n }",
"public function escapeString($stringToEscape);",
"function escape($string) {\r\n\treturn htmlentities($string, ENT_QUOTES, 'UTF-8');\r\n}",
"public function escape($string)\n {\n return $string;\n }",
"function escape($string) {\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}",
"function esc_sql($data)\n {\n }",
"function modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true)\n{\n static $_double_encode = null;\n static $is_loaded_1 = false;\n static $is_loaded_2 = false;\n if ($_double_encode === null) {\n $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>=');\n }\n if (!$char_set) {\n $char_set = $_CHARSET;\n }\n switch ($esc_type) {\n case 'html':\n if ($_double_encode) {\n // php >=5.3.2 - go native\n return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n } else {\n if ($double_encode) {\n // php <5.2.3 - only handle double encoding\n return htmlspecialchars($string, ENT_QUOTES, $char_set);\n } else {\n // php <5.2.3 - prevent double encoding\n $string = preg_replace('!&(#?\\w+);!', '%%%START%%%\\\\1%%%END%%%', $string);\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n $string = str_replace(\n array(\n '%%%START%%%',\n '%%%END%%%'\n ),\n array(\n '&',\n ';'\n ),\n $string\n );\n return $string;\n }\n }\n // no break\n case 'htmlall':\n if ($_MBSTRING) {\n // mb_convert_encoding ignores htmlspecialchars()\n if ($_double_encode) {\n // php >=5.3.2 - go native\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode);\n } else {\n if ($double_encode) {\n // php <5.2.3 - only handle double encoding\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n } else {\n // php <5.2.3 - prevent double encoding\n $string = preg_replace('!&(#?\\w+);!', '%%%START%%%\\\\1%%%END%%%', $string);\n $string = htmlspecialchars($string, ENT_QUOTES, $char_set);\n $string =\n str_replace(\n array(\n '%%%START%%%',\n '%%%END%%%'\n ),\n array(\n '&',\n ';'\n ),\n $string\n );\n return $string;\n }\n }\n // htmlentities() won't convert everything, so use mb_convert_encoding\n return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set);\n }\n // no MBString fallback\n if ($_double_encode) {\n return htmlentities($string, ENT_QUOTES, $char_set, $double_encode);\n } else {\n if ($double_encode) {\n return htmlentities($string, ENT_QUOTES, $char_set);\n } else {\n $string = preg_replace('!&(#?\\w+);!', '%%%START%%%\\\\1%%%END%%%', $string);\n $string = htmlentities($string, ENT_QUOTES, $char_set);\n $string = str_replace(\n array(\n '%%%START%%%',\n '%%%END%%%'\n ),\n array(\n '&',\n ';'\n ),\n $string\n );\n return $string;\n }\n }\n // no break\n case 'url':\n return rawurlencode($string);\n case 'urlpathinfo':\n return str_replace('%2F', '/', rawurlencode($string));\n case 'quotes':\n // escape unescaped single quotes\n return preg_replace(\"%(?<!\\\\\\\\)'%\", \"\\\\'\", $string);\n case 'hex':\n // escape every byte into hex\n // Note that the UTF-8 encoded character ä will be represented as %c3%a4\n $return = '';\n $_length = strlen($string);\n for ($x = 0; $x < $_length; $x++) {\n $return .= '%' . bin2hex($string[ $x ]);\n }\n return $return;\n case 'hexentity':\n $return = '';\n if ($_MBSTRING) {\n if (!$is_loaded_1) {\n if (!is_callable('mb_to_unicode')) {\n }\n $is_loaded_1 = true;\n }\n $return = '';\n foreach (mb_to_unicode($string, $_CHARSET) as $unicode) {\n $return .= '&#x' . strtoupper(dechex($unicode)) . ';';\n }\n return $return;\n }\n // no MBString fallback\n $_length = strlen($string);\n for ($x = 0; $x < $_length; $x++) {\n $return .= '&#x' . bin2hex($string[ $x ]) . ';';\n }\n return $return;\n case 'decentity':\n $return = '';\n if ($_MBSTRING) {\n if (!$is_loaded_1) {\n if (!is_callable('mb_to_unicode')) {\n }\n $is_loaded_1 = true;\n }\n $return = '';\n foreach (mb_to_unicode($string, $_CHARSET) as $unicode) {\n $return .= '&#' . $unicode . ';';\n }\n return $return;\n }\n // no MBString fallback\n $_length = strlen($string);\n for ($x = 0; $x < $_length; $x++) {\n $return .= '&#' . ord($string[ $x ]) . ';';\n }\n return $return;\n case 'javascript':\n // escape quotes and backslashes, newlines, etc.\n return strtr(\n $string,\n array(\n '\\\\' => '\\\\\\\\',\n \"'\" => \"\\\\'\",\n '\"' => '\\\\\"',\n \"\\r\" => '\\\\r',\n \"\\n\" => '\\\\n',\n '</' => '<\\/'\n )\n );\n case 'mail':\n if ($_MBSTRING) {\n if (!$is_loaded_2) {\n if (!is_callable('mb_str_replace')) {\n }\n $is_loaded_2 = true;\n }\n return mb_str_replace(\n array(\n '@',\n '.'\n ),\n array(\n ' [AT] ',\n ' [DOT] '\n ),\n $string\n );\n }\n // no MBString fallback\n return str_replace(\n array(\n '@',\n '.'\n ),\n array(\n ' [AT] ',\n ' [DOT] '\n ),\n $string\n );\n case 'nonstd':\n // escape non-standard chars, such as ms document quotes\n $return = '';\n if ($_MBSTRING) {\n if (!$is_loaded_1) {\n if (!is_callable('mb_to_unicode')) {\n }\n $is_loaded_1 = true;\n }\n foreach (mb_to_unicode($string, $_CHARSET) as $unicode) {\n if ($unicode >= 126) {\n $return .= '&#' . $unicode . ';';\n } else {\n $return .= chr($unicode);\n }\n }\n return $return;\n }\n $_length = strlen($string);\n for ($_i = 0; $_i < $_length; $_i++) {\n $_ord = ord(substr($string, $_i, 1));\n // non-standard char, escape it\n if ($_ord >= 126) {\n $return .= '&#' . $_ord . ';';\n } else {\n $return .= substr($string, $_i, 1);\n }\n }\n return $return;\n default:\n return $string;\n }\n}",
"function escape_string($string)\n{\n\tglobal $connection;\n\t$string=htmlentities($string);\n\treturn $string;\n}",
"public function escape($text, $extra = false)\n\t{\n\t\treturn '';\n\t}",
"function db_output($string) {\n\treturn htmlspecialchars($string);\n}",
"function escape($value) {\n\t\treturn $this->mysql_client->escape_string($value);\n\t}",
"public static function escape($string) {\n\treturn self::$instance->escape($string);\n }",
"private function makeEscapedString() {\n\t\t# -- so, call this function after makeConnection() called -- #\n\t\t\n\t\ttry {\n\t\t\t$this->_code = $this->_mysqli->real_escape_string($this->_code);\n\t\t\t$this->_name = $this->_mysqli->real_escape_string($this->_name);\n\t\t\t$this->_description = $this->_mysqli->real_escape_string($this->_description);\n\t\t\t$this->_color = $this->_mysqli->real_escape_string($this->_color);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t# do nothing\n\t\t}\n\t\t\n\t}",
"static public function real_escape_string($s) { return self::escape($s); }",
"protected function escape() {\n\t\t$this->text = htmlspecialchars($this->text);\n\t\tReturn $this;\n\t}",
"function esc($str) {\n return htmlEnt($str);\n}",
"protected static function _escapeChar($matches) {}",
"function escapeString( $value )\r\n\t{\r\n die(\"method \" . __METHOD__ . \" is not implemented\" . Diagnostics::trace());\r\n\t}",
"function escape_data($data) {\n\n\tif (ini_get('magic_quotes_gpc')) {\t# Controllo se è attivata la modaltà Magic Quotes (che immette dei caratteri \"|\" prima di eventuali apici\n\t\t$data=stripslashes($data);\t# Tolgo i caratteri \"|\" inseriti da Magic Quotes con la funzione stripslashes\n\t\t}\n\treturn $data; # Ritorno la stringa formattata correttamente\n\t}",
"function escape($string) {\n\n return htmlentities($string, ENT_QUOTES, 'ISO-8859-15');\n}",
"function h($text) {\r\n echo(htmlspecialchars($text, ENT_QUOTES));\r\n }",
"function writeraw( $raw) {\r\n\t\t$raw=preg_replace(\"/\\r/\", \"\", $raw);\r\n\t\t$raw=preg_replace(\"/\\n/\", \" \", $raw);\r\n\t return $raw;\r\n }",
"function ___($text) {\n return htmlspecialchars($text);\n}",
"function esc_like($text)\n{\n return addcslashes($text, '_%\\\\');\n}",
"function esc_html($text) {\n return htmlspecialchars($text);\n }",
"public static function returnEscaped($input) {\r\n\t\t//htmlentities escapes all characters which have HTML character entity \r\n\t\t$escapedString = htmlentities($input, ENT_QUOTES | ENT_HTML5 | ENT_IGNORE, 'ISO-8859-1', false);\r\n\t\treturn $escapedString;\r\n\t}",
"function escape($data){\r\n\t\t\tglobal $link;\r\n\t\t\treturn mysqli_real_escape_string($link, $data);\r\n\t\t}",
"function tag_escape($tag_name)\n {\n }",
"public function escape(mixed $value): string\n {\n return htmlspecialchars($value, ENT_QUOTES);\n }",
"function escapeString($string) {\r\n\treturn \\wcf\\system\\WCF::getDB()->escapeString($string);\r\n}",
"function escapePhp() {\n\t\t$rv = $this->getContents();\n\t\t$changes = array(\n\t\t\t'<?' => '<?',\n\t\t\t'?>' => '?>',\n\t\t);\n\t\treturn str_replace( array_keys( $changes ), $changes, $rv );\n\t}",
"public static function escapeForDisplay($input) {\r\n if (get_magic_quotes_gpc()) {\r\n $input = stripslashes($input);\r\n }\r\n $result = htmlspecialchars($input, ENT_QUOTES);\r\n return $result;\r\n }",
"public function escapeString(string $value): string;",
"private function escapes() {\n return [\n ['r', \"\\x0d\"],\n ['n', \"\\x0a\"],\n ['t', \"\\x09\"],\n ['b', \"\\x08\"],\n ['f', \"\\x0c\"],\n ['\\\\', \"\\x5c\"]\n ];\n }"
] | [
"0.7332233",
"0.7320718",
"0.722189",
"0.72135085",
"0.72135085",
"0.71891326",
"0.7147687",
"0.7128982",
"0.71140856",
"0.7081674",
"0.6987865",
"0.6987865",
"0.6857306",
"0.68418974",
"0.68311906",
"0.67990595",
"0.6778695",
"0.6777687",
"0.67619854",
"0.6748499",
"0.6743915",
"0.6721284",
"0.6719164",
"0.67117494",
"0.6707828",
"0.6661284",
"0.6646127",
"0.6591697",
"0.65780264",
"0.6557441",
"0.6525596",
"0.6524891",
"0.6507915",
"0.65047336",
"0.64977056",
"0.64901006",
"0.6478146",
"0.6474185",
"0.64716446",
"0.64344704",
"0.6428517",
"0.64133424",
"0.64044493",
"0.63893867",
"0.6383475",
"0.6376325",
"0.6359733",
"0.6352321",
"0.63427633",
"0.63247293",
"0.6318977",
"0.6312749",
"0.628668",
"0.628023",
"0.6245289",
"0.6234301",
"0.6230308",
"0.6216584",
"0.62165046",
"0.62098336",
"0.6207677",
"0.6203361",
"0.61978894",
"0.6192933",
"0.6189987",
"0.61823285",
"0.6181062",
"0.6167526",
"0.61670375",
"0.6166378",
"0.6163799",
"0.6148941",
"0.6139314",
"0.6134808",
"0.61305696",
"0.61304647",
"0.61295164",
"0.6118868",
"0.61166424",
"0.61055505",
"0.61028504",
"0.60924524",
"0.6091588",
"0.6087988",
"0.6083516",
"0.6077768",
"0.60670894",
"0.6057715",
"0.6048432",
"0.6041132",
"0.60327464",
"0.6018882",
"0.6017277",
"0.60092723",
"0.6002747",
"0.5978931",
"0.5977117",
"0.59763145",
"0.5976291",
"0.5973765"
] | 0.61884874 | 65 |
function to render the template | function template ($file, $data) {
extract ($data);
require ($file);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function renderTemplate();",
"protected function render_template()\n {\n }",
"protected function render_template()\n {\n }",
"protected function render_template()\n {\n }",
"protected function render_template()\n {\n }",
"public function render()\n\t{\n\t $templateFile = $this->template;\n\t $templateContents = $this->getTemplateContents($templateFile);\n\n\t $layout = $this->getTemplateLayout($templateContents);\n $arguments = $this->getTemplateArguments($templateContents);\n\n\t return $this->renderLayout(\n \t\t$layout, \n \t\tfunction () use ($templateFile) {\n\t\t $template = new Template($templateFile);\n\t\t return $template->render();\n\t \t},\n \t\t$arguments\n \t);\n\t}",
"public static function renderTemplate()\n {\n echo self::$template;\n }",
"protected function render() {}",
"protected function render() {}",
"protected function render() {}",
"protected function content_template() {}",
"protected function content_template() {}",
"public function render()\n\t{\n\t\t$template = $this->template\n\t\t\t? '<div class=\"wkm-template\" for=\"' .$this->id. '\">' .$this->template. '</div>'\n\t\t\t: '';\n\n\t\treturn parent::render().$template;\n\t}",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}",
"function render() ;",
"protected function content_template()\n {\n }",
"protected function content_template()\n {\n }",
"protected function content_template()\n {\n }",
"protected function content_template()\n {\n }",
"protected function content_template()\n {\n }",
"protected function content_template()\n {\n }",
"public function render()\n {\n $page = $this->twig->load($this->template);\n $this->prepareFlashMessages();\n $html = $page->render($this->vars);\n Router::sendResponse($html);\n }",
"protected function content_template() {\n\t}",
"function render() {}",
"public function render() {\n\t\treturn $this->template( 'page' );\n\t}",
"protected function render()\n {\n $params = ['title' => $this->title, 'content' => $this->content];\n $html = $this->template('Views/v_main.php', $params);\n echo $html;\n }",
"public function forTemplate()\n {\n return $this->renderWith($this->defaultTemplate());\n }",
"public function template();",
"public function content_template()\n {\n }",
"public function content_template()\n {\n }",
"public function content_template()\n {\n }"
] | [
"0.9134647",
"0.88696486",
"0.8867497",
"0.8867497",
"0.8867497",
"0.79228926",
"0.789643",
"0.7788052",
"0.77876306",
"0.77876306",
"0.77584356",
"0.77584356",
"0.770545",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76896447",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.76557994",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7655195",
"0.7630873",
"0.7541755",
"0.75283486",
"0.75283486",
"0.75283486",
"0.75283486",
"0.75283486",
"0.75283486",
"0.7520899",
"0.75160414",
"0.7514671",
"0.7499381",
"0.7481576",
"0.74718726",
"0.7467222",
"0.74659306",
"0.74659306",
"0.74659306"
] | 0.0 | -1 |
Login page If the user didn't supply the right login info, show them to a login form. Also, display $message to them in the form of an error. | function printLoginPage($message = null) {
require_once("pageTop.php");
echo ' <title>voipSMS: Login</title>
</head>
<body class="text-center">';
include_once('header.php');
// Login form
echo '
<form class="container py-2 my-2 rounded" action="login.php" method="POST">
<h1 class="h3 font-weight-normal">Sign in</h1>
<div class="form-group">
<label for="emailInput">Email Address</label>
<input type="email" class="form-control" id="emailInput" aria-describedby="emailHelp" placeholder="Enter email" name="vms_email" required />
</div>
<div class="form-group">
<label for="passwordInput">Password</label>
<input type="password" class="form-control" id="passwordInput" aria-describedby="passwordHelp" placeholder="Password" name="userPassword" required />
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form> ';
// Errors, if any
if($message != "") {
echo "<div class='alert alert-danger'><strong>Error:</strong> {$message}</div>";
}
echo '</body>';
require_once("pageBottom.php");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function login_form($message=''){\n\n $templateData = array(\n 'page' => 'login',\n 'page_title' => 'Login'\n );\n\n $this->template->load('template', 'login_screen', $templateData);\n\n }",
"public function login()\n {\n if(isset($_SESSION['user']))\n Url::redirectTo('/profile/' . $_SESSION['user']);\n\n $data = array();\n if(isset($_SESSION['error']) && $_SESSION['error']['errored'])\n {\n $data['errored'] = $_SESSION['error']['errored'];\n $data['emessage'] = $_SESSION['emessage'];\n $_SESSION['error']['errored'] = false;\n }\n if(isset($_SESSION['message']))\n {\n $data['message'] = $_SESSION['message'];\n unset($_SESSION['message']);\n }\n View::render('profile/login', $data);\n }",
"public function login() {\n $login_err = \"<p class='flash_err'>\" . $this->_model->getFlash('login_err') . \"</p>\";\n $create_err = \"<p class='flash_err'>\" . $this->_model->getFlash('create_err') . \"</p>\";\n $create_success = \"<p class='flash_success'>\" . $this->_model->getFlash('create_success') . \"</p>\";\n $this->render('General.Login', compact('login_err', 'create_err', 'create_success'));\n }",
"function ShowLogIn($message = \"\"){\n\n $smarty = new Smarty();\n $smarty->assign('titulo_s', $this->title);\n $smarty->assign('message', $message);\n\n $smarty->display('templates/login.tpl'); // muestro el template \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 \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 loginForm()\n {\n // If already logged in, redirect appropriately\n if ($this->custLoggedIn())\n {\n $this->redirect(\"mainPageCust.php\");\n } elseif ($this->ownerLoggedIn())\n {\n $this->redirect(\"mainPageOwner.php\");\n }\n \n // prepare errors to display if there are any\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n \n // here the login form view class is loaded and method printHtml() is called \n require_once('views/FormError.class.php');\n require_once('views/LoginForm.class.php');\n $site = new SiteContainer($this->db);\n $form = new LoginForm();\n $error_page = new FormError();\n $site->printHeader();\n $site->printNav();\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n \n }",
"public function loginAction(){\n\t\t\n\t\tZend_Loader::loadClass(\"UserLogin\", array(FORMS_PATH));\n\t\t$error = $this->getRequest()->getQuery(\"error\");\n\t\t$session = new Zend_Session_Namespace(\"capitalp\");\t\n\t\tif ($session->manager_id){\n\t\t\theader(\"Location:/portfolio/\");\n\t\t}\n\t\t\n\t\t$form = new UserLogin();\n\t\t$this->view->form = $form;\n\t\t\n\t\tif ($error){\n\t\t\tif ($error==1){\n\t\t\t\t$this->view->error = \"Invalid Request. Please try again\";\n\t\t\t}else if ($error==2){\n\t\t\t\t$this->view->error = \"Invalid Username/Password. Please try again\";\n\t\t\t}\n\t\t}else{\n\t\t\t$this->view->error = \"\";\n\t\t}\n\t\t$this->view->headTitle(\"Login\");\n\t\t$this->view->headScript()->prependFile( \"http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js\", $type = 'text/javascript' );\t\t\n\t\t$this->view->headScript()->prependFile( \"/public/js/users/login.js\", $type = 'text/javascript' );\n\t\t$this->_helper->layout->setLayout(\"html5_plain\");\n\t}",
"public function loginAction()\n {\n // Instantiate the form that asks the user to log in.\n $form = new Application_Form_LoginForm();\n\n // Initialize the error message to be empty.\n $this->view->formResponse = '';\n\n // For security purposes, only proceed if this is a POST request.\n if ($this->getRequest()->isPost())\n {\n // Process the filled-out form that has been posted:\n // if the input values are valid, attempt to authenticate.\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n if ( $this->_authenticate($formData) )\n {\n $this->_helper->redirector('index', 'index');\n }\n }\n }\n\n // Render the view.\n $this->view->form = $form;\n }",
"public function login() {\n $messages = $this->messages;\n require_once $this->root_path_views.\"login.php\";\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 login_message( $message ) {\n\n\t\t$redirect_to = isset( $_GET['redirect_to'] ) ? urldecode( $_GET['redirect_to'] ) : '';\n\n\t\t// Display a message when trying to vote for a contribution\n\t\tif ( $redirect_to ) {\n\n\t\t\t$params = array();\n\t\t\tparse_str( parse_url( $redirect_to, PHP_URL_QUERY ), $params );\n\n\t\t\tif ( isset( $params['action'] ) && 'vote_for_contribution' == $params['action'] ) {\n\t\t\t\t$message = '<p class=\"message\">' . __( 'You must be logged in to vote' ) . '</p>';\n\t\t\t}\n\n\t\t}\n\n\t\treturn $message;\n\t}",
"function login() {\n $this->checkAccess('user',true,true);\n\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/login.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set('SESSION.haserror', '');\n }",
"function login($msg = false) {\n if ($this -> session -> userdata('user_logged_in'))\n redirect('home');\n\n $this -> data['msg'] = $msg;\n\n load_similar_content('login');\n $this -> data['content'] = $this -> load -> view('front/sections/section_login', $this -> data, TRUE);\n\n $this -> load -> view('front/default', $this -> data);\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}",
"public function actionLogin()\n\t{\n\t\t$form=new LoginForm;\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$form->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to previous page if valid\n\t\t\tif($form->validate())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login',array('form'=>$form));\n\t}",
"function smarty_function_login_error($params,&$smarty) {\n\tglobal $user;\n\tif (SMIAction::action() == 'Log In' && !$user->valid()) return 'Bad login or password!';\n}",
"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}",
"protected function display_login() {\r\n // Get language vars\r\n global $MESSAGE;\r\n global $MENU;\r\n global $TEXT;\r\n\r\n $Trans = $GLOBALS['oTrans'];\r\n $ThemeName = (defined('DEFAULT_THEME')?DEFAULT_THEME:'DefaultTheme');\r\n $Trans->enableAddon('templates\\\\'.$ThemeName);\r\n $aLang = $Trans->getLangArray();\r\n // If attemps more than allowed, warn the user\r\n if($this->get_session('ATTEMPS') > $this->max_attemps) {\r\n $this->warn();\r\n }\r\n // Show the login form\r\n if($this->frontend != true) {\r\n// require_once(WB_PATH.'/include/phplib/template.inc');\r\n $aWebsiteTitle['value'] = WEBSITE_TITLE;\r\n $sql = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` '\r\n . 'WHERE `name`=\\'website_title\\'';\r\n if ($get_title = $this->oDb->query($sql)){\r\n $aWebsiteTitle= $get_title->fetchRow( MYSQLI_ASSOC );\r\n }\r\n // Setup template object, parse vars to it, then parse it\r\n $template = new Template(dirname($this->correct_theme_source($this->template_file)));\r\n $template->set_file('page', $this->template_file);\r\n $template->set_block('page', 'mainBlock', 'main');\r\n $template->set_var('DISPLAY_REMEMBER_ME', ($this->remember_me_option ? '' : 'display: none;'));\r\n\r\n $template->set_var(\r\n array(\r\n 'ACTION_URL' => $this->login_url,\r\n 'ATTEMPS' => $this->get_session('ATTEMPS'),\r\n 'USERNAME' => $this->username,\r\n 'USERNAME_FIELDNAME' => $this->username_fieldname,\r\n 'PASSWORD_FIELDNAME' => $this->password_fieldname,\r\n 'MESSAGE' => $this->message,\r\n 'INTERFACE_DIR_URL' => ADMIN_URL.'/interface',\r\n 'MAX_USERNAME_LEN' => $this->max_username_len,\r\n 'MAX_PASSWORD_LEN' => $this->max_password_len,\r\n 'ADMIN_URL' => ADMIN_URL,\r\n 'WB_URL' => WB_URL,\r\n 'URL' => $this->redirect_url,\r\n 'THEME_URL' => THEME_URL,\r\n 'VERSION' => VERSION,\r\n 'REVISION' => REVISION,\r\n 'LANGUAGE' => strtolower(LANGUAGE),\r\n 'FORGOTTEN_DETAILS_APP' => $this->forgotten_details_app,\r\n 'WEBSITE_TITLE' => ($aWebsiteTitle['value']),\r\n 'TEXT_ADMINISTRATION' => $TEXT['ADMINISTRATION'],\r\n// 'TEXT_FORGOTTEN_DETAILS' => $Trans->TEXT_FORGOTTEN_DETAILS,\r\n 'TEXT_USERNAME' => $TEXT['USERNAME'],\r\n 'TEXT_PASSWORD' => $TEXT['PASSWORD'],\r\n 'TEXT_REMEMBER_ME' => $TEXT['REMEMBER_ME'],\r\n 'TEXT_LOGIN' => $TEXT['LOGIN'],\r\n 'TEXT_SAVE' => $TEXT['SAVE'],\r\n 'TEXT_RESET' => $TEXT['RESET'],\r\n 'TEXT_HOME' => $TEXT['HOME'],\r\n 'PAGES_DIRECTORY' => PAGES_DIRECTORY,\r\n 'SECTION_LOGIN' => $MENU['LOGIN'],\r\n 'LOGIN_DISPLAY_HIDDEN' => !$this->is_authenticated() ? 'hidden' : '',\r\n 'LOGIN_DISPLAY_NONE' => !$this->is_authenticated() ? 'none' : '',\r\n 'LOGIN_LINK' => $_SERVER['SCRIPT_NAME'],\r\n 'LOGIN_ICON' => 'login',\r\n 'START_ICON' => 'blank',\r\n 'URL_HELP' => 'http://wiki.websitebaker.org/',\r\n )\r\n );\r\n $template->set_var($aLang);\r\n $template->set_var('CHARSET', (defined('DEFAULT_CHARSET') ? DEFAULT_CHARSET : 'utf-8'));\r\n $template->parse('main', 'mainBlock', false);\r\n $template->pparse('output', 'page');\r\n }\r\n }",
"public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }",
"function print_login_bs($error) {\n\tif ($error) {\n\t\t$message = '<div class=\"alert alert-danger\">Incorrect username or password</div>';\n\t}\n\techo '\n\t\t\t<form class=\"form-signin \" method=\"post\" action=\"index.php\">\n\t\t <h2 class=\"form-signin-heading\">Login</h2>\n\t\t \n\t\t <label for=\"username\" class=\"sr-only\">Email address</label>\n\t\t \n\t\t <input name=\"username\" type=\"text\" id=\"username\" class=\"form-control\" placeholder=\"Username\" required autofocus>\n\t\t \n\t\t \n\t\t <label for=\"password\" class=\"sr-only\">Password</label>\n\t\t <input type=\"password\" id=\"password\" name=\"password\" class=\"form-control\" placeholder=\"Password\" required>\n\t\t '.$message.'\n\t\t <input class=\"btn btn-lg btn-primary btn-block\" type=\"submit\" name=\"action\" value=\"Login\">\n\t\t \n\t\t </form>\n\t\t \n\t';\n}",
"function login_obscure()\n {\n return '<strong>Whoops</strong>: Your username or password are incorrect, please try again.';\n }",
"public function login()\n {\n $this->form_validation->set_rules($this->validation_rules);\n \n // If the validation worked, or the user is already logged in\n if ($this->form_validation->run() || $this->isAdmin() == true)\n {\n\n //The Form is valid so the user is recorded into the CI session via _checkLogin()\n redirect('admin/pages');\n }else{\n\n // Invalid form so it is redisplayed containing your data\n $this->aData['sTitle'] = \"Administration du site web\";\n $this->aData['sBaseURL'] = $this->sBaseUrl;\n $aNav[] = anchor('agence_web', 'Retournez sur le site');\n\n $this->template->set_title(\"Administration du site web\")\n ->set_menu($aNav)\n ->build('admin/login_view', $this->aData);\n }\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 static function loginThenRedirect ($message){\n unset($_SESSION['return_to']);\n if (!session::isUser()){\n $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];\n session::setActionMessage($message);\n http::locationHeader('/account/login/index');\n die;\n }\n }",
"public function actionLogin() {\n $categories = array();\n $categories = Category::getCategoriesList();\n\n $email = '';\n $password = '';\n\n\n if (isset($_POST['submit'])) {\n $email = $_POST['email'];\n $password = $_POST['password'];\n\n $errors = false;\n\n if (!User::checkEmail($email)) {\n $errors[] = 'Invalid email.';\n }\n\n if (!User::checkPassword($password)) {\n $errors[] = 'Password should be at least 6 characters.';\n }\n\n $userId = User::checkUserData($email, $password);\n\n if ($userId == false) {\n $errors[] = 'User with such email and password does not exist. Please check your login details.';\n } else {\n User::auth($userId);\n\n header(\"Location: /profile/\");\n }\n }\n\n require_once (ROOT.'/views/user/login.php');\n\n return true;\n }",
"public function loginAction()\r\n\t{\r\n\t\r\n\t\t$post_back = $this->request->getParam( \"postback\" );\r\n\t\t$config_https = $this->registry->getConfig( \"SECURE_LOGIN\", false, false );\r\n\t\r\n\t\t// if secure login is required, then force the user back thru https\r\n\t\r\n\t\tif ( $config_https == true && $this->request->uri()->getScheme() == \"http\" )\r\n\t\t{\r\n\t\t\t$uri = $this->request->uri();\r\n\t\t\t$uri->setScheme('https');\r\n\t\r\n\t\t\treturn $this->redirect()->toUrl((string) $uri);\r\n\t\t}\r\n\t\r\n\t\t### remote authentication\r\n\t\r\n\t\t$result = $this->authentication->onLogin();\r\n\t\r\n\t\tif ( $result == Scheme::REDIRECT )\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t\r\n\t\t### local authentication\r\n\t\r\n\t\t// if this is not a 'postback', then the user has not submitted the form, they are arriving\r\n\t\t// for first time so stop the flow and just show the login page with form\r\n\t\r\n\t\tif ( $post_back == null ) return 1;\r\n\t\r\n\t\t$bolAuth = $this->authentication->onCallBack();\r\n\t\r\n\t\tif ( $bolAuth == Scheme::FAILED )\r\n\t\t{\r\n\t\t\t// failed the login, so present a message to the user\r\n\t\r\n\t\t\treturn array(\"error\" => \"authentication\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t}",
"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 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() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }",
"public function action_login()\n {\n if(\\Auth::check())\n {\n \\Response::redirect('admin/dashboard');\n }\n\n // Set validation\n $val = \\Validation::forge('login');\n $val->add_field('username', 'Name', 'required');\n $val->add_field('password', 'Password', 'required');\n\n // Run validation\n if($val->run())\n {\n if(\\Auth::instance()->login($val->validated('username'), $val->validated('password')))\n {\n \\Session::set_flash('success', \\Lang::get('nvadmin.public.login_success'));\n \\Response::redirect('admin/dashboard');\n }\n else\n {\n $this->data['page_values']['errors'] = \\Lang::get('nvadmin.public.login_error');\n }\n }\n else\n {\n $this->data['page_values']['errors'] = $val->show_errors();\n }\n\n // Set templates variables\n $this->data['template_values']['subtitle'] = 'Login';\n $this->data['template_values']['description'] = \\Lang::get('nvadmin.public.login');\n $this->data['template_values']['keywords'] = 'login, access denied';\n }",
"public function index($msg=\"\")\n {\n //die();\n if($msg==0 && $msg!=\"\"){$msg=\"invalid Username or Password \";}\n if($msg==2){$msg=\"Your are not logged in \";}\n if($msg==3){$msg=\"Your are securely logged out \";}\n $this->load->view('login.php',array(\"msg\"=>$msg));\n }",
"public function showloginpage()\n\t\t{\n\t\t\tif(Auth::check()) {\n\t\t\t\tSession::flash('errorMessage', 'You are already logged in!');\n\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t} else {\n\t\t\t\treturn View::make('login');\n\t\t\t}\n\t\t}",
"private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}",
"public function login($error = NULL) {\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_users_login');\n\t\t$this->template->title = \"Login\";\n\n\t\t# Pass data to the view\n\t\t$this->template->content->error = $error;\n\n\t\t# Render template\n\t\techo $this->template;\n\t}",
"public function login()\n\t{\n\t\tif (isLogin()) {\n\t\t\tredirect('/backoffice');\n\t\t} else {\n\t\t\t$this->display(\n\t\t\t\t'backoffice/login.html.twig'\n\t\t\t);\n\t\t}\n\n\t}",
"public function actionLogin()\n {\n $this->layout = '//layouts/blank';\n $model = new LoginForm;\n if(isset($_GET['language']))\n {\n $model->language = $_GET['language'];\n }\n else\n {\n $cookies = Yii::app()->request->getCookies();\n if(!empty($cookies['language']))\n {\n $model->language = $cookies['language']->value;\n }\n }\n\n // collect user input data\n if(isset($_POST['LoginForm']))\n {\n $model->attributes = $_POST['LoginForm'];\n $result = LoginService::login($_POST['LoginForm']);\n if($result['status'] == 'success')\n {\n $returnUrl = Yii::app()->user->returnUrl;\n $this->redirect($returnUrl);\n }\n else\n {\n $model->addErrors($result['detail']);\n }\n }\n $this->render('login', array('model' => $model));\n }",
"public function login($error = NULL) {\n \n $this->template->content3=View::instance('v_users_login'); \n $this->template->title= APP_NAME. \" :: Login\";\n // add required js and css files to be used in the form\n $client_files_head=Array('/js/languages/jquery.validationEngine-en.js',\n '/js/jquery.validationEngine.js',\n '/css/validationEngine.jquery.css'\n );\n $this->template->client_files_head=Utils::load_client_files($client_files_head); \n # Pass data to the view\n $this->template->content3->error = $error;\n\n echo $this->template;\n\n\n }",
"public function loginForm($params) {\n if($this->is_logged_in(true)) {\n error_log(\"logging out already logged-in user.\");\n $this->logout([]);\n }\n\n include_once \"app/views/user/user_login.phtml\";\n }",
"public function login()\n\t{\n\t\t// Method should not be directly accessible\n\t\tif( $this->uri->uri_string() == 'auth/login')\n\t\t\tshow_404();\n\n\t\tif($this->require_min_level(6) == 1)\n\t\t\tredirect('');\n\n\t\tif(strtolower( $_SERVER['REQUEST_METHOD'] ) == 'post')\n\t\t\t$this->require_min_level(1);\n\n\t\t$this->setup_login_form();\n\n\t\t$html = $this->load->view('auth/page_header', '', TRUE);\n\t\t$html .= $this->load->view('auth/login_form', '', TRUE);\n\t\t$html .= $this->load->view('auth/page_footer', '', TRUE);\n\n\t\techo $html;\n\t}",
"public function loginForm()\n {\n\n if (isset($_SESSION['login_ss'])) {\n header('location: http://localhost/nhi_mvc/index/students');\n exit();\n }\n $this->view->render(\"login/login\");\n }",
"public function loginAction()\n {\n $form = new LoginForm();\n\n try {\n\n if (!$this->request->isPost()) {\n\n if ($this->auth->hasRememberMe()) {\n return $this->auth->loginWithRememberMe();\n }\n } else {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $loginSuccess = false;\n $loginError = null;\n \n // wrap this in a try/catch for now\n try {\n $this->auth->check(array(\n 'email' => $this->request->getPost('email'),\n 'password' => $this->request->getPost('password'),\n 'remember' => $this->request->getPost('remember')\n ));\n \n $loginSuccess = true;\n \n } \n catch (\\Exception $e) \n {\n \n $loginError = $e->getMessage();\n \n \t// is safemode enabled in the config? if so, try that as an auth method\n \tif ($this->config->safemode->enabled == 1) \n \t{\n \t if (password_verify($this->request->getPost('password'), $this->config->safemode->password)\n \t && strtolower($this->request->getPost('email')) == $this->config->safemode->email \n ) \n \t {\n \t $this->session->set('auth-identity', array(\n \t 'id' => new \\MongoId,\n \t 'name' => $this->config->safemode->username,\n \t 'profile' => $this->config->safemode->profile\n \t ));\n \t \n \t $loginSuccess = true;\n \t $loginError = null;\n \t }\n \t}\n }\n\n if ($loginSuccess) {\n // TODO redirect to the requested URL or the /admin otherwise\n return $this->response->redirect('admin');\n } else {\n $this->flashSession->error($loginError);\n }\n }\n }\n } catch (\\Exception $e) {\n $this->flash->error($e->getMessage());\n }\n\n $this->view->form = $form;\n \n $this->theme->setVariant('login');\n $this->view->disable();\n echo $this->theme->renderTheme('Admin/Views::Session/login'); \n }",
"public function login() {\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['password'])) {\n session_write_close();\n header(\"Location: \".app::site_url(array(config::get('default_controller'), 'index')));\n exit(0);\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array(\n 'flash' => $flash,\n 'title' => 'Login'\n );\n }",
"function display_login_notice()\n\t\t{\n\t\t\t?>\n\t\t\t\t<div class=\"cv-main-wrapper\">\n\t\t\t\t\t<div class=\"container\">\n\t\t\t <div class=\"cv-heading\">\n\t\t\t <h1 class=\"pt-5\">Please Login to your account before checkout.</h1>\n\t\t\t </div>\n\t\t\t\t </div>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function tryLogIn(){\n if(count(self::$loginErrors) === 0){\n $password = md5(self::$loginPassword);\n $query = self::$connection->db->prepare(\"SELECT * FROM users WHERE email = ? AND password = ?\");\n $query->bind_param(\"ss\", self::$loginEmail, $password);\n $query->execute();\n $user = mysqli_fetch_assoc( $query->get_result());\n //Send to Profile page if correct credentials; otherwise, stay on authentication page\n if($user){\n $this->prepareSession($user['name'], self::$loginEmail);\n $_POST = array();\n Auth::CreateView('Profile');\n }else{\n self::addError(\"login\", \"Incorrect credentials!\");\n Auth::CreateView('Auth');\n }\n }\n self::$connection->closeConnection();\n }",
"public function actionLogin() {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login() && $model->validate()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\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 }",
"function login_error() {\n echo \"<div class='alert alert-danger'>Invalid username/password\n combination.</div><br><a href='user_login.php'><button type='button'\n class='btn btn-primary'>Return To Login Page</button></a>\";\n echo \"</div>\";\n exit;\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}",
"function draw_login($message) { ?>\n \n <body class=\"loginBody\">\n <section class=\"viewport\">\n <section id=\"login\" class= \"loginCardStyle nosidebarblockLayout centerCardLayout\">\n <a href=\"../pages/mainpage.php\"><img id=\"logo\" src= \"../img/logo.png\" height=\"90\" width=\"90\"/></a>\n <h2>Welcome back to Mel-o!</h2>\n <?php if($message !== \"\") {?>\n <h3><?= $message ?></h3>\n <?php }?>\n\n <form method=\"post\" action=\"../actions/action_login.php\">\n <input type=\"text\" name=\"username\" placeholder=\"username\" class=\"inputField\" autocomplete=\"username\" maxlength=\"15\" required>\n <input type=\"password\" name=\"password\" placeholder=\"password\" class=\"inputField\" autocomplete=\"current-password\" maxlength=\"15\" required>\n <input type=\"submit\" value=\"Login\">\n </form>\n\n <footer>\n <p>Don't have an account? <a href=\"signup.php?message=\">Signup!</a></p>\n </footer>\n </section>\n </section>\n<?php }",
"public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->redirect([ 'site/index' ]);\n }\n $referer = \\Yii::$app->request->get('referer', \\Yii::$app->request->referrer);\n if (empty( $referer )) {\n $referer = Url::to([ 'cabinet/main' ], true);\n }\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return Yii::$app->getResponse()\n ->redirect($referer);\n } else {\n return $this->render(\n 'login',\n [\n 'model' => $model,\n ]\n );\n }\n }",
"public function actionLogin()\n {\n $model = new LoginForm();\n\n if (isset($_POST['LoginForm'])) {\n $model->attributes = $_POST['LoginForm'];\n // validate user input and redirect to the previous page if valid\n if ($model->validate() && $model->login()) {\n $this->redirect(Yii::app()->user->returnUrl);\n }\n }\n // display the login form\n $this->render('login', ['model' => $model]);\n }",
"public function actionLogin()\n {\n $model=new LoginForm;\n // collect user input data\n if(isset($_POST['LoginForm']))\n {\n $model->attributes=$_POST['LoginForm'];\n // validate user input and redirect to the previous page if valid\n if($model->validate())\n {\n Logs::create(Logs::T_NOTICE, 'Login successfull', Logs::E_LOGIN);\n $this->redirect(Yii::app()->user->returnUrl);\n }\n else\n {\n Logs::create(Logs::T_ALERT,\n 'Login attempt failed with username \\'' . $model->username . '\\'',\n Logs::E_LOGIN);\n }\n }\n // display the login form\n $this->render('login',array('model'=>$model));\n }",
"public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, profilePic, access, email FROM users WHERE username='$username' AND password='$password'\";\r\n\t\t$data = $this -> singleSelectQuery($query);\r\n\t\tif($data){\r\n\t\t\t//set up the session\r\n\t\t\t$_SESSION['userID'] = $data['userID'];\r\n\t\t\t$_SESSION['username'] = $data['username'];\r\n\t\t\t$_SESSION['profilePic'] = $data['profilePic'];\r\n\t\t\t$_SESSION['userType'] = $data['userType'];\r\n\t\t\t$_SESSION['access'] = $data['access'];\r\n\t\t\t//redirects to their profile\r\n\t\t\theader('location: index.php?page=profile&userID='.$_SESSION['userID']);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}",
"function loginbox ($redirect_vars = null, $AlwaysShowMessage = false) {\n // variables to be included as hidden fields in the login form. (The\n // names of the fields will be the keys of the array, prefixed by\n // 'red_'.) Passing a non-array gives the same results as passing an\n // empty array. No sanitisation whatsoever is performed by this\n // function; sanitisation is the responsibility of the script calling\n // the function.\n global $Administrator, $Translator;\n $this->opennode('noscript');\n $this->leaf( 'p',\n 'PLEASE ENABLE JAVASCRIPT',\n 'style=\"font-family: Helvetica,Tahoma,Verdana,Arial,sans-serif; font-size: 130%; font-weight: bold; text-align: center;\"'\n );\n $this->closenode(); // noscript\n if ( $_SESSION['LoggedIn'] ) {\n $this->opennode('div', 'id=\"loginbox\" class=\"modularbox font_sans_serif mygame\"');\n $this->leaf( 'div',\n 'Generated '.date('M-d H:i:s').' GMT',\n 'style=\"float: right; border: none; margin: 5px 0px; text-align: right; font-size: 75%;\"'\n );\n $this->leaf( 'p',\n TEST_ENVIRONMENT_NOTICE.\n str_replace('\\username', $_SESSION['MyUserName'], transtext('^LoggedInAs'))\n );\n $this->opennode('ul', 'class=\"navlinks\"');\n $this->leaf( 'li',\n '<a href=\"usersgames.php?UserID='.\n $_SESSION['MyUserID'].\n '\">'.\n transtext('^LkYourGames').\n '</a>'\n );\n $this->leaf( 'li',\n '<a href=\"userdetails.php?UserID='.\n $_SESSION['MyUserID'].\n '\">'.\n transtext('^LkUserDetails').\n '</a>'\n );\n $this->leaf( 'li',\n '<a href=\"emails.php\">Emails</a>'\n );\n if ( $Administrator or $Translator ) {\n $this->leaf( 'li',\n '<a href=\"translatea.php\">Translation interface</a>'\n );\n }\n $this->leaf( 'li',\n '<a href=\"logout.php\">'.\n transtext('^LkLogOut').\n '</a>'\n );\n $this->leaf( 'li',\n '<a href=\"index.php\">'.\n transtext('^LkMainPage').\n '</a>'\n );\n $this->closenode();\n } else {\n $this->opennode('div', 'id=\"loginbox\" class=\"modularbox font_sans_serif myattn\"');\n $this->leaf( 'div',\n 'Generated '.date('M-d H:i:s').' GMT',\n 'style=\"float: right; border: none; margin: 5px 0px; text-align: right; font-size: 75%;\"'\n );\n $NotLoggedInStatement = TEST_ENVIRONMENT_NOTICE.\n transtext('^NotLoggedIn');\n if ( LOGIN_DISABLED ) {\n $NotLoggedInStatement .= ' <b>(Login is currently disabled except for Administrators.)</b>';\n }\n $this->leaf( 'p',\n $NotLoggedInStatement\n );\n $this->opennode('form', 'action=\"login.php\" method=\"POST\"');\n $this->opennode('p');\n $this->text('Name:');\n $this->emptyleaf( 'input',\n 'type=\"text\" name=\"Name\" size=28 maxlength=20'\n );\n $this->text('Password:');\n $this->emptyleaf( 'input',\n 'type=\"password\" name=\"Password\" size=28 maxlength=20'\n );\n $this->emptyleaf('input', 'type=\"submit\" value=\"Log in\"');\n $this->closenode(); // p\n if ( is_array($redirect_vars) ) {\n foreach ( $redirect_vars as $key => $value ) {\n $this->emptyleaf( 'input',\n 'type=\"hidden\" name=\"red_'.\n $key.\n '\" value=\"'.\n $value.\n '\"'\n );\n }\n }\n $this->closenode(); // form\n $this->opennode('ul', 'class=\"navlinks\"');\n $this->leaf( 'li',\n '<a href=\"recoveraccount.php\">Recover Account (Forgotten Password)</a>'\n );\n if ( LOGIN_DISABLED or REGISTRATION_DISABLED ) {\n $this->leaf( 'li',\n '<del>Register new user</del>'\n );\n $this->leaf( 'li',\n '<del>Re-send validation email</del>'\n );\n } else {\n $this->leaf( 'li',\n '<a href=\"newuser_language.php\">Register new user</a>'\n );\n $this->leaf( 'li',\n '<a href=\"resendvalemail.php\">Re-send validation email</a>'\n );\n }\n $this->leaf( 'li',\n '<a href=\"index.php\">'.\n transtext('^LkMainPage').\n '</a>'\n );\n $this->closenode();\n }\n if ( MAINTENANCE_DISABLED ) {\n $this->leaf( 'p',\n transtext('^MaintenanceOff'),\n 'style=\"color: #FF0000; font-weight: bold;\"'\n );\n }\n if ( DISPLAY_SYSTEM_MESSAGE == 2 ) {\n $this->leaf( 'p',\n '<span style=\"color: #FF0000; font-weight: bold;\">'.\n transtext('^ImportantMsg').\n '</span> '.\n SYSTEM_MESSAGE\n );\n } else if ( DISPLAY_SYSTEM_MESSAGE and $AlwaysShowMessage ) {\n $this->leaf( 'p',\n '<span style=\"color: #FF0000; font-weight: bold;\">'.\n transtext('^SystemMessage').\n '</span> '.SYSTEM_MESSAGE\n );\n }\n $this->closenode();\n }",
"public function actionLogin()\n\t{\n\t\t$model=new LoginForm;\n\n\t\t// if it is ajax validation request\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='login-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\tif($model->validate() && $model->login())\n\t\t\t{\n\t\t\t\tYii::app()->user->setUrlAfterLogin();\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message=CHtml::errorSummary($model);\n\t\t\t\tDialog::message('Validation Message', $message);\n\t\t\t}\n\t\t}\n\t\t// display the login form\n\t\t$this->layout = \"main_nm\";\n\t\t$this->render('login',array('model'=>$model));\n\t}",
"public function showLogin() {\n if (isAuth()) {\n Flash::set(\"You're already logged in!\", 'info');\n $this->redirect($this->url('LoginHome'));\n }\n $active = 'login';\n $this\n ->setTitle('Login')\n ->add('active', $active)\n ->show('login/login');\n }",
"public function indexErrorLogin()\r\n {\r\n\t$vars['error'] = 1;\r\n\t\t\r\n $this->view->show(\"home.php\", $vars);\r\n }",
"public static function handle_login() {\n $params = $_POST;\n $player = Player::authenticate($params['username'], $params['password']);\n if(!$player) {\n View::make('player/login.html', array('error' => 'Väärä käyttäjätunnus tai salasana.', 'username' => $params['username']));\n } else {\n $_SESSION['user'] = $player->id;\n\n Redirect::to('/', array('message' => 'Kirjautunut käyttäjänä ' . $player->username));\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login.twig', [\n 'model' => $model,\n ]);\n }\n }",
"public function formLogin(){\n $user = $this->model->connectFromCookie();\n if ($user) {\n header('location:index.php?controller=dashboard');\n } else {\n $this->view->addFormLogin();\n }\n }",
"public function loginForm(){\n self::$loginEmail = $_POST['login-email'];\n self::$loginPassword = $_POST['login-password'];\n \n self::sanitize();\n $this->tryLogIn();\n }",
"public function actionLogin() {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public static function printLoginForm() {\n\t\t\tif($_GET['module'] != \"login\"){\n\t\t\t\t$cur_page = $_SERVER[\"REQUEST_URI\"];\n\t\t\t\t$cur_page = str_replace(\"/index.php\", \"\", $cur_page);\n\t\t\t\t$_SESSION['ref'] = $cur_page; \n\t\t\t}\n\t\t\t// The user is not logged in shown the login form\n\t\t\tinclude 'engine/values/site.values.php';\n\t\t\techo \"<form action=\\\"?module=handler&action=login\\\" method=\\\"post\\\">\n\t\t\t <div class=\\\"form_settings\\\" style=\\\"float:right; position:relative; left: -24%;\\\">\n\t\t\t \t<center><h2>\".strip_tags($site_title).\" - Login</h2></center>\n\t\t\t \t<br>\n\t\t\t \t<p><span>Email</span><input type=\\\"text\\\" name=\\\"user\\\" tabindex=\\\"1\\\" class=\\\"contact\\\"/></p>\n\t\t\t <p><span>Password</span><input type=\\\"password\\\" name=\\\"password\\\" tabindex=\\\"2\\\" class=\\\"contact\\\"/></p>\n\t\t\t <p style=\\\"padding-top: 15px\\\"><span> </span><input class=\\\"submit\\\" type=\\\"submit\\\" name=\\\"contact_submitted\\\" value=\\\"Submit\\\" /></p>\n\t\t\t <br><center>\";\n\t\t\t\tif($site_reg_open){\n\t \t\techo \"[<a href=\\\"?module=registration\\\">Register</a>]\";\n\t\t\t\t}\n\t\t\t echo \"[<a href=\\\"?module=handler&action=forgot\\\">Forgotten password?</a>]</center></div>\n\t\t\t</form>\";\n\t\t}",
"public function action_login() {\n if(model_user::userLoggedIn()) {\n header('Location: /home/track');\n }\n // Checks email and passwordfor validation.\n if (isset($_POST['form']['action'])) {\n\n // Saving form values in variables.\n $form_data = array(\n 'login_email' => $_POST['form']['user'],\n 'login_password' => $_POST['form']['password'],\n );\n\n $user_login = model_user::getByEmail( $form_data['login_email']);\n $user_email = $user_login->email;\n\n // Caching the form errors.\n $form_error = array(\n 'no_email' => empty($form_data['login_email']) ? \"Please insert your email!\" : FALSE,\n 'no_password' => empty($form_data['login_password']) ? \"Please insert your password!\" : FALSE,\n 'wrong_email' => ($user_email != $form_data['login_email']) ? \"Wrong e-mail!\" : FALSE,\n 'wrong_password' => (!empty($form_data['login_password']) && $user_login->password) ? \"Wrong password!\" : FALSE,\n );\n if ($user_email === $form_data['login_email'] && $user_login->checkPassword($form_data['login_password'])) {\n $_SESSION['user'] = $user_email;\n $_SESSION['id'] = $user_login->id;\n header('Location: /home/track');\n }\n }\n @include_once APP_PATH . 'view/home_index.tpl.php';\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function login()\n\t{\n\t\t$this->load->view('layout/layout_open');\n\t\t$this->load->view('login');\n\t\t$this->load->view('layout/layout_close');\n\t}",
"public function loginAction() {\n if ($this->_getSession()->isLoggedIn()) {\n $this->_redirect('*/*/');\n return;\n }\n $this->getResponse()->setHeader('Login-Required', 'true');\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->_initLayoutMessages('catalog/session');\n $this->renderLayout();\n }",
"public function dologinpage()\n\t\t{\n\t\t\t$userdata = array(\n\t\t\t\t'email' => Input::get('email'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t);\n\n\t\t\tif(Auth::attempt($userdata)) {\n\t\t\t\tSession::flash('successMessage', \"Welcome back, \" . Auth::user()->username . \"!\");\n\t\t\t\tSession::put('loggedinuser', Auth::user()->username);\n\t\t\t\treturn Redirect::intended('/posts');\n\t\t\t\t// $userid = DB::table('users')->where('username', Session::get('loggedinuser'))->pluck('id');\n\t\t\t\t// Session::put('loggedinid', $userid);\n\t\t\t\t\n\t\t\t\t// return Redirect::action('PostsController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your username or password is incorrect');\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}",
"public function loginAction()\n {\n $form = new LoginForm();\n\n try {\n\n if (!$this->request->isPost()) {\n\n if ($this->auth->hasRememberMe()) {\n return $this->auth->loginWithRememberMe();\n }\n } else {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $this->auth->check([\n 'email' => $this->request->getPost('email'),\n 'password' => $this->request->getPost('password'),\n 'remember' => $this->request->getPost('remember')\n ]);\n\n // return $this->response->redirect('index');\n return $this->response->redirect('campaign/dashboardcamp');\n }\n }\n } catch (AuthException $e) {\n $this->flash->error($e->getMessage());\n }\n\n $this->view->form = $form;\n }",
"public function optional_login_test()\r\n\t{\r\n\t\tif( $this->verify_min_level(1) )\r\n\t\t{\r\n\t\t\t$page_content = '<p>Although not required, you are logged in!</p>';\r\n\t\t}\r\n\t\telseif( $this->tokens->match && $this->optional_login() )\r\n\t\t{\r\n\t\t\t// Let Community Auth handle the login attempt ...\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Notice parameter set to TRUE, which designates this as an optional login\r\n\t\t\t$this->setup_login_form(TRUE);\r\n\r\n\t\t\t$page_content = '<p>You are not logged in, but can still see this page.</p>';\r\n\r\n\t\t\t// Form helper needed\r\n\t\t\t$this->load->helper('form');\r\n\r\n\t\t\t$page_content .= $this->load->view('examples/login_form', '', TRUE);\r\n\t\t}\r\n\r\n\t\techo $this->load->view('examples/page_header', '', TRUE);\r\n\r\n\t\techo $page_content;\r\n\r\n\t\techo $this->load->view('examples/page_footer', '', TRUE);\r\n\t}",
"public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"function loginHandler($username, $password) {\n if ($username == '' || $password == '') {\n $feedback = 'Vänligen fyll i båda fält.';\n header(\"Location: ../../../index.php?loginError=$feedback\");\n exit();\n }\n\n $result = validateUser($username, $password);\n\n // If the entered text didn't match with any of the registred users\n if (!$result) {\n $feedback = 'Vänligen kontollera att du fyllt i rätt information.';\n header(\"Location: ../../../index.php?loginError=$feedback\");\n exit();\n } else {\n $_SESSION[\"user_ID\"] = $result[\"id\"];\n $_SESSION[\"isLoggedIn\"] = true;\n $_SESSION[\"username\"] = $result[\"username\"];\n header('Location: ../../page_php/main.php#dialogue');\n exit();\n }\n }",
"public function actionLogin() {\n $model = new AdminLoginForm();\n // collect user input data\n if (isset($_POST['AdminLoginForm'])) {\n $model->setScenario(\"login\");\n $model->attributes = $_POST['AdminLoginForm'];\n // validate user input and redirect to the previous page if valid\n if ($model->validate() && $model->login()) {\n $this->redirect(array('admin/index'));\n }\n }\n $data = array(\n 'model' => $model\n );\n $this->render('login', array('model' => $model));\n }",
"public function login() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $data = [\n 'email' => trim($_POST['email']),\n 'email_err' => '',\n\n 'password' => trim($_POST['password']),\n 'password_err' => '',\n\n 'head' => 'Login'\n ];\n\n // Formular validieren\n if (empty($data['email'])) {\n $data['email_err'] = 'Bitte E-Mail-Adresse angeben';\n }\n // Für Login: nach user/email suchen\n elseif ($this->userModel->getUserByEmail($data['email'])) {\n // Benutzer gefunden\n /////////////////////////////////////////////////\n } \n else {\n // Benutzer nicht gefunden\n $data['email_err'] = 'Benutzer nicht gefunden';\n }\n\n if (empty($data['password'])) {\n $data['password_err'] = 'Das Password muss angegeben werden';\n }\n \n // Kontrollieren ob es Fehlermeldungen gibt, wenn nicht LOGIN +++++\n if (empty($data['email_err']) && empty($data['password_err'])) {\n // user einloggen\n $loggedInUser = $this->userModel->login($data['email'], $data['password']);\n\n if ($loggedInUser) {\n // SESSION starten\n $this->createUserSession($loggedInUser);\n }\n else {\n // Login gescheitert\n $data['password_err'] = 'Das Passwort ist falsch';\n $this->view('user/login', $data);\n }\n }\n else {\n // Dokument mit Fehlermeldungen laden\n $this->view('user/login', $data);\n } // ende login ---------------------------------------------------\n }\n // Wenn die REQUEST_METHOD nicht 'POST' ist\n // den $data-Array leer lassen und wieder zum Login-Formular weiterleiten\n else {\n $data = [\n 'email' => '',\n 'email_err' => '',\n\n 'password' => '',\n 'password_err' => '',\n\n 'head' => 'Login'\n ];\n\n $this->view('user/login', $data);\n } // ende else\n }",
"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 // run the login() method in the login-model, put the result in $login_successful (true or false)\n $login_model = $this->loadModel('Login');\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = $login_model->login();\n\n // check login status\n if ($login_successful) {\n // if YES, then move user to dashboard/index\n // please note: this is a browser-redirection, not a rendered view\n header('location: ' . URL . 'dashboard/index');\n } else {\n // if NO, then show the login/index (login form) again\n $this->view->render('login/index');\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n //return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n //return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\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 actionLogin()\n\t{\n\t\t$model=new LoginForm;\n\n\t\t// if it is ajax validation request\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='login-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\tif($model->validate() && $model->login())\n\t\t\t$this->redirect(Yii::app()->createUrl(\"site/splash\"));\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login',array('model'=>$model));\n\t}",
"public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}",
"public function login(){\r\n $this->load->view('admin/templates/header');\r\n $this->load->view('admin/login');\r\n $this->load->view('admin/templates/footer');\r\n if(isset($_SESSION['message'])){\r\n unset($_SESSION['message']);\r\n }\r\n }",
"function login() {\n\n $this->redirect(\"/staff/users/alllogin\");\n \n $this->layout = 'login_layout';\n\t\t// Display error message on failed authentication\n\t\tif (!empty($this->data) && !$this->Auth->_loggedIn) {\n\t\t\t$this->Session->setFlash($this->Auth->loginError);\t\t\t\n\t\t}\n\t\t// Redirect the logged in user to respective pages\n\t\t$this->setLoginRedirects();\n\t}",
"public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}",
"public function actionLogin()\n\t{\n\t\t$model=new LoginForm;\n\n\t\t// collect user input data\n\t\tif(isset($_POST['LoginForm']))\n\t\t{\n\t\t\t$model->attributes=$_POST['LoginForm'];\n\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\tif($model->validate() && $model->login())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\t\t// display the login form\n\t\t$this->render('login', array('model'=>$model));\n\t}",
"public function actionLogin() {\r\n\t\t$model = new LoginForm ();\r\n\t\t\r\n\t\t// if it is ajax validation request\r\n\t\tif (isset ( $_POST ['ajax'] ) && $_POST ['ajax'] === 'login-form') {\r\n\t\t\techo CActiveForm::validate ( $model );\r\n\t\t\tYii::app ()->end ();\r\n\t\t}\r\n\t\t\r\n\t\t// collect user input data\r\n\t\tif (isset ( $_POST ['LoginForm'] )) {\r\n\t\t\t$model->attributes = $_POST ['LoginForm'];\r\n\t\t\t// validate user input and redirect to the previous page if valid\r\n\t\t\tif ($model->validate () && $model->login ())\r\n\t\t\t\t$this->redirect ( Yii::app ()->user->returnUrl );\r\n\t\t}\r\n\t\t// display the login form\r\n\t\t$this->render ( 'login', array (\r\n\t\t\t\t'model' => $model \r\n\t\t) );\r\n\t}",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n $user = User::find()->where(['id' => Yii::$app->user->id])->one();\n return $this->goBack();\n } else {\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n $model->password = '';\n\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }"
] | [
"0.7471234",
"0.7200397",
"0.7130963",
"0.70469415",
"0.69884235",
"0.69494724",
"0.69230264",
"0.6865112",
"0.6861763",
"0.6852303",
"0.6802287",
"0.6781478",
"0.6698171",
"0.66771",
"0.66744596",
"0.6666361",
"0.66572887",
"0.66539264",
"0.6651607",
"0.6644794",
"0.66274804",
"0.6604419",
"0.6598017",
"0.6592401",
"0.6587744",
"0.657078",
"0.65509695",
"0.6547143",
"0.6546264",
"0.6541635",
"0.653916",
"0.65386903",
"0.65283966",
"0.6523864",
"0.65194345",
"0.65155",
"0.6512087",
"0.6496865",
"0.6490355",
"0.64851457",
"0.6485095",
"0.64759773",
"0.6462697",
"0.6455821",
"0.64549226",
"0.6444779",
"0.64418316",
"0.64196146",
"0.64192474",
"0.64177763",
"0.6412485",
"0.6411737",
"0.64105135",
"0.64059615",
"0.6402278",
"0.64022297",
"0.63924295",
"0.6385104",
"0.6380133",
"0.63800275",
"0.6379592",
"0.6376682",
"0.637632",
"0.63671273",
"0.63664556",
"0.6359662",
"0.6355743",
"0.6355022",
"0.6355022",
"0.6355022",
"0.6355022",
"0.6355022",
"0.6355022",
"0.6355022",
"0.6355022",
"0.63522017",
"0.6350604",
"0.63450474",
"0.6344623",
"0.6342965",
"0.63419634",
"0.63419634",
"0.63418674",
"0.6338201",
"0.6333178",
"0.6332304",
"0.6325545",
"0.6320584",
"0.6317702",
"0.63162357",
"0.63115025",
"0.62983745",
"0.6293085",
"0.6291857",
"0.62860763",
"0.6273904",
"0.6264076",
"0.6261563",
"0.6261563",
"0.6261563"
] | 0.6910822 | 7 |
Attempt to login the user | function loginUser() {
session_start();
require_once("sql/dbQueries.php");
// Fetching user data from login data
$userData = getUserFromLogin($_POST['vms_email'], $_POST['userPassword']);
if($userData == False) {
printLoginPage("The login information supplied is not valid.");
return;
} else {
// Saving the user's info in a session variable
$_SESSION['auth'] = TRUE;
$_SESSION['auth_info'] = $userData[0];
// Fetching the DID for the user's default DID.
$activeDID = getDIDFromID($userData[0]['didID_default']);
if($activeDID != false) {
$_SESSION['auth_info']['activeDID'] = $activeDID['did'];
} else {
$_SESSION['auth_info']['activeDID'] = null;
}
//print_r($_SESSION);
// Head back home
header("Location: index.php");
return;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function attemptLogin($user){\n\n }",
"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\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 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()\n {\n $user=$this->getUser();\n\n $this->setScenario('normal');\n if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha');\n \n if ($this->validate()) {\n $user->failed_logins=0;\n $user->save();\n\n return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\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()\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 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 }",
"public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"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 {\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 }",
"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 login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"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 }",
"public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }",
"public function login() {\n $userName = Request::post('user_name');\n $userPassword = Request::post('user_password');\n if (isset($userName) && isset($userPassword)) {\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = LoginModel::login($userName, $userPassword);\n\n // check login status: if true, then redirect user login/showProfile, if false, then to login form again\n if ($login_successful) {\n //if the user successfully logs in, reset the count\n $userID = Session::get('user_id');\n LoginModel::validLogin($userID);\n Redirect::to('login/loginHome');\n } else {\n Redirect::to('login/index');\n }\n }\n }",
"public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}",
"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 tryLogIn(){\n if(count(self::$loginErrors) === 0){\n $password = md5(self::$loginPassword);\n $query = self::$connection->db->prepare(\"SELECT * FROM users WHERE email = ? AND password = ?\");\n $query->bind_param(\"ss\", self::$loginEmail, $password);\n $query->execute();\n $user = mysqli_fetch_assoc( $query->get_result());\n //Send to Profile page if correct credentials; otherwise, stay on authentication page\n if($user){\n $this->prepareSession($user['name'], self::$loginEmail);\n $_POST = array();\n Auth::CreateView('Profile');\n }else{\n self::addError(\"login\", \"Incorrect credentials!\");\n Auth::CreateView('Auth');\n }\n }\n self::$connection->closeConnection();\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 login();",
"public function login();",
"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\t\tif ($this->_identity === null) {\n\t\t\t$this->_identity = new UserIdentity($this->username, $this->password, $this->loginType);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\n\t\t\t$duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days or the default session timeout value\n\t\t\tYii::app()->user->login($this->_identity, $duration);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"abstract protected function doLogin();",
"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 doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }",
"public function dologin() {\n\t\t$this->load->model('Users_model');\n\t\t$username = $_POST['username'];\n\t\tif($this->Users_model->checkLogin($username, sha1($_POST['password']))) {\n\t\t\t$this->session->set_userdata(\"username\",$username); // Initializing session\n\t\t\tredirect('user/view/'.$username, 'refresh'); // Redirect\n\t\t} else {\n\t\t\t$data['attempted'] = true;\n\t\t\t$this->load->view('view_login', $data);\n\t\t}\n\t}",
"public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}",
"public function doLogin(){\n $rules = array(\n 'userid' => 'required|max:30',\n 'password' => 'required',\n );\n $display = array(\n 'userid' => 'User ID',\n 'password' => 'Password'\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, array(), $display);\n if($validator->fails()) {\n return \\Redirect::back()\n ->withErrors($validator)\n ->withInput(\\Input::all());\n }else{\n $user = User::where('username', '=', \\Input::get('userid'))\n ->first();\n if(isset($user->id)){\n if($user->level < 3) {\n if (\\Hash::check(\\Input::get('password'), $user->password)) {\n \\Session::put('logedin', $user->id);\n \\Session::put('loginLevel', $user->level);\n \\Session::put('nickname', $user->nickname);\n }\n return \\Redirect::nccms('/');\n }else{\n \\Session::flash('error', 'Permission Error.');\n return \\Redirect::nccms('login');\n }\n }else{\n \\Session::flash('error', 'Email/Password Error.');\n return \\Redirect::nccms('login');\n }\n }\n }",
"public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\n $lastLogin = date(\"Y-m-d H:i:s\");\n\n if(Yii::app()->user->tableName === 'tbl_user'){\n $sql = \"UPDATE tbl_user_dynamic SET ulast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_personnel'){\n $sql = \"UPDATE tbl_user_dynamic SET plast_login = :lastLogin WHERE user_id = :userid\";\n }\n if(Yii::app()->user->tableName === 'tbl_reader'){\n $sql = \"UPDATE tbl_user_dynamic SET rlast_login = :lastLogin WHERE user_id = :userid\";\n }\n $command = Yii::app()->db->createCommand($sql);\n $command->bindValue(\":userid\", $this->_identity->id, PDO::PARAM_STR);\n $command->bindValue(\":lastLogin\", $lastLogin, PDO::PARAM_STR);\n $command->execute();\n Tank::wipeStats();\n Yii::app()->user->setState('todayHasRecord',User::todayHasRecord());\n return true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"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() {\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 }",
"private function login(){\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 }",
"public function Login()\n\t{\n\t\t$this->user->email = $_POST['email'];\n\t\t$this->user->password = $_POST['password'];\n // Here we verify the nonce, so that only users can try to log in\n\t\t// to whom we've actually shown a login page. The first parameter\n\t\t// of Nonce::Verify needs to correspond to the parameter that we\n\t\t// used to create the nonce, but otherwise it can be anything\n\t\t// as long as they match.\n\t\tif (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])){\n\t\t\t// We store it in the session if the user wants to be remembered. This is because\n\t\t\t// some auth backends redirect the user and we will need it after the user\n\t\t\t// arrives back.\n\t\t\t//echo \"login successful\";\n\t\t\t\n\t\t\t///echo $this->input->post('email');\n\n\t\t\tif (isset($_POST['autologin']))\n\t\t\t\t$_SESSION['appRememberMeRequested'] = true;\n\t\t\telse\n\t\t\t\tunset($_SESSION['appRememberMeRequested']);\n \n\t\t\t// This is the line where we actually try to authenticate against some kind\n\t\t\t// of user database. Note that depending on the auth backend, this function might\n\t\t\t// redirect the user to a different page, in which case it does not return.\n\t\t\t$this->ulogin->Authenticate($_POST['email'], $_POST['password']);\n\t\t\tif ($this->ulogin->IsAuthSuccess()){\n\t\t\t\t$_SESSION[\"loggedIn\"] = true;\n\t\t\t\techo \"success\";\n\t\t\t}else echo \"failed\";\n\t\t}else echo 'refresh';\n\t\t//$this->load->view('layout/home.php');\n\t}",
"public static function login()\n {\n (new Authenticator(request()))->login();\n }",
"public function login()\r\n\t{\t\t\r\n\t\tif ($this->_identity === null) {\r\n $this->_identity = new UserIdentity($this->email, $this->password);\r\n $this->_identity->authenticate();\r\n }\r\n\t\t\r\n switch ($this->_identity->errorCode) {\r\n case UserIdentity::ERROR_NONE:\r\n $duration = $this->rememberMe ? 3600 * 24 * 30 : 0; // 30 days\r\n Yii::app()->user->login($this->_identity, $duration);\r\n break;\r\n case UserIdentity::ERROR_USERNAME_INVALID:\t\t\t\t\r\n $this->addError('email', 'Email address is incorrect.');\r\n break;\r\n\t\t\tcase UserIdentity::ERROR_PASSWORD_INVALID:\r\n $this->addError('password', 'Password is incorrect.');\r\n break;\r\n default: // UserIdentity::ERROR_PASSWORD_INVALID\r\n $this->addError('password', 'Password is incorrect.');\r\n break;\r\n }\r\n\t\t\r\n if ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {\r\n $this->onAfterLogin(new CEvent($this, array()));\t\t\t\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\t}",
"protected function loginIfRequested() {}",
"public function login() {\n\t\treturn $this->login_as( call_user_func( Browser::$user_resolver ) );\n\t}",
"public function login()\n\t{\n $identity = $this->getIdentity();\n if ($identity->ok) {\n\t\t\t$duration = $this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->getIdentity(), $duration);\n\t\t\treturn true;\n \n\t\t} else\n\t\t\treturn false;\n\t}",
"public function executeLogin()\n {\n }",
"private function _login() {\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n $this->_connection->setUri( $this->_baseUrl . self::URL_LOGIN );\n $this->_connection->setParameterPost( array(\n 'login_username' => $this->_username,\n 'login_password' => $this->_password,\n 'back' => $this->_baseUrl,\n 'login' => 'Log In' ) );\n $this->_doRequest( Zend_Http_Client::POST );\n if( !$this->_connection->getCookieJar()->getCookie( $this->_baseUrl,\n 'auth_tkt', Zend_Http_CookieJar::COOKIE_OBJECT ) ) {\n throw new Opsview_Remote_Exception( 'Login failed for unknown reason' );\n }\n }\n }",
"protected function login() {\n\t\t\t\n\t\t\t// Generate the login string\n\t\t\t$loginString = str_replace( array('{USER}', '{PASS}'), array( $this->user, $this->pass), $this->loginString );\n\t\t\t\n\t\t\t// Send the login data with curl\n\t\t\t$this->c->{$this->loginMethod}($this->loginUrl, $loginString);\n\t\t\t\n\t\t\t// Check if the login worked\n\t\t\tif($this->is_logged_in()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tdie('Login failed');\n\t\t\t}\n\t\t\t\n\t\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}",
"public function login()\n {\n\t\t$login = Input::get('login');\n\t\t$password = Input::get('password');\n\t\ttry{\n\t\t\n\t\t\t$user = Auth::authenticate([\n\t\t\t\t'login' => $login,\n\t\t\t\t'password' => $password\n\t\t\t]);\n\t\t\t$this->setToken($user);\n\t\t\treturn $this->sendResponse('You are now logged in');\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $this->sendResponse($e->getMessage());\n\t\t}\n }",
"public function do_login()\n {\n $input = array(\n 'email' => Input::get( 'username' ), // May be the username too\n 'username' => Input::get( 'username' ), // so we have to pass both\n 'password' => Input::get( 'password' ),\n 'remember' => Input::get( 'remember' ),\n );\n\n // If you wish to only allow login from confirmed users, call logAttempt\n // with the second parameter as true.\n // logAttempt will check if the 'email' perhaps is the username.\n // Get the value from the config file instead of changing the controller\n if ( Confide::logAttempt( $input, Config::get('confide::signup_confirm') ) ) \n {\n // Redirect the user to the URL they were trying to access before\n // caught by the authentication filter IE Redirect::guest('user/login').\n // Otherwise fallback to '/'\n // Fix pull #145\n return Redirect::intended('/member'); // change it to '/admin', '/dashboard' or something\n }\n else\n {\n $user = new User;\n\n // Check if there was too many login attempts\n if( Confide::isThrottled( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.too_many_attempts');\n }\n elseif( $user->checkUserExists( $input ) and ! $user->isConfirmed( $input ) )\n {\n $err_msg = Lang::get('confide::confide.alerts.not_confirmed');\n }\n else\n {\n $err_msg = Lang::get('confide::confide.alerts.wrong_credentials');\n }\n \n return Redirect::action('UserController@login')\n ->withInput(Input::except('password'))\n ->with( 'error', $err_msg );\n }\n }",
"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}",
"public function actionLogin()\n {\n // user is logged in, he doesn't need to login\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n // get setting value for 'Login With Email'\n $lwe = Yii::$app->params['lwe'];\n\n // if 'lwe' value is 'true' we instantiate LoginForm in 'lwe' scenario\n $model = $lwe ? new LoginForm(['scenario' => 'lwe']) : new LoginForm();\n\n // monitor login status\n $successfulLogin = true;\n\n // posting data or login has failed\n if (!$model->load(Yii::$app->request->post()) || !$model->login()) {\n $successfulLogin = false;\n }\n\n // if user's account is not activated, he will have to activate it first\n if ($model->status === User::STATUS_INACTIVE && $successfulLogin === false) {\n Yii::$app->session->setFlash('error', Yii::t('app', \n 'You have to activate your account first. Please check your email.'));\n return $this->refresh();\n } \n\n // if user is not denied because he is not active, then his credentials are not good\n if ($successfulLogin === false) {\n return $this->render('login', ['model' => $model]);\n }\n\n // login was successful, let user go wherever he previously wanted\n return $this->goBack();\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}",
"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 login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }",
"public function login()\n {\n try {\n if ($this->call('login', '/user/login') != \"\") {\n if (($page = $this->call('basic', '')) !== false) {\n $this->html = $this->open($page);\n if ($this->findLink('/user/account')) {\n return true;\n } else {\n throw new Exception('Unable to login');\n }\n }\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\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 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 doLogin()\n\t{\n $userData = array(\n 'username' => \\Input::get('username'),\n 'password' => \\Input::get('password'),\n );\n\t\t\n\t\t$rememberMe = \\Input::get('remember-me');\n\t\t\n // Declare the rules for the form validation.\n $rules = array(\n 'username' => 'Required',\n 'password' => 'Required'\n );\n\n // Validate the inputs.\n $validator = \\Validator::make($userData, $rules);\n\n // Check if the form validates with success.\n if ($validator->passes())\n {\n // Try to log the user in.\n if (\\Auth::attempt($userData, (bool)$rememberMe))\n {\n // Redirect to dashboard\n\t\t\t\treturn \\Redirect::intended(route('dashboard'));\n }\n else\n {\n // Redirect to the login page.\n return \\Redirect::route('login')->withErrors(array('password' => \\Lang::get('site.password-incorrect')))->withInput(\\Input::except('password'));\n }\n }\n\n // Something went wrong.\n return \\Redirect::route('login')->withErrors($validator)->withInput(\\Input::except('password'));\n\t}",
"public function login()\n\t{\t\t\n\t\t$credentials['email'] = Input::get('email');\n\t\t$credentials['password'] = Input::get('password');\n\t\t$remember = (is_null(Input::get('remember'))?false:true);\t\t\n\n\t\t$user = $this->repo->login($credentials, $remember);\t\t\n\t\tif (!$user)\n\t\t{\n\t\t\tRedirect::route('login')->withInput(Input::except('password'));\n\t\t}\n\t\tif(Session::has('redirect'))\n\t\t{\n\t\t\t$url = Session::get('redirect');\n\t\t\tSession::forget('redirect');\t\t\t\n\t\t\treturn Redirect::to(Session::get('redirect'))->with('afterlogin', true);\t\n\t\t}\n\t\treturn Redirect::route('home')->with('afterlogin', true);\n\t}",
"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 login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }",
"public function login()\n\t{\n\t\tif (func_num_args() < 2)\n\t\t{\n\t\t\tthrow new Auth_Exception('Minimum two params required to log in');\n\t\t}\n\n\t\t// automatically logout\n\t\t$this->logout();\n\n\t\t$params = func_get_args();\n\t\t$driver_name = array_shift($params);\n\t\t$driver = $this->driver($driver_name);\n\t\tif ($user = call_user_func_array(array($driver, 'login'), $params))\n\t\t{\n\t\t\t$this->_complete_login($user, $driver_name);\n\t\t\t// check for autologin option\n\t\t\t$remember = (bool)arr::get($params, 1, FALSE);\n\t\t\tif ($remember)\n\t\t\t{\n\t\t\t\t$token = $this->orm()->generate_token($user, $driver_name, $this->_config['lifetime']);\n\t\t\t\tCookie::set($this->_autologin_key, $token->token);\n\t\t\t}\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"function 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 }",
"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}",
"public function doLogin()\n {\n if ($this->validate()) {\n $result = Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n\n if ($result) {\n $event = new LoginEvent();\n $event->user = $this->getUser();\n $this->trigger(self::EVENT_LOGIN, $event);\n }\n\n return $result;\n }\n return false;\n }",
"function login() {\n\n $this->visitPath('/user/login');\n\n $loginForm = $this->getSession()->getPage()->findById('user-login-form');\n if (is_null($loginForm)) {\n throw new ExpectationException('Cannot find the login form.', $this->getSession()->getDriver());\n }\n\n $usernameField = $loginForm->findById('edit-name');\n $passwdField = $loginForm->findById('edit-pass');\n\n if (is_null($usernameField) or is_null($passwdField)) {\n throw new ExpectationException('Cannot find the authentication fields.', $this->getSession()->getDriver());\n }\n\n $usernameField->setValue($this->admin_username);\n $passwdField->setValue($this->admin_passwd);\n $loginForm->submit();\n\n $this->assertSession()->elementNotExists('css', '.messages--error');\n }",
"public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\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 login()\n {\n if (isset($_POST['username']) && isset($_POST['password'])) {\n return $this->_check_login();\n }\n return $this->_login_form();\n }",
"public function login()\n {\n /* validation requirement */\n $validator = $this->validation('login', request());\n\n if ($validator->fails()) {\n\n return $this->core->setResponse('error', $validator->messages()->first(), NULL, false , 400 );\n }\n\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n\n return $this->core->setResponse('error', 'Please check your email or password !', NULL, false , 400 );\n }\n\n return $this->respondWithToken($token, 'login');\n }",
"public function doLogin()\n\t{\n\n\t\t$userNameCookie = $this->loginView->getUserNameCookie();\n\t\t$passwordCookie = $this->loginView->getPasswordCookie();\n\n\t\t\n\t\tif(isset($userNameCookie) && isset($passwordCookie))\n\t\t{\n\t\t\t$this->isLoggedIn=$this->authenticate->tryTologin($userNameCookie,$passwordCookie,true);\n\t\t}\n\n\t\t$reqUsername = $this->loginView->getRequestUserName();\n\t\t$reqPass = $this->loginView->getRequestPassword();\n\n\t\tif($this->loginView->userWantsToLogin())\n\t\t{\n\t\t\t$this->isLoggedIn=$this->authenticate->tryTologin($reqUsername,$reqPass);\t\t\t\n\t\t}\n\t\t/* \tSince logout operation requires session variable to be set, after authenticating\n\t\t*\tlogin details, It really should not matter if the message is still 'Bye bye'\n\t\t*/\n\t\telse if(isset($_SESSION['user']) && $this->loginView->userWantsToLogout())\n\t\t{\n\t\t\t\t$this->authenticate->logout();\n\t\t\t\t$this->isLoggedIn = false;\t\t\t\t\n\t\t}\n\t\treturn $this->isLoggedIn;\n\t}",
"public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }",
"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 }",
"private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }",
"public function login()\n {\n if ($this->validate()) {\n return User::setIdentityByAccessToken($this->user_id);\n }\n return false;\n }",
"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}",
"public function doLogin()\n {\n\n //check if all the fields were 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 with the spcific login data\n $userEntity = new User(array('username' => Request::post('username'), 'password' => Request::post('password'), 'email' => null, 'name' => null));\n\n //check if the user exists and get it as entity if exists\n if (!$userEntity = $this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username does not exist!\", \"type\" => \"error\")));\n exit;\n }\n\n //get the user ID from database\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //check if the login credentials are correct for login\n if (!$this->repository->checkLogin($userEntity, Request::post('password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The user/email is incorrect!\", \"type\" => \"error\")));\n exit;\n }\n\n $userEntity->setAttr('access', $this->repository->getAccessByUsername(Request::post('username')));\n\n //set the session using the user data\n $this->session->setSession($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"You successfully logged in!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\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}",
"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}",
"public function login()\n\t{\t\n\t\tif ($this->common->isLoggedIn()) {\n\t\t\t$this->url->redirect('dashboard');\n\t\t}\n\t\tif ($this->commons->validateToken($this->url->post('_token'))){\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t$username = $this->url->post('username');\n\t\t$password = $this->url->post('password');\n\n\t\tif (!$this->validate($username, $password)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\tunset($this->session->data['user_id']);\n\t\tunset($this->session->data['login_token']);\n\t\tunset($this->session->data['role']);\n\n\t\t/*Intiate login Model*/\n\t\t$this->loginModel = new Login();\n\t\t/** \n\t\t* If the user exists\n\t\t* Check his account and login attempts\n\t\t* Get user data \n **/\n\t\tif ($user = $this->loginModel->checkUser($username)) {\n\t\t\t/** \n\t\t\t* User exists now We check if\n\t\t\t* The account is locked From too many login attempts \n **/\n\t\t\tif (!$this->checkLoginAttempts($user['email'])) {\n\t\t\t\t$this->session->data['error'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';\n\t\t\t\t\n\t\t\t\t$this->url->redirect('login');\n\t\t\t}\n\t\t\telse if ($user['status'] === 1) {\n\t /** \n\t * Check if the password in the database matches the password user submitted.\n\t * We are using the password_verify function to avoid timing attacks.\n\t **/\n\t if (password_verify( $password, $user['password'])) {\n\t \t$this->loginModel->deleteAttempt($user['email']);\n\t \t/** \n\t \t* Start session for user create session varible \n\t\t * Create session login string for authentication\n\t\t **/\n\t \t$this->session->data['user_id'] = preg_replace(\"/[^0-9]+/\", \"\", $user['user_id']); \n\t \t$this->session->data['role'] = preg_replace(\"/[^0-9]+/\", \"\", $user['user_role']);\n\t \t$this->session->data['login_token'] = hash('sha512', AUTH_KEY . LOGGED_IN_SALT);\n\t \t$this->url->Redirect('dashboard');\n\t } else {\n\t \t/** \n\t \t* Add login attemt to Db\n\t\t * Redirect back to login page and set error for user\n\t\t **/\n\t \t$this->loginModel->addAttempt($user['email']);\n\t \t$this->session->data['error'] = 'Warning: No match for Username and/or Password.';\n\t \t$this->url->Redirect('login');\n\t }\n\t }\n\t else {\n\t \t/** \n\t \t* If account is disabled by admin \n\t\t * Then Show error to user\n\t\t **/\n\t \t$this->session->data['error'] = 'Warning: Your account has disabled for more info contact us.';\n\t \t$this->url->redirect('login');\n\t }\n\t }\n\t else {\n\t \t/** \n\t * If email address not found in DB \n\t\t * Show error to user for creating account\n\t\t **/\n\t \t$this->session->data['error'] = 'Warning: No match for Username and/or Password.';\n\t \t$this->url->redirect('login');\n\t }\n\t}",
"public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }",
"public function login(){\n\t\t// if already logged-in then redirect to index\n\t\tif($this->Session->check('Auth.User')){\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\n\t\t// if we got a post information, try to authenticate\n\t\tif($this->request->is('post')){\n\t\t\t// do login\n\t\t\tif($this->Auth->login()){\n\t\t\t\t// login successful\n\t\t\t\t$this->Session->setFlash(__('Welcome, ' . $this->Auth->user('username')));\n\t\t\t\t$this->redirect($this->Auth->redirectUrl());\n\t\t\t} else {\n\t\t\t\t// login fail\n\t\t\t\t$this->Session->setFlash(__('Invalid username and password'));\n\t\t\t}\n\t\t}\n\t}",
"public function login() {\n return $this->run('login', array());\n }",
"public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }",
"private function auto_login()\n {\n if ($this->_cookies->has('authautologin')) {\n $cookieToken = $this->_cookies->get('authautologin')->getValue();\n\n // Load the token\n $token = Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $cookieToken)));\n\n // If the token exists\n if ($token) {\n // Load the user and his roles\n $user = $token->getUser();\n $roles = $this->get_roles($user);\n\n // If user has login role and tokens match, perform a login\n if (isset($roles['registered']) && $token->user_agent === sha1(\\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent())) {\n // Save the token to create a new unique token\n $token->token = $this->create_token();\n $token->save();\n\n // Set the new token\n $this->_cookies->set('authautologin', $token->token, $token->expires);\n\n // Finish the login\n $this->complete_login($user);\n\n // Regenerate session_id\n session_regenerate_id();\n\n // Store user in session\n $this->_session->set($this->_config['session_key'], $user);\n // Store user's roles in session\n if ($this->_config['session_roles']) {\n $this->_session->set($this->_config['session_roles'], $roles);\n }\n\n // Automatic login was successful\n return $user;\n }\n\n // Token is invalid\n $token->delete();\n } else {\n $this->_cookies->set('authautologin', \"\", time() - 3600);\n $this->_cookies->delete('authautologin');\n }\n }\n\n return false;\n }",
"public function login() {\n\t\t/* if($this->Session->check('Auth.User')){\n\t\t\t$this->redirect(array('action' => 'home'));\t\n\t\t\t\t\t\n\t\t} */\n\t\t\n\t\t// if we get the post information, try to authenticate\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\t$this->Session->setFlash(__('Welcome, '. $this->Auth->user('username')));\n\t\t\t\t//$this->redirect($this->Auth->redirectUrl());\n\t\t\t\t$this->User->id = $this->Auth->user('id'); // target correct record\n\t\t\t\t$this->User->saveField('last_login_time', date(DATE_ATOM)); // save login time\n\t\t\t\t\n\t\t\t\t$this->redirect(array('action' => 'home'));\t\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Invalid username or password');\n\t\t\t}\n\t\t}\n\n\t}",
"public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n }\n else {\n return false;\n }\n }",
"public function login()\n {\n }",
"public function login()\n {\n }",
"public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\n\t\t\t// If no parameter passed to login(), CakePHP automatically give the request params as parameters.\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\treturn $this->redirect($this->Auth->redirectUrl());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->set('signInFail', true); // view vars\n\t\t\t}\n\t\t}\n\t}",
"public function login()\n {\n $formLoginEnabled = true;\n $this->set('formLoginEnabled', $formLoginEnabled);\n\n $this->request->allowMethod(['get', 'post']);\n $result = $this->Authentication->getResult();\n // regardless of POST or GET, redirect if user is logged in\n if ($result->isValid()) {\n // redirect to /users after login success\n // TODO: redirect to /users/profile after login success [cakephp 2.x -> 4.x migration]\n $redirect = $this->request->getQuery('redirect', [\n 'controller' => 'Admin',\n 'action' => 'users/index', \n ]);\n\n return $this->redirect($redirect);\n }\n // display error if user submitted and authentication failed\n if ($this->request->is('post') && !$result->isValid()) {\n $this->Flash->error(__('Invalid username or password'));\n }\n }",
"public function login() {\n $db = Db::getInstance();\n $user = new User($db);\n\n// preventing double submitting\n $token = self::setSubmitToken();\n\n// if user is already logged in redirect him to gallery\n if( $user->is_logged_in() ){\n call('posts', 'index');\n } else {\n// otherwise show login form\n require_once('views/login/index.php');\n// and refresh navigation (Login/Logout)\n require('views/navigation.php');\n }\n }",
"private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}",
"public function attemptLogin($token);",
"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 }",
"function trylogin()\n {\n\t\t$ret = false;\n\t\t\n $err = SHIN_Core::$_models['sys_user_model']->login();\n\n SHIN_Core::$_language->load('app', 'en');\n $err = SHIN_Core::$_language->line($err);\n\t\t\n if ($err != '') {\n SHIN_Core::$_libs['session']->set_userdata('loginErrorMessage', $err);\n } else {\n $this->sessionModel->start(SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\t$ret = true;\n\t\t\t\n\t\t\t// addons for new field added //////////////////////////\n\t\t\t// request by Stefano. Detail: http://binary-studio.office-on-the.net/issues/5287\n\t\t\t// \"host\" and \"lastlogin\" field \n\t\t\t$data = array('lastlogin' => date('Y-m-d H:i:s'), 'host' => SHIN_Core::$_input->ip_address());\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idUser', SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->update('sys_user', $data); \t\t\n\t\t\t///////////////////////////////////////////////////////\n }\n\n\t\treturn $ret;\n }",
"public function loginUser()\n {\n $validate = $this->loginValidator->validate();\n $user = $this->userRepository->getUserWithEmail($validate[\"email\"]);\n\n if ($this->userCorrect($validate, $user)) {\n $user['api_token'] = $this->getToken();\n $user->save();\n\n return $this->successResponse('user', $user, 200)\n ->header('Token', $user['api_token']);\n }\n }",
"public function login()\n {\n if (!empty($_SESSION['user_id'])) {\n return redirect()->to('/');\n }\n // Working with form data if POST request\n if ($this->request->getPost()) {\n $data = $this->request->getPost();\n $validation = Services::validation();\n $validation->setRules(\n [\n 'password' => 'required|min_length[6]',\n 'email' => 'required',\n ]\n );\n // Checking reCAPTCHA\n if (empty($data['g-recaptcha-response'])) {\n $validation->setError('g-recaptcha-response', 'Please activate recaptcha');\n return $this->renderPage('login', $validation->listErrors());\n }\n // Data validation\n if ($validation->withRequest($this->request)->run()) {\n unset($data['g-recaptcha-response']);\n $result = User::checkUser($data);\n // Logging in if user with such data exists\n if ($result) {\n $_SESSION['user_id'] = $result;\n return redirect()->to('/');\n } else {\n $validation->setError('email', 'Invalid parameters');\n return $this->renderPage('login', $validation->listErrors());\n }\n } else {\n // Data validation fails, return with validation errors\n return $this->renderPage('login', $validation->listErrors());\n }\n } else {\n // Render page if GET request\n return $this->renderPage('login');\n }\n }",
"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() {\n if ($this->validate()) {\n $this->setToken();\n return Yii::$app->user->login($this->getUser()/* , $this->rememberMe ? 3600 * 24 * 30 : 0 */);\n } else {\n return false;\n }\n }",
"function loginAttempt ($f3) {\n\t\t$loginType = (preg_match(\"/([^.@]+)(\\.[^.@]+)*@([^.@]+\\.)+([^.@]+)/\", $f3->get('POST.user'))) ? \"cemail3\" : \"cid\";\n\n\t\t$user=new DB\\SQL\\Mapper($f3->get('DB'),'ef_users');\n\t\t\n\t\tif ( $user->load(array('email=?',$f3->get('POST.user'))) ) {\n\t\t\tif ($user->email_confirmed == 0) {\n\t\t\t\t$f3->set('error', '\n\t\t\t\t\tDid you check your inbox?<br />\n\t\t\t\t\t<a style=\"font-size: 12px; padding-top:10px;\"\" href=\"login\">\n\t\t\t\t\t\tYou must confirm your email before login.\n\t\t\t\t\t</a><br/>\n\t\t\t\t');\n\n\t\t\t\techo Template::instance()->render('login.html');\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$rest = new restCall('\n\t\t\t{\n\t\t\t\t\"proc\": \"customer\",\n\t\t\t\t\"request\": {\n\t\t\t\t\t\"'.$loginType.'\": \"'.str_pad($f3->get('POST.user'), 8, \"0\", STR_PAD_LEFT).'\"\n\t\t\t\t}\n\t\t\t}\n\t\t');\n\n\t\t// Check for existence of customer and password match. \n\n\t\tif(isset($rest->result['cid'])) {\n\n\t\t\tif ($rest->result['opass'] == $f3->get('POST.pass')) {\n\n\t\t\t\t$f3->set('SESSION.user_info', $rest->result);\n\t\t\t\t$f3->reroute(\"/my-leagues\");\n\n\t\t\t} else {\n\t\t\t\t$f3->set('error', '\n\t\t\t\t\t<a style=\"font-size: 11px; padding-top:10px;\"\" href=\"login\">\n\t\t\t\t\t\tThis username/password isnt right.\n\t\t\t\t\t</a><br/>\n\t\t\t\t');\n\t\t\t}\n\n\t\t} \n\n\t\t\n\n\t\techo Template::instance()->render('login.html');\n\t}",
"public function login()\n {\n self::$facebook = new \\Facebook(array(\n 'appId' => $this->applicationData[0],\n 'secret' => $this->applicationData[1],\n ));\n\n $user = self::$facebook->getUser();\n if (empty($user) && empty($_GET[\"state\"])) {\n \\Cx\\Core\\Csrf\\Controller\\Csrf::header('Location: ' . self::$facebook->getLoginUrl(array('scope' => self::$permissions)));\n exit;\n }\n\n self::$userdata = $this->getUserData();\n $this->getContrexxUser($user);\n }",
"public function log_in()\n\t{\n\t\tif( isset( $_POST['user_login'] ) && wp_verify_nonce( $_POST['login_nonce'], 'login-nonce') ) \n\t\t{\n\t\t\t/** Error when no password enter */\n\t\t\tif( ! isset( $_POST['user_pass']) || $_POST['user_pass'] == '') {\n\t\t\t\t$this->system_message['error'][] = __('Please enter a password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \t\t\n\t\t\t// this returns the user ID and other info from the user name\n\t\t\t$user = get_user_by('login', $_POST['user_login'] );\n \n\t\t\tif( ! $user ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t\treturn false;\n\t\t\t}\n\t \n\t\t\t// check the user's login with their password\n\t\t\tif( ! wp_check_password( $_POST['user_pass'], $user->user_pass, $user->ID) ) {\n\t\t\t\t// if the password is incorrect for the specified user\n\t\t\t\t$this->system_message['error'][] = __('Invalid ID or password');\n\t\t\t}\n\t \n\t\t\t// only log the user in if there are no errors\n\t\t\tif( empty( $this->system_message['error'] )) \n\t\t\t{\n\t\t\t\twp_set_auth_cookie( $user->ID, false, true );\n\t\t\t\twp_set_current_user( $user->ID );\t\n\t\t\t\tdo_action('wp_login', $_POST['user_login']);\n\t \n\t\t\t\twp_redirect( home_url() ); exit;\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.8041084",
"0.77819216",
"0.7772398",
"0.77598476",
"0.77309424",
"0.77141815",
"0.7709712",
"0.7697268",
"0.7628049",
"0.76142603",
"0.76135373",
"0.76091796",
"0.7588018",
"0.7561892",
"0.7548732",
"0.7545111",
"0.7526027",
"0.7510918",
"0.749527",
"0.7487664",
"0.7478204",
"0.7478204",
"0.74774396",
"0.7466208",
"0.74596703",
"0.74560434",
"0.7430074",
"0.7419188",
"0.7417967",
"0.7407612",
"0.74069256",
"0.74050415",
"0.7401198",
"0.73999214",
"0.73895764",
"0.738857",
"0.73732424",
"0.7367153",
"0.7364602",
"0.7356671",
"0.7354804",
"0.73333514",
"0.7323467",
"0.73072875",
"0.7302246",
"0.7298503",
"0.72957325",
"0.7290846",
"0.7261294",
"0.7247425",
"0.7244748",
"0.7244383",
"0.7243948",
"0.7243065",
"0.72371745",
"0.7235256",
"0.7208444",
"0.7197011",
"0.71936405",
"0.71906704",
"0.7186608",
"0.7185782",
"0.7180789",
"0.7176274",
"0.71747375",
"0.71742046",
"0.7161863",
"0.71381414",
"0.7137706",
"0.71360743",
"0.71206313",
"0.7119734",
"0.71136934",
"0.7110604",
"0.71085614",
"0.71073",
"0.71060884",
"0.7101564",
"0.70955205",
"0.7093958",
"0.7092335",
"0.7081939",
"0.7074969",
"0.7068904",
"0.7065325",
"0.7064326",
"0.7064326",
"0.7062432",
"0.70592654",
"0.7052954",
"0.70477283",
"0.7041438",
"0.7038453",
"0.70366305",
"0.7036617",
"0.70312095",
"0.7025144",
"0.7021617",
"0.7015222",
"0.7007636",
"0.7005608"
] | 0.0 | -1 |
Creates a HTTP client instance. | private static function createClient(array $configs)
{
return new Client($configs['api_key'], $configs['endpoint']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createHttpClient()\n {\n $stack = HandlerStack::create();\n\n $middleware = new Oauth1([\n 'consumer_key' => $this->consumerKey,\n 'consumer_secret' => $this->consumerSecret,\n 'token' => $this->token,\n 'token_secret' => $this->tokenSecret\n ]);\n\n $stack->push($middleware);\n\n $client = new HttpClient([\n 'handler' => $stack\n ]);\n\n return $this->setHttpClient($client);\n }",
"protected function http()\n {\n return new Client;\n }",
"protected function constructHttpClient()\n {\n $hasHttpClient = (null !== $this->httpClient);\n $this->httpClient = new HttpClient($this->getOptions());\n if (! $hasHttpClient) {\n $this->httpClient->registerDefaults();\n }\n }",
"protected function http(){\n\n if( empty($this->HTTPClient) ){\n\n //init stack\n $stack = HandlerStack::create();\n\n if ( $this->token ){\n\n //setup to send the token with each request\n\n $this->addHeader(Headers::AUTHORIZATION, ( \"TOKEN \" . $this->token->getValue() ) );\n\n }\n else{\n\n //setup client to send signed requests\n\n $signer = new Signer(Settings::PROVIDER);\n $middleware = new Middleware($signer, $this->cfg->getKey(), $this->cfg->getSecret());\n\n $stack->push($middleware);\n\n }\n\n //enable debug\n if( $logger = $this->cfg->getLogger() )\n $this->pushRequestLogger($logger, $stack);\n\n //create the client\n $this->HTTPClient = new HTTPClient([\n 'headers' => &$this->headers,\n 'timeout' => $this->cfg->getRequestTimeout(),\n 'handler' => $stack\n ]);\n\n return $this->HTTPClient;\n\n }\n\n return $this->HTTPClient;\n\n }",
"protected function getHttp()\n\t{\n\t\treturn new \\Guzzle\\Http\\Client;\n\t}",
"protected function createClient()\n\t{\n\t\treturn new Client($this->app);\n\t}",
"protected function createClient($config)\n {\n return new HttpClient($config);\n }",
"protected function httpClient()\n {\n return new Client([\n 'base_uri' => $this->baseUri(),\n 'timeout' => 10.0,\n 'stream' => false,\n 'headers' => $this->defaultHeaders(),\n 'debug' => false,\n ]);\n }",
"protected static function getHttpClient()\n\t{\n\t\tif (!isset(self::$client))\n\t\t{\n\t\t\tself::$client = Http::getClient();\n\t\t}\n\t\tself::$client->timeout = 10;\n\n\t\treturn self::$client;\n\t}",
"public function createHttpClient(): GuzzleClient\n {\n return new GuzzleClient([\n 'verify' => false,\n 'default' => ['headers' => ['Accept' => 'application/json']],\n ]);\n }",
"private function initiateHttpClient()\n {\n $options = [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/json',\n 'Authorization' => $this->apiKey,\n ]\n ];\n\n $this->httpClient = new GuzzleClient(array_replace_recursive($this->clientOptions, $options));\n }",
"protected function createHttpClient(){\n \t\n\t\trequire_once(INSTALL_PATH.\"/server/classes/class.HttpClient.php\");\n\t\t$httpClient = new HttpClient($this->host);\n\t\t$httpClient->cookie_host = $this->host;\n\t\t$httpClient->timeout = 50;\n\t\tAJXP_Logger::debug(\"Creating Http client\", array());\n\t\t//$httpClient->setDebug(true);\n\t\tif(!$this->use_auth){\n\t\t\treturn $httpClient;\n\t\t}\n\t\t\n\t\t$uri = \"\";\n\t\tif($this->auth_path != \"\"){\n\t\t\t$httpClient->setAuthorization($this->user, $this->password);\t\t\t\n\t\t\t$uri = $this->auth_path;\n\t\t}\n\t\tif(!isSet($_SESSION[\"AJXP_REMOTE_SESSION\"])){\t\t\n\t\t\tif($uri == \"\"){\n\t\t\t\t// Retrieve a seed!\n\t\t\t\t$httpClient->get($this->path.\"?get_action=get_seed\");\n\t\t\t\t$seed = $httpClient->getContent();\n\t\t\t\t$user = $this->user;\n\t\t\t\t$pass = $this->password;\n\t\t\t\t$pass = md5(md5($pass).$seed);\n\t\t\t\t$uri = $this->path.\"?get_action=login&userid=\".$user.\"&password=\".$pass.\"&login_seed=$seed\";\n\t\t\t}\n\t\t\t$httpClient->setHeadersOnly(true);\n\t\t\t$httpClient->get($uri);\n\t\t\t$httpClient->setHeadersOnly(false);\n\t\t\t$cookies = $httpClient->getCookies();\t\t\n\t\t\tif(isSet($cookies[\"AjaXplorer\"])){\n\t\t\t\t$_SESSION[\"AJXP_REMOTE_SESSION\"] = $cookies[\"AjaXplorer\"];\n\t\t\t\t$remoteSessionId = $cookies[\"AjaXplorer\"];\n\t\t\t}\n\t\t}else{\n\t\t\t$remoteSessionId = $_SESSION[\"AJXP_REMOTE_SESSION\"];\n\t\t\t$httpClient->setCookies(array(\"AjaXplorer\"=>$remoteSessionId));\n\t\t}\n\t\tAJXP_Logger::debug(\"Http Client created\", array());\n\t\treturn $httpClient; \t\n }",
"protected function build() \n {\n $client = new Zend_Http_Client();\n $config = array('timeout' => 60);\n $client->setConfig($config);\n $client\n ->setUri($this->getEndpoint())\n ->setMethod($this->getMethod())\n ->setHeaders($this->getHeaders());\n\n return $client;\n }",
"protected function getHttpClient()\n {\n return new Client([\n 'timeout' => $this->timeout\n ]);\n }",
"private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }",
"public function http()\n {\n if (!$this->http) {\n $this->http = new GuzzleClient([\n 'base_uri' => $this->baseUri(),\n ]);\n }\n\n return $this->http;\n }",
"public function getHttp()\n\t{\n\t\t$client = new \\Guzzle\\Http\\Client;\n\n\t\t$client->setSslVerification(false, false, false);\n\n\t\treturn $client;\n\t}",
"static private function setHTTPClient() {\n self::$handler = new \\GuzzleHttp\\Handler\\CurlMultiHandler();\n self::$http = new \\GuzzleHttp\\Client(array(\n 'handler' => \\GuzzleHttp\\HandlerStack::create(self::$handler)\n ));\n }",
"protected function _make_client()\n\t{\n\t\tif (is_null($this->_client))\n\t\t{\n\t\t\trequire_once APPPATH.'libraries/nusoap/nusoap.php';\n\t\t\t\t\n\t\t\t$this->_client = new nusoap_client($this->_url, 'wsdl', '', '', '', '');\n\t\t}\n\t\t\n\t\treturn $this->_client;\n\t}",
"private function getClient()\n {\n return new \\GuzzleHttp\\Client([\n 'base_uri' => $this->url,\n 'timeout' => 2.0,\n ]);\n }",
"public function createClient(){\n\t\t$client = new Client(array(\n\t\t\t'servers' => array(\n\t\t\t\tarray('host' => HOST_ES_001, 'port' => PORT_ES_001),\n\t\t\t\tarray('host' => HOST_ES_002, 'port' => PORT_ES_002)\n\t\t\t)\n\t\t));\n\t\treturn $client;\n\t}",
"public function __construct()\n {\n $this->httpClient = new HttpClient();\n }",
"private function initializeClient()\n {\n $this->client = new Client($this->guzzleConfig);\n\n if ($this->isInDebugMode()) {\n $this->setDebugger();\n }\n if ($this->needsAuthentication()) {\n $this->authenticate();\n }\n\n return $this->client;\n }",
"final protected function getHttpClient(): Client\n {\n $this->httpClient = new Client([\n 'handler' => HandlerStack::create($this->getMockHandler()),\n ]);\n\n return $this->httpClient;\n }",
"private function httpClient()\n {\n if (!self::$httpClient) {\n /**\n * @todo Replce CurlClient with new Guzzle client\n */\n self::$httpClient = GuzzleClient::instance();\n }\n return self::$httpClient;\n }",
"protected function createHttpClient($url)\n {\n $client = $this->httpService->createClient($url);\n\n // Set timeout value\n $timeout = isset($this->config['Catalog']['http_timeout'])\n ? $this->config['Catalog']['http_timeout'] : 30;\n $client->setOptions(\n ['timeout' => $timeout, 'useragent' => 'VuFind', 'keepalive' => true]\n );\n\n // Set Accept header\n $client->getRequest()->getHeaders()->addHeaderLine(\n 'Accept', 'application/json'\n );\n\n return $client;\n }",
"protected function getHttpClient()\n {\n if (!is_null($this->httpClient)) {\n\n return $this->httpClient;\n }\n $stack = GuzzleHttp\\HandlerStack::create();\n if ($this->logger instanceof LoggerInterface) {\n $stack->push(GuzzleHttp\\Middleware::log(\n $this->logger,\n new GuzzleHttp\\MessageFormatter(GuzzleHttp\\MessageFormatter::DEBUG)\n ));\n }\n $this->httpClient = new GuzzleHttp\\Client([\n 'handler' => $stack,\n ]);\n\n return $this->httpClient;\n }",
"public static function create(ContainerInterface $container) {\n return new static($container->get('http_client'));\n }",
"protected function getHttpClient()\n {\n if ($this->httpClient === null) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }",
"public function get() {\n $config = [\n 'base_uri' => 'https://example.com',\n ];\n\n $client = new Client($config);\n\n return $client;\n }",
"protected function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }",
"protected function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }",
"protected function getHttpClient()\n {\n if (is_null($this->httpClient)) {\n $this->httpClient = new Client($this->guzzle);\n }\n\n return $this->httpClient;\n }",
"public function client()\n {\n return new Client(['headers' => ['X-API-Key' => 'd4e47a6b49cdacb0524c12cfd5a3cadb9c102522', ]]);\n }",
"protected function initializeClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n $options = [\n 'base_uri' => static::$baseUrl,\n 'http_errors' => true,\n 'headers' => [\n 'Content-Type' => 'text/xml',\n ],\n ];\n\n return $this->client = new Client($options);\n }",
"public function buildClient()\n {\n return new GuzzleClient([\n 'base_uri' => $this->apiPath(),\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'X-TrackerToken' => $this->getToken()\n ]\n ]);\n }",
"private function getHttpClient()\n {\n if (empty($this->httpClient)) {\n $this->httpClient = $this->httpClientFactory->createForShopifyApi($this->shop);\n }\n\n return $this->httpClient;\n }",
"public function getHttpClient();",
"protected function getDefaultHttpClient()\n {\n return new Client();\n }",
"public function getHttpClient(): ClientInterface;",
"public function getHttpClient() {\n\t\tif(is_null($this->_httpClient)) {\n\t\t\trequire_once 'Zend/Http/Client.php';\n\t\t\t$this->_httpClient = new Zend_Http_Client();\n\t\t}\n\t\treturn $this->_httpClient;\n\t}",
"public function __construct()\n {\n $this->httpClient = new Client(['handler' => $this->setHandler(self::$connection->getAuthorizationToken())]);\n }",
"public function __construct(ClientInterface $http_client) {\n $this->httpClient = $http_client;\n }",
"protected function _getClient()\n {\n $client = new Zend_Http_Client();\n $client->setUri($this->getGatewayUrl())\n ->setConfig(array('maxredirects' => self::REQUEST_MAX_REDIRECTS, 'timeout' => self::REQUEST_TIMEOUT))\n ->setParameterGet('API', $this->getApiCode())\n ->setParameterGet('XML', $this->asXml());\n return $client;\n }",
"public function getHttpClient(): HttpClient\n {\n $plugins = [\n new AuthenticationPlugin(\n new BasicAuth($this->getApiKey(), '')\n )\n ];\n\n return new PluginClient(\n $this->httpClient,\n $plugins\n );\n }",
"protected function createAuthenticatedClient()\n {\n $client = static::createClient();\n\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => 'myphone',\n '_password' => 'phono'\n )\n );\n\n $data = json_decode($client->getResponse()->getContent(), true);\n\n $client = static::createClient();\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n return $client;\n }",
"protected function initialHttpClient()\n {\n $this->client = new Client();\n }",
"public function getClient(): Client\n {\n return new Client([\n 'http_errors' => false,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n 'handler' => $this->handlerStack,\n ]);\n }",
"public function createClient($options)\n {\n return new CurlClient($options['host'], $options['port'], $options['user'], $options['password']);\n }",
"public function getHttpClient(): Client\n {\n return $this->httpClient;\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->httpClient = new Client([\n 'base_uri' => config('app.url'),\n 'headers' => [\n 'Authorization' => $this->apiKey,\n ],\n ]);\n }",
"protected function initializeClient() : self {\n $this->client = new GuzzleClient([\n 'headers' => [\n 'Accept' => 'application/json',\n 'Accept-Encoding' => 'gzip, deflate',\n 'Cache-Control' => 'max-age=0',\n 'User-Agent' => sprintf('FreedomCore Media/%s Jackett Client', env('APP_VERSION'))\n ],\n 'timeout' => $this->timeout,\n 'allow_redirects' => [\n 'max' => $this->maxRedirects,\n ],\n 'debug' => $this->debug\n ]);\n return $this;\n }",
"private function createHttpClient(): Client\n {\n if (null === $this->configuration->getSecurityToken()) {\n throw new MissingCredentialException('Security Token is not set or empty');\n }\n\n $this->addHeader('SECURITY_TOKEN', $this->configuration->getSecurityToken());\n\n return new Client([\n 'base_uri' => $this->configuration->getBaseUrl(),\n 'headers' => $this->getHeaders() \n ]);\n }",
"protected function getClient()\n {\n if ($this->_guzzle == null) {\n $this->_guzzle = new HttpClient();\n }\n return $this->_guzzle;\n }",
"public static function client(){\n\t\tif(!self::$client){\n\t\t\tself::$client = new self();\n\t\t}\n\t\treturn self::$client;\n\t}",
"private function getClient()\n {\n if ($this->client) {\n return $this->client;\n }\n\n return new Client();\n }",
"public static function getHttpClient() {\n\t\tif (!self::$_httpClient instanceof Zend_Http_Client_Abstract)\n\t\t{\n\t\t\tself::$_httpClient = new Zend_Http_Client();\n\t\t}\n\n\t\treturn self::$_httpClient;\n\t}",
"public function getHttpClient()\n {\n // @codeCoverageIgnoreStart\n if (!$this->httpClient) {\n // Detect PHP HTTPlug async HTTP client support\n $client = HttpAsyncClientDiscovery::find();\n if ($client) {\n $this->httpClient = HTTPlugClient::getInstance();\n } elseif (interface_exists(ClientInterface::class)\n && version_compare(\n \\GuzzleHttp\\ClientInterface::VERSION,\n '6.0.0',\n '>='\n )) {\n $this->httpClient = GuzzleClient::getInstance();\n } else {\n $this->httpClient = CurlClient::getInstance();\n }\n }\n // @codeCoverageIgnoreEnd\n\n return $this->httpClient;\n }",
"public static function getHttpClient()\n {\n if (!self::$_httpClient instanceof Zend_Http_Client) {\n /**\n * @see Zend_Http_Client\n */\n require_once 'Zend/Http/Client.php';\n self::$_httpClient = new Zend_Http_Client();\n }\n\n return self::$_httpClient;\n }",
"public function getClient()\n {\n if ($this->http === null) {\n $this->http = $this->initClient();\n }\n return $this->http;\n }",
"public function __construct()\n {\n parent::setup();\n\n $this->client = new Client([\n \"base_uri\" => self::URL\n ]);\n }",
"protected function initClient()\n {\n $client = new SoapClient(\n $this->wsdlUrl,\n [\n 'soap_version' => SOAP_1_2,\n 'trace' => true,\n 'exceptions' => true\n ]\n );\n\n $actionHeader = new SoapHeader(\n 'http://www.w3.org/2005/08/addressing',\n 'Action',\n 'http://moreum.com/terradocs/webservices/IArchival/ArchiveDocument'\n );\n $client->__setSoapHeaders($actionHeader);\n\n return $client;\n }",
"private function getClient()\n {\n return new Client([\n 'base_uri' => $this->apiUrl,\n 'headers' => [\n 'Accept' => 'application/vnd.Creative Force.v2.1+json',\n 'x-api-key' => $this->apiKey,\n ],\n 'http_errors' => false,\n ]);\n }",
"abstract public function getHttpClient();",
"public function getClient()\n {\n if ($this->_client === null) {\n\n if (!$this->_apiEndPoint) {\n throw new Exception('Api endpoint is not configured.');\n }\n\n $this->_client = new Varien_Http_Client($this->_apiEndPoint);\n $this->_client->setHeaders(array('Content-Type: text/xml'));\n $this->_client->setConfig(array('timeout' => 45));\n }\n\n return $this->_client;\n }",
"public function __construct()\n {\n $this->client = new Client();\n }",
"protected function newClient()\n {\n $config = config('elasticquent')['config'];\n if (class_exists('\\Elasticsearch\\ClientBuilder')) {\n return \\Elasticsearch\\ClientBuilder::fromConfig($config);\n }\n return new Client($this->connection());\n }",
"public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('app.url'),\n ]);\n }",
"public function __construct()\n {\n parent::__construct();\n $this->httpClient = new Client();\n }",
"protected function getHttpClient()\n\t{\n\t\treturn $this->httpClient;\n\t}",
"public function getHttpClient()\n {\n\n return $this->httpClient;\n }",
"public function getClient()\r\n {\r\n if ($this->client == null) {\r\n $this->client = new Client();\r\n $this->client->setHeader('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:21.0) Gecko/20100101 Firefox/21.0');\r\n }\r\n return $this->client;\r\n }",
"public function getHttpClient()\n {\n return $this->httpClient;\n }",
"public function getHttpClient()\n {\n return $this->httpClient;\n }",
"protected function getClient()\n {\n return $this->httpClient;\n }",
"protected static function makeClient(string $version)\n {\n return new Client([\n 'base_uri' => 'https://api.'.static::domain().'/v'.$version.'/',\n 'headers' => [\n 'Accept' => 'application/json',\n 'User-Agent' => '',\n ],\n ]);\n }",
"public function createClient(): Client;",
"public function initHttpClients()\n {\n $clientConfig = $this->config->getHttpClientConfig();\n $authClient = new HttpClient($clientConfig);\n $this->setAuthHttpClient($authClient);\n\n $clientConfig['handler'] = $this->initHandlerStack();\n $client = new HttpClient($clientConfig);\n $this->setHttpClient($client);\n }",
"public function getHttpClient()\n {\n return $this->_httpClient;\n }",
"public function getHttpClient()\n {\n return $this->_httpClient;\n }",
"protected static function createClient()\n {\n $log = new Logger('debug');\n $client = new Google_Client();\n $client->setApplicationName(self::APPLICATION_NAME);\n $client->useApplicationDefaultCredentials();\n $client->addScope('https://www.googleapis.com/auth/drive');\n $client->setLogger($log);\n return $client;\n }",
"function __construct() {\n\t\t//$this->httpClient = $this->client->getHttpClient();\n\t\t$this->httpClient = new GuzzleClient([\n\t\t\t'base_uri' => $this->base,\n\t\t\t'proxy' => '',\n\t\t]);\n\n\t\t//$hc = $this->httpClient;\n\t\t$hc = new AdapterClient($this->httpClient);\n\n\t\t$this->client = GithubClient::createWithHttpClient(\n\t\t\tnew\tHttpMethodsClient($hc,\n\t\t\t\tMessageFactoryDiscovery::find()\n\t\t\t)\n\t\t);\n\t}",
"protected function getGuzzleClient() {\n\n $headerMiddleware = function (RequestInterface $request) {\n return $request\n ->withHeader('Authorization', 'Bearer ' . $this->getApiKey())\n ->withHeader('Content-type', 'application/json');\n };\n $headerMiddleware->bindTo($this);\n\n $stack = new HandlerStack();\n $stack->setHandler(new CurlHandler());\n $stack->push(Middleware::mapRequest($headerMiddleware));\n\n $client = new GuzzleHttpClient([\n 'base_uri' => self::BASE_URL,\n 'handler' => $stack,\n ]);\n\n return $client;\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->httpClient = new GuzzleHttpClient();\n }",
"private function getGuzzleClient()\n {\n if (null === $this->guzzleClient) {\n $this->guzzleClient = new \\GuzzleHttp\\Client([\n 'base_uri' => self::BASE_URL,\n 'timeout' => 5,\n ]);\n }\n\n return $this->guzzleClient;\n }",
"public function getClient()\n {\n if (!$this->client) {\n $this->client = $this->createClient();\n $this->client->addCache($this->cachePool);\n }\n\n return $this->client;\n }",
"public function __construct(array $config)\n {\n $this->config = $config;\n\n $this->http_client = new Client([\n 'allow_redirects' => true,\n 'timeout' => 15,\n 'debug' => false,\n 'http_errors' => false\n ]);\n }",
"protected function createClient()\n {\n $oauthClient = $this->getMockBuilder(BaseClient::className())\n ->setMethods(['initUserAttributes'])\n ->getMock();\n return $oauthClient;\n }",
"public function __construct()\n {\n\n $this->referer = 'https://www.google.com';\n\n $this->webClient = new Client(array(\n 'headers' => ['User-Agent' => UserAgentFacade::random(),\n 'Referer' => $this->referer,\n 'Accept-Encoding' => 'gzip, deflate',\n 'Accept' => 'text/html,application/xhtml+xml,application/xml'\n ]\n ));\n }",
"protected function getClient($url)\n {\n if (!class_exists('Guzzle\\\\Http\\\\Client')) {\n throw new OpauthException('Guzzle 3 not installed. Install or use other http_client');\n }\n $client = new Client($url);\n $client->setUserAgent($this->userAgent);\n return $client;\n }",
"public function getClient()\n\t{\n\t\treturn new Client([\n\t\t\t'headers' => [\n\t\t\t\t'Authorization' => 'ZXWS ' . $this->connect_id . ':' . $this->getSignature(),\n\t\t\t\t'Date' => $this->timestamp,\n\t\t\t\t'nonce' => $this->nonce\n\t\t\t]\n\t\t]);\n\t}",
"public function __construct()\n {\n $this->client = GuzzleFactory::make([\n 'base_uri' => 'https://min-api.cryptocompare.com/',\n ]);\n }",
"protected function guzzle(array $config)\n {\n return new HttpClient(Arr::add(\n $config['guzzle'] ?? [],\n 'connect_timeout',\n 60\n ));\n }",
"protected function getHttpClient(): ClientInterface\n {\n return $this->client;\n }",
"public function __construct(HttpClient $http)\n {\n $this->http = $http;\n }",
"public function __construct(HttpClient $http)\n {\n $this->http = $http;\n }",
"public function __construct(HttpClient $http)\n {\n $this->http = $http;\n }",
"public function __construct(HttpClient $http)\n {\n $this->http = $http;\n }",
"public function __construct()\n { \n //New GuzzleHttp Client\n $this->http_client= new \\GuzzleHttp\\Client([\n 'base_uri' => 'http://127.0.0.1:8000'\n ]);\n\n\n //INITIALIZE Request Path\n $this->request_path= '/api';\n\n //INITIALIZE Request Body\n $this->request_body= [];\n\n }",
"public function __construct()\n {\n $this->client = new Client(['base_uri' => 'http://192.168.43.75:8888/apex/obe/']);\n }",
"protected function createGuzzleClient(array $config) {\n $client = new Client($config);\n return new GuzzleClient($client, $this->loadServiceDescription($config));\n }"
] | [
"0.78919286",
"0.75736254",
"0.75091976",
"0.74694526",
"0.7462994",
"0.7448011",
"0.74359226",
"0.7368756",
"0.7222828",
"0.71914047",
"0.7151726",
"0.71417373",
"0.7137571",
"0.71261",
"0.7101699",
"0.71003145",
"0.70142365",
"0.6986139",
"0.69821954",
"0.6976581",
"0.6939241",
"0.68760836",
"0.68749416",
"0.684482",
"0.68433434",
"0.6831333",
"0.68243116",
"0.6819563",
"0.67939436",
"0.67908597",
"0.6787554",
"0.6787554",
"0.6787554",
"0.67604816",
"0.67496186",
"0.6735491",
"0.67132944",
"0.6668316",
"0.66673243",
"0.66484416",
"0.6601018",
"0.65818113",
"0.6577999",
"0.65700287",
"0.65594923",
"0.6557989",
"0.65565306",
"0.6556092",
"0.6545955",
"0.6534111",
"0.65290093",
"0.6525283",
"0.6522135",
"0.6517762",
"0.6502905",
"0.6485757",
"0.6467169",
"0.64610326",
"0.64548916",
"0.64475137",
"0.64257234",
"0.6404334",
"0.6388538",
"0.6374695",
"0.6363749",
"0.6348562",
"0.6346724",
"0.6346188",
"0.6345995",
"0.6330026",
"0.63264686",
"0.6326456",
"0.63257164",
"0.63257164",
"0.62866366",
"0.6280325",
"0.62715393",
"0.62652576",
"0.62523633",
"0.62523633",
"0.6252035",
"0.62469065",
"0.6242563",
"0.62395304",
"0.62216175",
"0.62126863",
"0.61961293",
"0.61707014",
"0.61624104",
"0.61603695",
"0.6156271",
"0.6152849",
"0.6149476",
"0.6139262",
"0.6137555",
"0.6137555",
"0.6137555",
"0.6137555",
"0.6133434",
"0.6128447",
"0.61239713"
] | 0.0 | -1 |
Create an Application instance. | private static function createApplication(array $application)
{
return new Application(
$application['root_directory'],
isset($application['version']) ? $application['version'] : '',
isset($application['context']) ? $application['context'] : array()
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createApplication(): Application\n {\n return new Application;\n }",
"public function createApplication()\n {\n return $this->app = new Application(__DIR__);\n }",
"public function createApplication()\n {\n $app = new Application(\n $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)\n );\n\n return $app;\n }",
"protected function createApplication()\n {\n $this->app = Container::getInstance();\n\n Facade::setFacadeApplication($this->app);\n\n $this->app->singleton('files', function () {\n return new Filesystem;\n });\n\n $this->app->singleton('translation.loader', function (Container $app) {\n return new FileLoader($app->make('files'), __DIR__);\n });\n\n $this->app->singleton('translator', function (Container $app) {\n $loader = $app->make('translation.loader');\n\n $trans = new Translator($loader, 'en');\n\n return $trans;\n });\n\n $this->app->singleton('validator', function (Container $app) {\n return new Factory($app->make('translator'), $app);\n });\n\n $this->app->singleton('encrypter', function (Container $app) {\n $key = Str::random(16);\n\n return new Encrypter($key);\n });\n }",
"abstract public function createApplication();",
"public function createApplication()\n {\n /** @var Application $app */\n $app = require __DIR__ . '/../../src/app.php';\n require __DIR__ . '/../../config/dev.php';\n require __DIR__ . '/../../src/controllers.php';\n $app['session.test'] = true;\n\n return $this->app = $app;\n }",
"public function createApplication()\n {\n }",
"public function createApplication()\n {\n $app = require __DIR__ . '/../bootstrap/app.php';\n $app->make(Kernel::class)->bootstrap();\n\n return $app;\n }",
"public static function getNewApp()\r\n {\r\n return new App();\r\n }",
"protected function makeApplication(): Application\n {\n if (! file_exists($basePath = $_SERVER['argv'][4] ?? null)) {\n throw new InvalidArgumentException('No application base path provided in child process.');\n }\n\n $app = new Application($basePath);\n $app->singleton(KernelContract::class, KernelRuntime::class);\n\n return $app;\n }",
"public function createApplication()\n {\n return require dirname(__DIR__) . DIRECTORY_SEPARATOR . \"bootstrap.php\";\n }",
"public function createApplication(){\n $app = require __DIR__.'/../../../bootstrap/app.php';\n $app->make(Kernel::class)->bootstrap();\n return $app;\n }",
"public function createApplication()\n {\n $app = require __DIR__ . '/../vendor/laravel/laravel/bootstrap/app.php';\n\n $app->register(\\Sinclair\\ApiFoundation\\Providers\\ApiFoundationServiceProvider::class);\n\n $app->make('Illuminate\\Contracts\\Console\\Kernel')\n ->bootstrap();\n\n return $app;\n }",
"private function createApplication()\n {\n $app = $this->createPartialMock(Application::class, ['runningInConsole', 'runningUnitTests']);\n\n Container::setInstance($app);\n\n $app->singleton(\n ExceptionHandlerContract::class,\n function () use ($app) {\n return new \\Illuminate\\Foundation\\Exceptions\\Handler($app);\n }\n );\n\n return $app;\n }",
"protected function createApplication($appPath)\n {\n $app = new Application($appPath, $this->container());\n\n $app->setVersion('0.1.9.4')\n ->setName('Integration Test Application');\n\n return $app;\n }",
"public function createApplication()\n {\n $app = require __DIR__.'/../vendor/laravel/laravel/bootstrap/app.php';\n $app->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap();\n\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite.database', ':memory:');\n\n return $app;\n }",
"function app(): Application\n\t{\n\t\tstatic $app;\n\n\t\tif($app === null)\n\t\t{\n\t\t\t$app = Application::instance();\n\t\t}\n\n\t\treturn $app;\n\t}",
"public static function create(array $config = []) : App\n {\n return new static(ContainerFactory::create($config), $config);\n }",
"public static function create() {\n self::$appLoader = new AppLoader(self::DEFAULT_FOLDER);\n self::$appLoader->loadApps();\n }",
"public function application(): Application\n {\n return self::instance()->runner->application();\n }",
"public static function buildApplication( Application $application );",
"public function createApplication($kernel, string $commandName = null, string $commandDescription = null): Application;",
"protected function instantiate(?array $applicationAttributes = null) : ?App {\n if (!$applicationAttributes) {\n return null;\n }\n\n $application = new App(\n $applicationAttributes['id'],\n $applicationAttributes['key'],\n $applicationAttributes['secret'],\n );\n\n if (isset($applicationAttributes['name'])) {\n $application->setName($applicationAttributes['name']);\n }\n\n if (isset($applicationAttributes['host'])) {\n $application->setHost($applicationAttributes['host']);\n }\n\n $application\n ->enableClientMessages($applicationAttributes['enable_client_messages'])\n ->enableStatistics($applicationAttributes['enable_statistics']);\n\n return $application;\n }",
"function app()\n {\n return Application::instance();\n }",
"function Application() {\n if(is_null($Instance = Web\\Application::Instance())) {\n throw new Exception('Application not running. Run app __CLASS__::Run(...)');\n }\n return $Instance;\n }",
"public static function getApplication() : Application\n {\n return self::$app;\n }",
"function app($callback = null)\n {\n return Application::instance($callback);\n }",
"static public function CreateApp($app_name, $init=true) {\r\n \t$path = TII_PATH_ROOT._.'apps'._.strtolower($app_name)._.'application.php';\r\n\t\tif (! file_exists($path)) throw new Exception (Tii::Out('Application \"%s\" could not be found at: %s', $app_name, $path));\r\n \t\r\n\t\tinclude $path;\r\n\t\t\r\n\t\tif (! class_exists($app_name)) throw new Exception(Tii::Out('Application class for \"%s\" does not exist.',$app_name));\r\n\t\t\r\n\t\t\r\n self::$_apps[] = self::$_App = new $app_name();\r\n \r\n if($init) self::$_App->Init();\r\n\t\t\r\n\t\treturn self::$_App;\r\n }",
"public function createApplication($type, $arguments = [])\n {\n try {\n $application = $this->objectManager->create($type, $arguments);\n if (!($application instanceof AppInterface)) {\n throw new \\InvalidArgumentException(\"The provided class doesn't implement AppInterface: {$type}\");\n }\n return $application;\n } catch (\\Exception $e) {\n $this->terminate($e);\n }\n }",
"public function testAppInstance()\n {\n $app = new Application();\n $this->assertSame($app, $app->make(\"app\"));\n }",
"protected static function createApplication($class, $config = null)\n {\n return new $class($config);\n }",
"protected function initializeApplication()\n {\n switch ($this->mode) {\n case self::MODE_FPM:\n $this->application = new MvcApplication($this->di);\n break;\n case self::MODE_CLI:\n $arguments = CliParser::getArguments();\n /** @var RouterInterface $router */\n $router = $this->di->get('router');\n $router->setDefaultModule($arguments['module']);\n\n $this->application = new ConsoleApplication($this->di);\n $this->application->setArgument($arguments, false);\n break;\n case self::MODE_API:\n // @TODO - API application\n break;\n default:\n throw new RuntimeException(\"Unrecognized application mode\");\n }\n\n try {\n $modules = new Yaml(project_root('config/modules.yaml'));\n\n $this->application->registerModules($modules->toArray());\n } catch (Exception $e) {\n // No modules, no problem\n }\n\n $this->application->setEventsManager($this->di->get('eventsManager'));\n }",
"public static function app()\n {\n if(self::$app == null)\n {\n self::$app = new BApplication();\n }\n \n return self::$app;\n }",
"public static function getInstance()\n {\n if (self::$instance === null) {\n self::$instance = new \\Dit\\Application();\n }\n return self::$instance;\n }",
"public static function Instance()\n {\n static $instance = null;\n if ($instance === null) {\n $instance = new App();\n }\n return $instance;\n }",
"public static function getInstance()\n\t{\n\t\tif (!static::$instance)\n\t\t{\n\t\t\tstatic::$instance = new Application();\n\t\t}\n\t\treturn static::$instance;\n\t}",
"private function createApplication(Configuration $configuration)\n\t{\n\t\t/** @noinspection PhpParamsInspection Built class will always be an application */\n\t\tApplication::current(Builder::create(\n\t\t\t$configuration->getApplicationClassName(), [$configuration->getApplicationName()]\n\t\t));\n\t}",
"public function baseApp()\n {\n return new BaseApplication();\n }",
"static function factory($application, $user = null)\r\n {\r\n if (BasicApplication :: exists($application))\r\n {\r\n return BasicApplication :: factory($application, $user);\r\n }\r\n if (LauncherApplication :: exists($application))\r\n {\r\n return LauncherApplication :: factory($application, $user);\r\n }\r\n throw new \\RuntimeException(\"Unknown Application : ${application}\");\r\n }",
"function app($abstract = null, array $parameters = [])\n {\n if (is_null($abstract)) {\n return \\Very\\Application::getInstance();\n }\n\n return empty($parameters)\n ? \\Very\\Application::getInstance()->make($abstract)\n : \\Very\\Application::getInstance()->makeWith($abstract, $parameters);\n }",
"protected function getMockApplication()\n {\n $app = new Application();\n\n $app->register(\n new ValidatorServiceProvider()\n );\n\n $app->register(\n new HmacServiceProvider()\n );\n\n $app['service.hmac'] = new HmacService($app['validator'], $this->getMockRequest());\n $app['request'] = $this->getMockRequest();\n\n return $app;\n }",
"public function createApplication()\n {\n try {\n $result = $this->apiClient->httpPost(sprintf('/v2/user/%s/applications', $this->getUserId()));\n\n return new Lpa($result);\n } catch (ApiException $ex) {}\n\n return false;\n }",
"public static function getInstance() {\n if (self::$_app === null) {\n throw new AppException('App not instantiated: call init first');\n }\n\n return self::$_app;\n }",
"public function createApplication($options = array())\n {\n // duplicating the default values from API documentation\n $defaults = array(\n 'title' => 'Phonegap Application',\n 'package' => 'com.phonegap.www',\n 'version' => '0.0.1',\n 'description' => '',\n 'debug' => false,\n // don't set defaults for keys, as it will throw an error\n // if you want to set keys just pass them as options\n // 'keys' => array(),\n 'private' => true,\n 'phonegap_version' => '3.1.0',\n 'hydrates' => false,\n );\n\n $options = array_merge($defaults, $options);\n\n return $this->request('apps', 'post', $options);\n }",
"public static function getInstance() {\n if (self::$app) {\n return self::$app;\n }\n return new self();\n }",
"public function testInstantiateAnApplication()\n {\n $app = $this->quickMock('Asar\\Application\\Application');\n $this->container->expects($this->atLeastOnce())\n ->method('get')\n ->with('application')\n ->will($this->returnValue($app));\n\n $loader = new Loader($this->container);\n $this->assertInstanceOf(\n 'Asar\\Application\\Application',\n $loader->loadApplication($this->config)\n );\n }",
"public function __invoke(ContainerInterface $container): Application\n {\n $config = $this->getConfig($container);\n\n $application = new Application(\n $config['name'] ?? 'Application Console',\n $config['version'] ?? 'UNKNOWN'\n );\n $application->setCommandLoader($this->createCommandLoader($container, $config['commands'] ?? []));\n\n return $application;\n }",
"public static function load() {\n if (!(self::$app instanceof self)) {\n self::$app = new self();\n }\n return self::$app;\n }",
"public function getApplication()\n {\n if ($this->application !== null) {\n return $this->application;\n }\n\n $this->application = new Application(self::NAME, self::VERSION);\n\n foreach ($this->registeredCommands() as $command) {\n if ($command instanceof ContainerAwareInterface) {\n $command->setContainer($this->container);\n }\n\n $this->application->add($command);\n }\n\n return $this->application;\n }",
"protected function getFreshApplication()\n {\n $app = require $this->laravel->bootstrapPath().'/app.php';\n\n $app->make(Kernel::class)->bootstrap();\n\n return $app;\n }",
"public static function make()\n {\n return new static(App::getInstance());\n }",
"private function getApp() {\n if ( !$this->_app ) {\n $this->_app = new \\beaba\\core\\WebApp(array(\n 'models' => array(\n 'test' => array(\n 'storage' => 'default',\n 'table' => 'tests',\n 'database' => '__tests',\n 'columns' => array(\n 'when' => 'datetime',\n 'rand' => 'integer',\n 'name' => 'string:32'\n ),\n 'relations' => array(\n 'units' => 'many:unit'\n )\n )\n )\n ));\n }\n return $this->_app;\n }",
"public function getApplication();",
"public function getApplication();",
"public function getApplication();",
"public function getApplication();",
"public function getApplication();",
"public function &getAppInstance(string $name)\n {\n if (empty($name)) {\n Throw new FrameworkException('Core::getAppInstance() needs an app name');\n }\n\n $string = new CamelCase($name);\n $name = $string->camelize();\n\n // App instances are singletons!\n if (!array_key_exists($name, $this->apps)) {\n\n // Create class name\n $class = '\\Apps\\\\' . $name . '\\\\' . $name;\n\n //\n $filename = $this->basedir . str_replace('\\\\', DIRECTORY_SEPARATOR, $class) . '.php';\n\n if (!file_exists($filename)) {\n Throw new FrameworkException(sprintf('Apps could not find an app classfile \"%s\" for app \"%s\"', $name, $filename));\n }\n\n // Default arguments for each app instance\n $args = [\n $name,\n $this->config->createStorage($name),\n $this\n ];\n\n $instance = $this->di->instance($class, $args);\n\n if (!$instance instanceof AbstractApp) {\n Throw new FrameworkException('Apps must be an instance of AbstractApp class!');\n }\n\n $instance->setName($name);\n $instance->language->setCode($this->config->get('Core', 'site.language.default'));\n\n $this->apps[$name] = $instance;\n }\n\n return $this->apps[$name];\n }",
"public abstract function getApplication();",
"function app($abstract = null, bool $new = false)\n {\n if (is_null($abstract)) {\n return Application::getInstance();\n }\n\n return Application::getInstance()->get($abstract, $new);\n }",
"function app()\n {\n return \\Core\\Container::getInstance()->singleton('app');\n }",
"public function application(array $config)\n {\n return $this->addDefinition(new ConfigDefinition(ConfigDefinition::GROUP_APPLICATIONS, 'application', $config));\n }",
"protected function getApp(): Application\n {\n $appId = $this->getAppIdDetector()($this->getRequest());\n if ($appId === null) {\n throw new HttpException('Cannot determine app ID');\n }\n\n // Create the app for the app ID.\n $app = $this->instantiateApp($appId);\n\n // Reconcile the registered app ID with the App's configured ID.\n $configuredId = $app->getConfig()->getId();\n if ($configuredId === null) {\n $app->getConfig()->withId($appId);\n } elseif ($configuredId !== $appId) {\n throw new HttpException(\"ID mismatch for app ID: {$appId}\");\n }\n\n // Set the App to the Server.\n $this->withApp($app);\n\n return parent::getApp();\n }",
"function app($abstract = null)\n {\n if (Yaf_Registry::get('app') === null) {\n Yaf_Registry::set('app', new Application([], realpath(dirname(__FILE__))));\n }\n\n if (is_null($abstract)) {\n return Yaf_Registry::get('app');\n }\n\n return Yaf_Registry::get('app')->get($abstract);\n }",
"public static function app()\n\t{\n\t\tif ( empty(self::$instance) ){\n\t\t\tself::$instance = new Nerb();\n\t\t}\n\t\treturn self::$instance;\n\n }",
"protected function _createNewApplication( Streamwide_Engine_Signal $signal = null )\n {\n if ( is_string( $this->_applicationClass ) ) {\n $application = new $this->_applicationClass( $this, $signal );\n } elseif ( $this->_applicationClass instanceof Streamwide_Engine_Media_Application_Factory ) {\n $application = $this->_applicationClass->factory( $this, $signal );\n }\n \n if ( !$application instanceof Streamwide_Engine_Media_Application_Abstract ) {\n trigger_notice( 'Media application must be an instance of Streamwide_Engine_Media_Application_Abstract', E_USER_NOTICE );\n return false;\n }\n \n return $application;\n }",
"public static function getFacadeApplication()\n {\n }",
"public static function getFacadeApplication()\n {\n }",
"public static function getFacadeApplication()\n {\n }",
"public static function getFacadeApplication()\n {\n }",
"protected function get206058a713a7172158e11c9d996f6a067c294ab0356ae6697060f162e057445a(): \\Viserio\\Component\\Console\\Application\n {\n $this->services[\\Viserio\\Component\\Console\\Application::class] = $instance = new \\Viserio\\Component\\Console\\Application($this->getParameter('viserio.console.version'), $this->getParameter('viserio.console.name'));\n\n $instance->setContainer($this);\n if ($this->has(\\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface::class)) {\n $instance->setCommandLoader(($this->services[\\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface::class] ?? $this->getce817e8bdc75399a693ba45b876c457a0f7fd422258f7d4eabc553987c2fbd31()));\n }\n\n return $instance;\n }",
"public function createApplication(array $body)\n {\n return $this->_CreateApplication_operation->call(['body' => $body]);\n }",
"protected function get206058a713a7172158e11c9d996f6a067c294ab0356ae6697060f162e057445a(): \\Viserio\\Component\\Console\\Application\n {\n $this->services[\\Viserio\\Component\\Console\\Application::class] = $instance = new \\Viserio\\Component\\Console\\Application($this->getParameter('viserio.console.version'), $this->getParameter('viserio.console.name'));\n\n $instance->setContainer($this);\n\n if ($this->has(\\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface::class)) {\n $instance->setCommandLoader(($this->services[\\Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface::class] ?? $this->getce817e8bdc75399a693ba45b876c457a0f7fd422258f7d4eabc553987c2fbd31()));\n }\n\n return $instance;\n }",
"static public function get(): ?Application\n\t{\n\t\treturn self::$instance;\n\t}",
"function getMyApplication()\n {\n if (Yii::$app->user->isGuest) {\n return new Applications;\n }\n $model = $this->getApplications()->where('user_id=:uid', [\n 'uid' => Yii::$app->user->id,\n ])->one();\n\n return $model ? $model : new Applications();\n }",
"function startApp($classApplication) {\n new $classApplication();\n}",
"public function createApplication($applicationId, $request)\n {\n return $this->start()->uri(\"/api/application\")\n ->urlSegment($applicationId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public static function app()\n {\n return self::$_app;\n }",
"public function getApplication()\n {\n return $this->app;\n }",
"public function getApplication()\n {\n return $this->app;\n }",
"public function getApplication()\n {\n return $this->app;\n }",
"public function getApplication()\n {\n return $this->app;\n }",
"public static function getInstance(): AppInterface;",
"protected function makeApp($class, $args)\n {\n $reflect = new \\ReflectionClass($class);\n return $reflect->newInstanceArgs($args);\n }",
"function tev_app() {\n return Tev\\Application\\Application::getInstance();\n }",
"public static function make($abstract, $parameters = array()){\n return \\Illuminate\\Foundation\\Application::make($abstract, $parameters);\n }",
"public function getMockApplication()\n\t{\n\t\t// Attempt to load the real class first.\n\t\tclass_exists('JApplication');\n\n\t\treturn TestMockApplication::create($this);\n\t}",
"public function bootApp(): AppInterface\n {\n return new InstalledApp(\n $this->bootLaravel(),\n $this->config\n );\n }",
"public function __construct(Application $application)\n {\n $this->app = $application;\n }",
"public static function create(array $params = null)\n\t{\n\t\tself::$app_mode = self::MODE_DEVELOPMENT;\n\t\t\t\n\t\tif(is_null(self::$instance)) {\n\t\t\tself::$instance = new self;\n\t\t}\n\t\t\n\t\t// setting up autoloader\n\t\tspl_autoload_register(array('App', 'autoload'));\n\t\t\n\t\ttry {\n\t\t\t// setup config\n\t\t\tConfig::create(isset($params['config']) ? $params['config'] : null);\n\t\t\tConfig::setVar($params);\n\n\t\t\t// application mode\n\t\t\tself::setMode(Config::getVar('mode', self::MODE_DEVELOPMENT));\n\t\t\t\n\t\t\t// our error handler\n\t\t\tif(!self::isDevMode()) {\n\t\t\t\tset_error_handler(array('App', 'handleErrors'));\n\t\t\t}\n\t\t\t\n\t\t\t// language specific params\n\t\t\tif(function_exists('mb_internal_encoding')) {\n\t\t\t\tmb_internal_encoding(Config::getVar('app_encoding', 'UTF-8'));\n\t\t\t}\n\t\t\t\n\t\t\tif(function_exists('date_default_timezone_set')) {\n\t\t\t\tdate_default_timezone_set(Config::getVar('app_timezone', 'UTC'));\n\t\t\t}\n\t\t\t\n\t\t\tsetlocale(LC_CTYPE, Config::getVar('app_locale', 'en_US.UTF-8'));\n\t\t\t\n\t\t\t// creating base objects\n\t\t\tLog::create();\n\t\t\tRequest::create();\n\t\t\t\n\t\t\t// saving application params\n\t\t\tself::$params = $params;\n\n\t\t\t// unregister globals\n\t\t\tif(ini_get('register_globals')) {\n\t\t\t\tself::unregisterGlobals(array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES'));\n\t\t\t\tini_set('register_globals', false);\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tself::$instance->handleDefaultException($e);\n\t\t}\n\t}",
"function app($name = null)\n {\n return null === $name ? App::make('app') : App::make($name);\n }",
"public static function start($app)\r\n {\r\n return static::make($app);\r\n }",
"public static function getInstance($app) {\n $classname = __CLASS__;\n return new $classname($app);\n }",
"protected function _configureApplication()\n {\n $this->getApplication()\n ->setRequest(\\App\\Factory::createRequest())\n ->setRouter(\\App\\Factory::createRouter())\n ->setDispatcher(\\App\\Factory::createDispatcher())\n ;\n }",
"function app() {\n return Container::getInstance();\n}",
"public static function resolve(): Application\n {\n $app = (new self)->createApplication();\n\n $composerFile = getcwd().DIRECTORY_SEPARATOR.'composer.json';\n\n if (file_exists($composerFile)) {\n $namespace = (string) key(json_decode((string) file_get_contents($composerFile), true)['autoload']['psr-4']);\n\n $serviceProviders = array_values(array_filter(self::getProjectClasses(), function (string $class) use (\n $namespace\n ) {\n return substr($class, 0, strlen($namespace)) === $namespace && self::isServiceProvider($class);\n }));\n\n foreach ($serviceProviders as $serviceProvider) {\n $app->register($serviceProvider);\n }\n }\n\n return $app;\n }",
"function app($app = null)\n {\n if (is_null($app)) {\n return Container::getInstance();\n }\n\n return Container::setInstance($app);\n }",
"public function getApplication(){ \r\n\t\treturn \\Yaf\\Application::app();\r\n\t}",
"public function bootstrap($app);",
"public function show(Application $application)\n {\n return new ApplicationResource($application);\n }"
] | [
"0.8838951",
"0.8393173",
"0.83666795",
"0.8065296",
"0.8020398",
"0.7998664",
"0.7920922",
"0.79152054",
"0.7831785",
"0.77648735",
"0.75002044",
"0.7455812",
"0.73494726",
"0.72766393",
"0.7267437",
"0.72483045",
"0.72132975",
"0.7177787",
"0.716703",
"0.71284527",
"0.7115137",
"0.70921564",
"0.7004729",
"0.70036083",
"0.6918556",
"0.68891484",
"0.6862136",
"0.68514085",
"0.6845487",
"0.6827824",
"0.6775591",
"0.6771578",
"0.6687183",
"0.6635546",
"0.66315335",
"0.66253495",
"0.6624153",
"0.66053987",
"0.6568431",
"0.654525",
"0.654108",
"0.6538189",
"0.65282184",
"0.6517009",
"0.6461662",
"0.64224076",
"0.641677",
"0.6398853",
"0.63724995",
"0.6350458",
"0.63343626",
"0.63006115",
"0.62643397",
"0.62643397",
"0.62643397",
"0.62643397",
"0.62643397",
"0.6260128",
"0.62576276",
"0.6245834",
"0.6225877",
"0.62115866",
"0.6208732",
"0.61972123",
"0.6148694",
"0.6133969",
"0.6111597",
"0.6111597",
"0.6111597",
"0.6111597",
"0.60586685",
"0.60558176",
"0.6048156",
"0.6006375",
"0.5998057",
"0.5977129",
"0.5944058",
"0.59307444",
"0.5880591",
"0.5880591",
"0.5880591",
"0.5880591",
"0.5878906",
"0.58702487",
"0.5861748",
"0.5839939",
"0.5828899",
"0.5827293",
"0.5824397",
"0.5800143",
"0.57990783",
"0.5798719",
"0.57759666",
"0.57753646",
"0.5768413",
"0.57547516",
"0.5742996",
"0.5740821",
"0.5710036",
"0.5708743"
] | 0.7370816 | 12 |
Encerrar a sess?o do usu?rio e redirecionar para a p?gina de login | public function logout() {
$session_key = $this->getSessionKey();
if ($this->Session->valid() && $this->Session->check($session_key)) {
$ses = $this->Session->read($session_key);
if (!empty($ses) && is_array($ses)) {
$this->Session->delete($session_key);
$this->Session->delete($this->config['prefixo_sessao'] . '.frompage');
}
}
if ($this->config['auto_redirecionamento'] && !empty($this->config['pagina_logout'])) {
$this->redirecionar($this->config['pagina_logout']);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verificar_login()\n {\n if (!isset($_SESSION['usuario'])) {\n $this->sign_out();\n }\n }",
"function usuario_autenticado() {\n\n if (!revisar_usuario()) {\n header('Location:login.php?user=paciente');\n exit();\n }\n}",
"public function loginUsuario($login = '', $clave = '') {\n $password = md5($clave);\n $this->consulta = \"SELECT * \n FROM usuario \n WHERE login = '$login' \n AND password = '$password' \n AND estado = 'Activo' \n LIMIT 1\";\n\n if ($this->consultarBD() > 0) {\n $_SESSION['LOGIN_USUARIO'] = $this->registros[0]['login'];\n $_SESSION['ID_USUARIO'] = $this->registros[0]['idUsuario'];\n $_SESSION['PRIVILEGIO_USUARIO'] = $this->registros[0]['privilegio'];\n $_SESSION['ACTIVACION_D'] = 0;\n// $_SESSION['ACCESOMODULOS'] = $this->registros[0]['accesoModulos'];\n\n $tipoUsuario = $this->registros[0]['tipoUsuario'];\n\n switch ($tipoUsuario) {\n case 'Empleado':\n $idEmpleado = $this->registros[0]['idEmpleado'];\n $this->consulta = \"SELECT primerNombre, segundoNombre, primerApellido, segundoApellido, cargo, cedula, tipoContrato \n FROM empleado \n WHERE idEmpleado = $idEmpleado \n LIMIT 1\";\n $this->consultarBD();\n// $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['ID_EMPLEADO'] = $idEmpleado;\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['primerApellido'];\n $_SESSION['CARGO_USUARIO'] = $this->registros[0]['cargo'];\n $_SESSION['TIPO_CONTRATO'] = $this->registros[0]['tipoContrato'];\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['segundoNombre'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['primerApellido'] . ' ' . $this->registros[0]['segundoApellido'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Residencial':\n $idResidencial = $this->registros[0]['idResidencial'];\n $this->consulta = \"SELECT nombres, apellidos, cedula \n FROM residencial \n WHERE idResidencial = $idResidencial \n LIMIT 1\";\n $this->consultarBD();\n $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['nombres'] . ' ' . $apellidos[0];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Residencial';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['nombres'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['apellidos'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Corporativo':\n $idCorporativo = $this->registros[0]['idCorporativo'];\n $this->consulta = \"SELECT razonSocial, nit \n FROM corporativo \n WHERE idCorporativo = $idCorporativo \n LIMIT 1\";\n\n $this->consultarBD();\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Corporativo';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['nit'];\n break;\n case 'Administrador':\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = 'Administrador';\n $_SESSION['CARGO_USUARIO'] = 'Administrador';\n $_SESSION['TIPO_CONTRATO'] = 'Laboral Administrativo';\n\n $_SESSION['NOMBRES_USUARIO'] = 'Administrador';\n $_SESSION['APELLIDOS_USUARIO'] = 'Administrador';\n $_SESSION['CEDULA_USUARIO'] = '10297849';\n $_SESSION['ID_EMPLEADO'] = '12';\n $_SESSION['ID_CAJA_MAYOR_FNZAS'] = 2;\n $idEmpleado = 12;\n break;\n default:\n break;\n }\n\n //******************************************************************\n // VARIABLES DE SESSION PARA EL ACCESO AL MODULO RECAUDOS Y FACTURACION DE swDobleclick\n\n $_SESSION['user_name'] = $_SESSION['NOMBRES_APELLIDO_USUARIO'];\n $_SESSION['user_charge'] = $_SESSION['CARGO_USUARIO'];\n\n $_SESSION['user_id'] = 0; //$this->getIdUsuarioOLD($idEmpleado);\n $_SESSION['user_privilege'] = 0; //$this->getPrivilegioUsuarioOLD($idEmpleado);\n\n //******************************************************************\n\n $fechaHora = date('Y-m-d H:i:s');\n $idUsuario = $_SESSION['ID_USUARIO'];\n $consultas = array();\n $consultas[] = \"UPDATE usuario \n SET fechaHoraUltIN = '$fechaHora' \n WHERE idUsuario = $idUsuario\";\n $this->ejecutarTransaccion($consultas);\n return true;\n } else {\n return false;\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\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 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 }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"function validar_sessao()\n{\n if (isset($_COOKIE[\"usuario\"])) {\n $_SESSION[\"usuario\"] = $_COOKIE[\"usuario\"];\n $_SESSION[\"nome\"] = $_COOKIE[\"nome\"];\n }\n if (!isset($_SESSION[\"usuario\"])) {\n $_SESSION[\"erros\"] = \"Favor efetuar o login\";\n echo \"<script>\n document.location=\\\"db_login.php\\\";\n </script>\";\n exit;\n }\n}",
"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 }",
"function autenticar() {\n if (!estaLogado() || sessaoExpirada()) {\n deslogar();\n header('Location: form_login.php');\n } else {\n return true;\n }\n}",
"public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }",
"public function loginValidated()\n\t\t{\n\t\t\t$campos = array('*');\n\t\t\t\n\t\t\t$pw = $this->_objCrypt->encrypt($this->_password);\n\n\t\t\t# Campos que se incluyen en la validacion WHERE DE LA SQL\n\t\t\t$field['userName'] = $this->_userName;\n\t\t\t$register = Usuario::findCustom($campos, $field);\n\n\t\t\t# Validación nombre usuario en BD\n\t\t\tif (empty($register)) {\n\t\t\t\t$json_error = array('success' => 'error', 'error' => 'error1');\n\t\t\t\t$success = json_encode($json_error);\n\t\t\t\tsetcookie(\"success\", $success, time() + 60, \"/\"); \n\t\t\t\theader('location:../views/users/login.php');\n\t\t\t}else{\n\t\t\t\t# pw que se obtiene de BD\n\t\t\t\t$pw_DB = $register[0]->getPassword();\n\n\t\t\t\t# Validacion coincidencia de contraseñas\n\t\t\t\tif ($pw !== $pw_DB) {\n\t\t\t\t\t$json_error = array('success' => 'error', 'error' => 'error2');\n\t\t\t\t\t$success = json_encode($json_error);\n\t\t\t\t\tsetcookie(\"success\", $success, time() + 60, \"/\"); \n\t\t\t\t\theader('location:../views/users/login.php');\n\t\t\t\t}else{\n\t\t\t\t\t$data_session['id_user'] \t= $register[0]->getId();\t\t\t\t\t\n\t\t\t\t\t$data_session['nombre'] \t= $register[0]->getNombre();\t\t\t\n\t\t\t\t\t$data_session['apellido'] \t\t= $register[0]->getApellido();\t\t\t\n\t\t\t\t\t$data_session['tipoUsuario']\t= $register[0]->getTipoUsuario();\t\t\t\n\t\t\t\t\t$data_session['userName'] \t\t= $register[0]->getUserName();\t\t\t\n\t\t\t\t\t$data_session['email'] \t\t = $register[0]->getEmail();\t\t\t\n\t\t\t\t\t$data_session['telFijo'] \t\t= $register[0]->getTelFijo();\t\t\t\n\t\t\t\t\t$data_session['telMovil'] \t\t= $register[0]->getTelMovil();\t\t\t\n\t\t\t\t\t$data_session['estado'] \t\t= $register[0]->getEstado();\n\t\t\t\t\t$data_session['lan']\t\t\t= $_COOKIE['lan'];\n\t\t\t\t\t\n\t\t\t\t\t$obj_Session = new Simple_sessions();\n\t\t\t\t\t$obj_Session->add_sess($data_session);\n\n\t\t\t\t\theader('location:../views/users/crearUsuario.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function loginAction()\n {\n $entity = new Usuario();\n $form = $this->createCreateForm($entity);\n\n $request = $this->getRequest();\n $session = $request->getSession();\n \n if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {\n $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);\n } else {\n $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);\n $session->remove(SecurityContext::AUTHENTICATION_ERROR);\n }\n $em = $this->getDoctrine()->getManager();\n\n return $this->render('UsuarioBundle:Security:login.html.twig',\n array(\n 'last_username' => $session->get(SecurityContext::LAST_USERNAME),\n 'error' => $error,\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"static public function ctrIngresoUsuario()\n{ \n if(isset($_POST[\"ingUsuario\"]))\n {\n\n if(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])) {\n\n\n //$encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t//print_r($_POST);\n $tabla = \"usuarios\";\n $item= \"codusuario\";\n $valor= $_POST[\"ingUsuario\"];\t\t\t\t\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuarios($tabla, $item, $valor );\n\n if($respuesta[\"codusuario\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"] ){\n\n if($respuesta[\"bloqueado\"] == 0 ) {\n $_SESSION[\"iniciarSesion\"] = \"ok\";\n $_SESSION[\"id\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"nombre\"] = $respuesta[\"nomusuario\"];\n $_SESSION[\"usuario\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"perfil\"] = $respuesta[\"codperfil\"];\n $_SESSION[\"foto\"] = \"\";\n $_SESSION[\"id_local\"] = 1;\n\n date_default_timezone_set('America/Bogota');\n $fecha = date('Y-m-d');\n $hora = date('H:i:s');\n $fechaActual = $fecha.' '.$hora;\n\n $tabla = 'usuarios';\n $item1 = 'fecingreso';\n $valor1 = $fechaActual ;\n $item2 = 'codusuario';\n $valor2= $respuesta[\"codusuario\"] ;\n $respuestaUltimoLogin = ModeloUsuarios::mdlActualizarUsuario($tabla,$item1, $valor1, $item2, $valor2 );\n\n if($respuestaUltimoLogin == \"ok\")\n {\n echo '<script> window.location = \"inicio\"</script>';\n\n }\n\n } \n else \n echo '<br><div class=\"alert alert-danger\">El usuario no se encuentra activado.</div>';\n\n }else {\n\n echo '<br><div class=\"alert alert-danger\">Error al ingresar vuelve a intentarlo.</div>';\n }\t\t\t\t\n\n }//\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 }",
"public function connexionAdminAssoLogin(){\n session_destroy();\n }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\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}",
"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 }",
"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 authUser()\n {\n //я не знаю почему, что эти функции возвращают пустые строки...\n //$login = mysql_real_escape_string($_POST['login']);\n //$password = mysql_real_escape_string($_POST['password']);\n $login = $_POST['login'];\n $password = $_POST['password'];\n if(DBunit::checkLoginPassword($login, $password)){\n DBunit::createUserSession(DBunit::getUser($login, $password));\n return true;\n }\n else {\n return false;\n }\n }",
"public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }",
"protected function checkUser() {\n if(!$this->session->userdata(\"usuario_id\")) {\n redirect(\"/login\");\n }\n }",
"public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }",
"function VerificaLogin(){\n\n if(!isset($_SESSION['usuario'])){\n header(\"location:\".BASE_URL.\"painel/login\");\n }\n\n }",
"public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }",
"function login2($_login, $_password){\n $this->login($_login,$_password);\n $resultado_login = mysql_query(\"SELECT * FROM registro\n\t\tWHERE login_reg = '$_login' AND clave_reg = '$_password'\");\n $num_rows = mysql_num_rows($resultado_login);\n if (isset($num_rows)&& $num_rows == 0){\n $this->mensaje = \"Login or Password incorrect!\";\n $_SESSION['estado_temp'] = -1;\n }\n else{\n $fila_login = mysql_fetch_assoc($resultado_login);\n $this->nombre = $fila_login[\"nombre_reg\"];\n $this->apellido = $fila_login[\"apellido_reg\"];\n $this->mensaje = \"Bienvenido $this->nombre $this->apellido.\";\n $_SESSION['estado_temporal'] = 1;\n $_SESSION['login_temporal'] = $fila_login[\"login_reg\"];\n $___login = $fila_login[\"login_reg\"];\n $_SESSION['nombre_temporal'] = $fila_login[\"nombre_reg\"];\n $_SESSION['apellido_temporal'] = $fila_login[\"apellido_reg\"];\n $_SESSION['id_temporal'] = $fila_login[\"id_reg\"];\n //mysql_query (\"UPDATE usuarios SET last_login = curdate()\n //WHERE login = $___login\");\n //if($_SESSION['_url'])\n header(\"location: panel_usuario.php#next\");\n }\n }",
"function iniciar_sesion($id_user, $pass){\n\t\t\t//if ( no lo encontro )\n\t\t\t\t//return false;\n\t\t\t$_SESSION['id_usuario'] = $id_usuario;\n\t\t\t$_SESSION['tipo'] = $type;\n\t\t\t$_SESSION['usuario'] = $usuario;\n\t\t\treturn true;\n\t\t}",
"public function doLogin(){\n $redirect =\"\";\n if(isset($_POST['staticEmail']) && isset($_POST['inputPassword']) && $_POST['staticEmail'] != \"\" && $_POST['inputPassword'] !=\"\")//check if the form is well fill\n {\n $userTabFilter=array(\n '$and' =>array(\n ['email' =>$_POST['staticEmail']],\n ['password' => sha1($_POST['inputPassword'])])\n );//For the filter used on UserManager\n\n $result = $this->_userManager->getUserByPassAndEmail($userTabFilter);\n if($result != null)//return null if the user doesn't exist in DB\n {\n \n $user= array(\n 'id' => $result->_id,\n 'email' => $result->email,\n 'password' => $result->password,\n 'firstname' => $result->firstname,\n 'lastname' => $result->lastname,\n 'pseudo' => $result->pseudo\n );//Filter used on UserManager\n \n $this->_user = $this->_userManager->createUser($user);//Create user, not in DB but, for the session var, as an object\n if($this->_user == 'null'){//In case the creation didn't work\n\n $_SESSION['userStateLogIn'] = ['res'=>'Une erreur a lieu lors de la connexion, veuillez reessayer plus tard.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n\n }else{//In case the connexion worked\n \n $_SESSION['userStateLogIn'] = ['res'=>'Connexion réussie','couleur' => 'green'];\n $redirect = \"calendrier\";//redirect to the calendar\n $_SESSION['user'] =$this->_user;//Init the session var user with the user created before\n }\n \n }else{\n $_SESSION['userStateLogIn'] = ['res'=>'Aucun compte avec votre identifiant et mot de passe existe.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n }\n\n }else{\n $_SESSION['userStateLogIn'] = ['res'=>'Veuillez remplir le formulaire correctement.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n }\n header(\"Location : ../{$this->_redirectTab[$redirect]}\");//proceed to redirection\n \n\n \n }",
"function comprobarLogin ($dbh, $usuario,$password){\n $data = array(\"usuario\" => $usuario,\n \"password\" => $password);\n $stmt = $dbh->prepare(\"SELECT nomUsuario,password FROM Usuario Where nomUsuario = :usuario AND password = :password\");\n $stmt->setFetchMode(PDO::FETCH_OBJ);\n $stmt->execute($data);\n $row = $stmt->fetch();\n if($row == null){\n $isLoginIncorrecto = true;\n header(\"Location: ../html/login.php\");\n }\n else {\n $isLoginIncorrecto = false;\n $tipo = \"user\";\n require_once \"../html/index.php\";\n session_start();\n $_SESSION['registro'] = $usuario;\n }\n}",
"public function login($username,$password)\n {\n try\n {\n $stmt = $this->db->prepare(\"SELECT id,prenom,nom,email,password,pseudo,classe FROM users WHERE email=:email LIMIT 1\");\n $stmt->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8')\n ));\n $userRow = $stmt->fetch(PDO::FETCH_ASSOC);\n if($stmt->rowCount() > 0)\n {\n if(password_verify($password, $userRow['password']))\n {\n $session = md5(rand());\n $lastco = strftime('%d %B %Y à %H:%M');\n $updateMembre = $this->db->prepare('UPDATE users SET session=:session, lastco=:lastco WHERE email=:email');\n $updateMembre->execute(array(\n 'email' => $username,\n 'session' => $session,\n 'lastco' => $lastco\n ));\n $_SESSION['session'] = $session;\n $_SESSION['userid'] = $userRow['id'];\n $_SESSION['userpseudo'] = $userRow['prenom'].\" \".$userRow['nom'];\n $_SESSION['username'] = $userRow['pseudo'];\n $_SESSION['userclasse'] = $userRow['classe'];\n\n if(isset($_POST['rememberme'])) {\n $contentcook = $userRow['id'].\"===\".sha1($username.$_SERVER['REMOTE_ADDR']);\n setcookie('auth', $contentcook, time() + 3600 * 24 * 7, '/', 'www.interminale.fr.nf', false, true);\n }\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }\n catch(PDOException $e)\n {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }",
"private function logInSimpleUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(41);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"public function signin(){\r\n if(isset($_SESSION['user'])){\r\n if(isset($_POST['mail']) && isset($_POST['password'])){\r\n $mail = $_POST['mail']; \r\n $password = $_POST['password'];\r\n \r\n if($this->user->setMail($mail) && $this->user->setPassword($password)){\r\n $this->user->db_set_Users($this->user);\r\n die(\"REGISTRO EXITOSO\");\r\n }else{\r\n die(\"ERROR AL REALIZAR EL REGISTRO\");\r\n }\r\n }\r\n }else{\r\n die(\"ERROR AL REQUEST ERRONEO\");\r\n }\r\n }",
"private function accesoUsuario()\n {\n if ($this->adminSession) {\n $usuario = $this->session->userdata('admin');\n if ($usuario['id'] > 0) {\n redirect('admin/dashboard');\n } else {\n $this->adminSession = false;\n $this->session->sess_destroy();\n redirect('admin/index'); \n }\n }\n }",
"static public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$item = \"usu_descri\";\n\t\t\t\t$valor = $_POST[\"ingUsuario\"];\n\t\t\t\t$pass = $_POST[\"ingPassword\"];\n\n\t\t\t\t$respuesta = ModeloUsuarios::MdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\tif($respuesta[\"usu_descri\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"])\n\t\t\t\t{\n\n\t\t\t\t\tif($respuesta['estado'] == 'A')\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$_SESSION[\"iniciarSesion\"] = \"ok\";\n\t\t\t\t\t\t$_SESSION[\"id\"] = $respuesta[\"id\"];\n\t\t\t\t\t\t// $_SESSION[\"nombre\"] = $respuesta[\"nombre\"];\n\t\t\t\t\t\t$_SESSION[\"usuario\"] = $respuesta[\"usu_descri\"];\n\t\t\t\t\t\t// $_SESSION[\"foto\"] = $respuesta[\"foto\"];\n\t\t\t\t\t\t// $_SESSION[\"perfil\"] = $respuesta[\"perfil\"];\n\n\t\t\t\t\t\techo '<script>\n\t\n\t\t\t\t\t\twindow.location = \"inicio\";\n\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activo, porfavor, comuniquese con el administrador</div>';\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t}\n\n\t}",
"public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }",
"function login ($username, $password, $DB_LINK){\n $username = clear($username);\n $password = clear($password);\n $query = \"SELECT * FROM usuarios where Usuario = '$username'\";\n\n if($res = mysqli_query($DB_LINK, $query)){\n if (mysqli_num_rows($res) == 1 ) {\n $rows = mysqli_fetch_array($res); //obtenemos todos los campos de ese usuario \n if (passwordCheck($DB_LINK, $username, $password, $rows[\"Contraseña\"])){\n $_SESSION['userAgent'] = $_SERVER['HTTP_USER_AGENT']; //metodos adicionales para evitar robo de sesiones\n $_SESSION['IPaddress'] = getClientIp();\n $_SESSION[\"username\"] = $username;\n $_SESSION[\"id\"] = $rows[\"id\"]; //guardaremos la id para evitar que luego pueda editar a otros usuarios si introduce la url\n session_regenerate_id(true); //cambiamos el id de la sesion para evitar posibles fijados de sesion\n return true;\n }\n else{\n return false;\n }\n } \n else {\n return false;\n }\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 verificar_sessao() {\n if ($this->session->userdata('logado') == false)\n redirect('dashboard/login');\n }",
"function verif_utilisateur(){\r\n\tglobal $db;\r\n\tif(isset ($_POST['id_user']) AND ($_POST['pass'])){\r\n\t\t\r\n\techo 'test1';\r\n\t$id_user = htmlspecialchars($_POST['id_user']);\r\n\t$pass = htmlspecialchars($_POST['pass']);\r\n\r\n\t// Hachage du mot de passe\r\n\t$pass_hache=sha1($_POST['pass']);\r\n\r\n\t//verif des identifiant\r\n\t$req=$db->prepare('SELECT id_user, passcri FROM login WHERE id_user=:id_user AND passcri=:passcri');\r\n\t$req->execute(array(\r\n\t'id_user'=>$id_user,\r\n\t'passcri'=>$pass_hache));\r\n\r\n\t$resultat=$req->fetch();\r\n\r\n\tif(!$resultat){\r\n\t\techo 'Mauvais identifiant ou mot de passe !';\r\n\t}\r\n\telse{\r\n\t\t$_SESSION['id_user'] = $resultat['id_user'];\r\n\t\t$_SESSION['pass'] = $resultat['passcri'];\r\n\t\techo 'Vous étes connecté!';\r\n\t}\r\n\theader('Location: login.php');\r\n\treturn $req;\r\n\t}\r\n}",
"function loginUser($conn, $nomutilisateur, $password ){\n $uidExists = usernameExists($conn ,$nomutilisateur, $nomutilisateur);\n\n if ($uidExists === false) {\n header('location:after-connexion.php?error=wronglogin');\n exit(); \n }\n\n $pwdHashed = $uidExists[\"userPass\"];\n $chechPwd = password_verify($password, $pwdHashed);\n\n if ($chechPwd === false) {\n header('location:after-connexion.php?error=wronglogin');\n exit(); \n }else if($chechPwd === true){\n session_start();\n $_SESSION[\"userid\"] = $uidExists[\"userId\"];\n $_SESSION[\"usernomuti\"] = $uidExists[\"userNomUti\"];\n header('location:index.html ');\n exit(); \n }\n}",
"private function verificar_cookie_sesion()\n\t{\n\t\t$session = \\Config\\Services::session();\n\t\t//verificar cookies\n\t\tif (isset($_COOKIE['ivafacil_admin_nick']) && isset($_COOKIE['ivafacil_admin_pa']) ) {\n\n\t\t\t$nick= $_COOKIE['ivafacil_admin_nick'];\n\t\t\t$pass=$_COOKIE['ivafacil_admin_pa'];\n\t\t\t//comparar passw hasheadas\n\t\t\t$usuarioCookie = new Admin_model();\n\t\t\t$result_pass_comparison =\n\t\t\t$usuarioCookie->where(\"nick\", $nick) \n\t\t\t->where(\"session_id\", $pass)->first();\n\n\t\t\tif (is_null($result_pass_comparison)) {\n\t\t\t\t//MOSTRAR FORM\n\n\t\t\t\treturn view(\"admin/login\");\n\t\t\t} else {\n\n\t\t\t\t//Se pidio recordar password?\n\t\t\t\tif ($result_pass_comparison->remember == \"S\") {\n\t\t\t\t\t//recuperar sesion si es valida\n\t\t\t\t\t$hoy = strtotime(date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t$expir = strtotime($result_pass_comparison->session_expire);\n\t\t\t\t\tif ($hoy > $expir) return view(\"admin/login\");\n\n\t\t\t\t\t//crear sesion \n\t\t\t\t\t$newdata = [\n\t\t\t\t\t\t'nick' => $nick, \n\t\t\t\t\t\t'pass_alt' => $pass,\n\t\t\t\t\t\t'remember'=> \"S\"\n\t\t\t\t\t];\n\t\t\t\t\treturn view(\"admin/login\", $newdata);\n\t\t\t\t} else {\n\t\t\t\t\treturn view(\"admin/login\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//MOSTRAR FORM\n\t\treturn view(\"admin/login\");\n\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 }",
"function logInUser($conn, $username, $password){\n $usernameExists = usernameExists($conn, $username, $username);/* 2 fois car comme ça check pas mail */\n if($usernameExists === false){\n die(header(\"location:\". HTTP_SERVER .\"View/logIn/logIn.php/?error=wronglogin\"));\n }\n $passwordHashed = $usernameExists[\"usersPassword\"];\n $checkPassword = password_verify($password, $passwordHashed);\n\n if (!$checkPassword){\n die(header(\"location:\". HTTP_SERVER .\"View/logIn/logIn.php/?error=wrongpassword\"));\n } else if ($checkPassword === true){\n $_SESSION[\"userId\"] = $usernameExists[\"usersId\"];\n $_SESSION[\"userUsername\"] = $usernameExists[\"usersUsername\"];\n $_SESSION[\"userAccess\"] = $usernameExists[\"usersAccess\"];\n die(header(\"location:\". HTTP_SERVER .\"home.php/?error=loginSuccess\"));\n }\n}",
"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 }",
"static public function ctrIngresoUsuario()\n {\n\n if (isset($_POST['ingEmail'])) {\n if (\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingEmail\"]) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])\n ) {\n\n\n $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $tabla = \"usuarios\";\n $item = \"email\";\n $valor = $_POST[\"ingEmail\"];\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuario($tabla, $item, $valor);\n\n /*Validacion junto con la BD*/\n if ($respuesta[\"email\"] == $_POST[\"ingEmail\"] && $respuesta[\"password\"] == $encriptar) {\n //validacion con la BD si ya esta verficado el email\n if ($respuesta['verificacion'] == 1) {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡NO HA VERIFICADO SU CORREO ELECTRONICO!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise la bandeja de entrada o la carpeta de SPAM, para verifcar la direccion de correo electronico ' . $_POST[\"ingEmail\"] . '\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\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});\n\n\t\t\t\t\t\t</script>';\n } else {\n\n /*Variables de sesion*/\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $respuesta['id'];\n $_SESSION['nombre'] = $respuesta['nombre'];\n $_SESSION['foto'] = $respuesta['foto'];\n $_SESSION['email'] = $respuesta['email'];\n $_SESSION['password'] = $respuesta['password'];\n $_SESSION['modo'] = $respuesta['modo'];\n\n //Utilizando del local storgae, alcenamos la ruta, para cuando inicie sesion, sea redireccionado hacia la ruta\n echo '\n <script> \n window.location = localStorage.getItem(\"rutaActual\");\n </script>\n ';\n\n\n }\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR AL INGRESAR!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise el correo electronico, o la contraseña\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t window.location = localStorage.getItem(\"rutaActual\");\n\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});\n\n\t\t\t\t\t\t</script>';\n }\n\n\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t text: \"¡Error al ingresar al sistema, no se permiten caracteres especiales\",\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\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});\n\n\t\t\t\t\t\t</script>';\n }\n }\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 $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 loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }",
"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}",
"private function logInVOUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(44);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\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 }",
"public function login($usuario) {\n $_SESSION['usuario'] = $usuario;\n }",
"function log_in($user) {\n session_regenerate_id();\n $_SESSION['user_id'] = $user['id'];\n $_SESSION['username'] = $user['username'];\n $_SESSION['email'] = $user['email'];\n return true;\n }",
"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 }",
"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($dados){\n // //$conexao = $c->conexao();\n\n $email = $dados[0];\n $senha = md5($dados[1]);\n\n $sql = \"SELECT a.*, c.permissao FROM tbusuarios a, tbpermissao c WHERE email = '$email' and senha = '$senha' and a.idpermissao = c.idpermissao limit 1 \";\n $row = $this->ExecutaConsulta($this->conexao, $sql);\n\n // print_r($sql);\n\n // $sql=ExecutaConsulta($this->conecta,$sql);\n // $sql = $this->conexao->query($sql);\n // $sql = $this->conexao->query($sql);\n // $row = $sql->fetch_assoc();\n // print_r($row); \n\n if ($row) {\n $_SESSION['chave_acesso'] = md5('@wew67434$%#@@947@@#$@@!#54798#11a23@@dsa@!');\n $_SESSION['email'] = $email;\n $_SESSION['nome'] = $row['nome'];\n $_SESSION['permissao'] = $row['permissao'];\n $_SESSION['idpermissao'] = $row['idpermissao'];\n $_SESSION['last_time'] = time();\n $_SESSION['usuid'] = $row['idusuario'];\n $_SESSION['ip'] = $_SERVER[\"REMOTE_ADDR\"];\n $mensagem = \"O Usuário $email efetuou login no sistema!\";\n $this->salvaLog($mensagem);\n return 1;\n }else{\n return 0;\n }\n\n }",
"function iniciarSesion(){\n session_start();\n\n if(isset($_SESSION['username'])){\n $logged = true;\n $username = $_SESSION['username'];\n $admin = $_SESSION['privilegios'];\n }\n else{\n $logged = false;\n }\n\n if($logged==false){\n echo '<p align=\"right\"> <a href=\"crearUsuario.php\">Crear Usuario</a> <a href=\"Entrar.php\">Entrar</a></p>';return -1;}\n else{\n if($_SESSION[\"expire\"]<time()){ session_unset();\n\n// destroy the session\n session_destroy(); return -1; }\n else {\n echo '<p align=\"right\">Hola,<a href=\"datosSesion.php\">' . $username . '</a>. <a href=\"salirSesion.php\">Salir de sesión</a>';\n }\n }\n\n return $admin;\n}",
"function procesarIniciarSession()\n{\n //se pone global para acceder a las variables globales desde una funcion\n global $usuario;\n global $login;\n global $password;\n global $error;\n\n\n $login = filter_var(strtolower($_POST['txtLogin']), FILTER_SANITIZE_STRING);\n $password = $_POST[\"txtPassword\"];\n\n if ($usuario->loguear($login, $password) == true) {\n //guardar datos en la session \n // $_SESSION[\"login_usuario\"]=$login;\n // $_SESSION[\"id_usuario\"] = $cliente->get_id();\n // $_SESSION[\"nombre_usuario\"] = $cliente->get_nombre();\n Ctrl_Session::iniciar_session($login, $usuario->get_id(), $usuario->get_nombre());\n header(\"location:formularios/index.php?msg=logueado correctamente\");\n } else {\n $error = \"Error al iniciar revise sus datos de acceso\";\n }\n}",
"function login($usuario,$pass){\n // Método 1:\n // $usuario = self::db()->quote($usuario);\n // $user=self::db()->query(\"select * from usuarios where usuario=$usuario\")->fetch(PDO::FETCH_OBJ);\n\n // Método 2: \n $stmt=self::db()->prepare(\"select * from usuarios where usuario=:usuario\");\n $stmt->bindParam(':usuario',$usuario);\n $stmt->execute();\n $user=$stmt->fetch(PDO::FETCH_OBJ);\n\n if(!$user || $user->password!=md5($pass))\n return false;\n else {\n $_SESSION['usuario']=$user;\n return true;\n }\n \n }",
"public function loginUsers($data) {\n try {\n $sql = \"SELECT usua_cedula, usua_contrasena FROM usuario WHERE usua_cedula = ?\";\n $query = $this->pdo->prepare($sql);\n $valid = $query->execute(array($data[0]));\n $valid= $query->fetch();\n\n if (password_verify($data[1], $valid[1])) { // Condicional para validar contrasena si es igual\n $sql1 = \"SELECT u.usua_id, CONCAT(UPPER(LEFT(u.usua_nombre1, 1)), LOWER(SUBSTRING(u.usua_nombre1,2))) AS usua_nombre1, u.usua_nombre2, CONCAT(UPPER(LEFT(u.usua_apellido1, 1)), LOWER(SUBSTRING(u.usua_apellido1,2))) AS usua_apellido1, u.usua_apellido2, u.usua_cedula, u.carg_id,\n u.usua_contrasena, u.clien_id, u.usua_estado, u.usua_modifica, u.usua_ingreso, u.sed_id, u.area_id\n FROM usuario AS u\n WHERE usua_cedula = ? \";\n $query = $this->pdo->prepare($sql1);\n $const= $query->execute(array($data[0]));\n $const= $query->fetch();\n\n if ($const[9] === \"1\" && $const[11] === \"1\") {\n session_start(); // Variables para iniciar session\n $_SESSION[\"validar\"] = true;\n $_SESSION[\"nombre\"] = $const[1];\n $_SESSION[\"apellido\"] = $const[3];\n $_SESSION[\"idusuario\"] = $const[0];\n $_SESSION[\"cargo\"] = $const[6];\n $_SESSION[\"idcliente\"] = $const[8];\n $_SESSION[\"sede\"] = $const[12];\n return true;\n }else if ($const[11] === \"0\" && $const[9] === \"1\"){\n session_start(); // Variables para iniciar session\n $_SESSION[\"cedula\"] = $const[5];\n return \"successpassword\";\n }\n }else {\n return \"authentication\";\n }\n\n } catch (Exception $e) {\n die($e->getMessage());\n }\n\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 ctrIngresoUsuario(){\n\n\t\t\tif(isset($_POST[\"ingresoUsuario\"])){\n\n\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9 ]+$/', $_POST[\"ingresoUsuario\"]) && \n\t\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t\t\t$tabla= \"administrador\";\n\t\t\t\t\t$item =\"usuario\";\n\n\t\t\t\t\t$valor = $_POST[\"ingresoUsuario\"];\n\t\t\t\t\t$respuesta = AdministradorModelo::mdlMostrarUsuario($tabla,$item,$valor);\n\n\t\t\t\t\tif($respuesta != null){\n\n\t\t\t\t\t\t if($respuesta[\"usuario\"]==$_POST[\"ingresoUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingresoPassword\"]){\n\n\t\t\t\t\t\t\tif($respuesta[\"estado\"]==1){\n\n\t\t\t\t\t\t\t\t$_SESSION[\"verificarUsuarioB\"]=\"ok\";\n\t\t\t\t\t\t\t\t$_SESSION[\"idUsuarioB\"]=$respuesta[\"id_admin\"];\n\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\twindow.location = \"'.$_SERVER[\"REQUEST_URI\"].'\";\n\t\t\t\t\t\t\t </script>';\n\n\n\t\t\t\t\t\t\t}else {\n\n\t\t\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t\t\t\t\t<span>¡ERROR AL INGRESAR!</span> El usuario está desactivado.\n\t\t\t\t\t\t\t\t </div>';\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t\t\t<span>¡ERROR AL INGRESAR!</span> Su contraseña y/o usario no es correcta, Intentelo de nuevo.\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t}\n\t\t\t\t\n\n\n\t\t\t\t}else {\n\n\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t<span>¡ERROR!</span> no se permite caracteres especiales.\n\t\t\t\t\t</div>';\n\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\n\t}",
"function loginThrowSession()\n {\n\n // define all the global variables\n global $database, $message, $user;\n\n if (isset($_SESSION['user_data']) || !empty($_SESSION['user_data'])) {\n\n // update the user_data that was stored in the session\n $user_data = $_SESSION['user_data'];\n\n // call the database to store the new session data\n $sql = \"SELECT * FROM \" . TBL_USERS . \" WHERE \" . TBL_USERS_ID . \" = \" . $user_data[TBL_USERS_ID] . \" AND \" . TBL_USERS_USERNAME . \" = '\" . $user_data[TBL_USERS_USERNAME] . \"'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n $message->setError(\"Error while puling the user's required fields.\", Message::Error);\n return false;\n }\n\n // check if the user exists\n if ($database->getQueryNumRows($result, true) < 1) {\n return false;\n }\n\n $row = $database->getQueryEffectedRow($result, true);\n\n // ** Update the current session data ** //\n foreach ($row As $rowName => $rowValue) {\n $_SESSION[\"user_data\"][$rowName] = $rowValue;\n }\n\n // check if user has to log in again\n if ($user->mustSignInAgain()) {\n\n // ** Unset the session & cookies ** //\n unset($_SESSION[\"user_data\"]);\n unset($_COOKIE[\"user_data\"]);\n unset($_COOKIE[\"user_id\"]);\n setcookie(\"user_data\", null, -1, '/');\n setcookie(\"user_id\", null, -1, '/');\n\n // update the database so that the user can log in again\n $sql = \"UPDATE \" . TBL_USERS . \" SET \" . TBL_USERS_SIGNIN_AGAIN . \" = '0' WHERE \" . TBL_USERS_ID . \" = '\" . $user->getID() . \"' AND \" . TBL_USERS_USERNAME . \" = '\" . $user->getUsername() . \"'\";\n\n // get the sql results\n $database->getQueryResults($sql);\n if ($database->anyError()) {\n return false;\n }\n\n $message->setError(\"You've been logged out for security reasons\", Message::Error);\n return false;\n }\n\n // initiate the user data\n $user->initUserData();\n\n return true;\n } else {\n return false;\n }\n }",
"function login() {\n\n if(isset($_POST['login'])) {\n\n $username = escape_string($_POST['username']);\n $psw = escape_string($_POST['psw']);\n\n $query = query(\"SELECT * FROM utenti WHERE username = '{$username}' LIMIT 1\");\n confirm($query);\n\n $row = fetch_array($query);\n\n if(mysqli_num_rows($query) == 0 || password_verify($psw, $row['password']) === false) {\n set_message(\"La tua password o il tuo username sono sbagliati\", \"alert-danger\");\n redirect(\"login.php\");\n }\n else {\n $_SESSION['user'] = $row['username'];\n redirect(\"admin/\");\n }\n\n }\n\n}",
"function usuario_logado()\n{\n if (isset($_COOKIE[\"usuario\"])) {\n $_SESSION[\"usuario\"] = $_COOKIE[\"usuario\"];\n $_SESSION[\"nome\"] = $_COOKIE[\"nome\"];\n }\n if (isset($_SESSION[\"usuario\"])) {\n echo \"<h3>Usuario: \" . $_SESSION[\"nome\"];\n echo \" (<a href=db_logout.php>Sair</a>)</h3>\";\n }\n}",
"public function ConnectUsers(){\r\n $this->emailPost();\r\n $this->passwordPost();\r\n \r\n $_SESSION['email'] = $this->_emailPostSecure;\r\n $_SESSION['password'] = $this->_passwordPostSecure;\r\n header('location: Accueil');\r\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}",
"function verificaLogin($errores,$db) {\r\n $email=$_POST['email'];\r\n $password=$_POST['password'];\r\n $encontreUsuario=false;\r\n $encontrePassword=false;\r\n $stmt=$db->prepare(\"SELECT * FROM jugadores where email=:email\");\r\n $stmt->bindValue(':email',$email);\r\n $stmt->execute();\r\n $consulta=$stmt->fetch(PDO::FETCH_ASSOC);\r\n if($consulta>0){\r\n $encontreUsuario=true;\r\n $contraseniaValida=password_verify($password,$consulta['password']);\r\n if($contraseniaValida){\r\n $_SESSION['usuario']=$consulta['usuario'];\r\n $_SESSION['nombre']=$consulta['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n $errores[]=\"Verifique los datos\";\r\n return $errores;\r\n }\r\n }\r\n else {\r\n $errores[]=\"No existe el usuario\";\r\n return $errores;\r\n }\r\n /*foreach ($usuarioJSON as $usuario)\r\n {\r\n if ($usuario[\"email\"] == $_POST['email']){\r\n $encontreUsuario=true;\r\n //\r\n if(password_verify($_POST[\"password\"], $usuario[\"password\"])){\r\n $_SESSION['usuario']=$usuario['usuario'];\r\n $_SESSION['nombre']=$usuario['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if($encontreUsuario!=true){\r\n array_push($errores,'Por Favor verifique el nombre de usuario');\r\n }\r\n if ($encontrePassword!=true) {\r\n array_push($errores,'Contraseña incorrecta');\r\n }\r\n return $errores;*/\r\n}",
"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 }",
"static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\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\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\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}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"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}",
"private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }",
"public function postLogin() //Debo tener también para post porque es el método del formulario y aquí es donde se llenará y enviará.\n {\n \n global $pdo;\n\n $errors = [];\n\n $validator = new Validator();\n $validator->add('name', 'required');\n $validator->add('password', 'required');\n\n if ($validator->validate($_POST)) { //Para verificar que cumpla con las validaciones.\n $sql = 'SELECT * FROM users WHERE name = :name';\n $query = $pdo->prepare($sql);\n $query->execute(['name' => $_POST['name']]);\n\n $user = $query->fetch(PDO::FETCH_OBJ); //Para convertir la consulta en un objeto con nombres de propiedades que se corresponden a los nombres de las columnas.\n if ($user) { //Si existe el usuario\n if (password_verify($_POST['password'], $user->password)) { //Si la contraseña es correcta. El password_verify() es para descifrar la contraseña ingresada con el método password_hash() de encriptación usado.\n $_SESSION['userID'] = $user->id; //Guardo el id del usuario en una variable de sesión para poder identificar si hay una sesión iniciada, además así la puedo usar en el RolController.\n header('Location:' . BASE_URL . 'rol'); //Redireccionar a la ruta para identificar el tipo de rol del usuario.\n return null;\n }\n }\n\n $validator->addMessage('name', 'Nombre de usuario y/o contraseña incorrectos.'); //Si no se encuentra el usuario, se deja la duda en el mensaje de si estuvo mal la contraseña o el nombre para mayor seguridad.\n }\n\n $errors = $validator->getMessages();\n\n //Vista a la que se quiere acceder\n return render('../views/login.php', ['errors' => $errors]);\n }",
"public function actionLogin() {\n\t\t$this->layout='//layouts/main';\n\t\t//només deixem loggejar si no ho està\n\t\tif (!Yii::app() -> user -> isGuest) {\n\t\t\tYii::app() -> user -> setFlash('warning', Yii::t('SVGA', 'Ja tens la sessió iniciada!'));\n\t\t\t$this -> redirect($this -> createUrl(Yii::app() -> homeUrl));\n\t\t} \n\t\telse {\n\t\t\t$form = new LoginForm();\n\t\t\tif (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['Usuarisvga'])) {\n\t\t\t\t\t$user = new UserIdentity($_POST['Usuarisvga']['username'], $_POST['Usuarisvga']['password']);\n\t\t\t\t\t$result = $user -> authenticate();\n\t\t\t\t\tif ($result == PasswordIdentity::CREDENTIALS_ERROR) {\n\t\t\t\t\t\tYii::app() -> user -> setFlash('danger', Yii::t('SVGA', 'Usuari i/o contrasenya incorrecte'));\n\t\t\t\t\t}\n\t\t\t\t\telse if ($result == PasswordIdentity::OK) {\n\n\t\t\t\t\t\tYii::app() -> user -> login($user);\n\n\t\t\t\t\t\tYii::app() -> user -> setFlash('success', Yii::t('SVGA', 'Sessió iniciada correctament!'));\n\t\t\t\t\t\t$this -> redirect(Yii::app() -> user -> returnUrl);\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tYii::app() -> user -> setFlash('danger', Yii::t('SVGA', 'Error en iniciar la sessió'));\n\t\t\t\t}\n\t\t\t\t$form -> password = '';\n\t\t\t}\n\t\t\tif (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['LoginForm'])) {\n\t\t\t\t//ens estan enviant dades per iniciar sessió\n\t\t\t\t$user = new PasswordIdentity($_POST['LoginForm']['email'], $_POST['LoginForm']['password']);\n\t\t\t\t$result = $user -> authenticate();\n\t\t\t\tif ($result == PasswordIdentity::CREDENTIALS_ERROR) {\n\t\t\t\t\tYii::app() -> user -> setFlash('danger', Yii::t('SVGA', 'Usuari i/o contrasenya incorrecte'));\n\t\t\t\t} else if ($result == PasswordIdentity::EMAIL_NOT_ACTIVATED) {\n\t\t\t\t\tYii::app() -> user -> setFlash('danger', Yii::t('SVGA', 'Encara no has confirmat la teva direcció de correu electrònic!'));\n\t\t\t\t} else if ($result == PasswordIdentity::NOT_ACTIVATED) {\n\t\t\t\t\tYii::app() -> user -> setFlash('danger', Yii::t('SVGA', 'Aquest compte està desactivat'));\n\t\t\t\t} else if ($result == PasswordIdentity::OK) {\n\n\t\t\t\t\tYii::app() -> user -> login($user);\n\n\t\t\t\t\tYii::app() -> user -> setFlash('success', Yii::t('SVGA', 'Sessió iniciada correctament!'));\n\t\t\t\t\t$this -> redirect(Yii::app() -> user -> returnUrl);\n\t\t\t\t} else {\n\t\t\t\t\tYii::app() -> user -> setFlash('danger', Yii::t('SVGA', 'Error en iniciar la sessió'));\n\t\t\t\t}\n\n\t\t\t\t$form -> password = '';\n\t\t\t\t$this -> render('login', array('formModel' => $form));\n\t\t\t} \n\t\t\telse {\n\t\t\t\t//mostrem el formulari\n\t\t\t\t$this -> render('login', array('formModel' => $form));\n\t\t\t}\n\t\t}\n\t}",
"public function login($datos)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from usuarios WHERE nombre_usuario=:correo && password=:contrasena');\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n if($stmt->execute())\n {\n $respuesta = $stmt->rowCount();\n $resultado =$stmt->fetch();\n //Si el resultado returna mayor que uno es que si existe el usuario asi que inicia la sesion\n if($resultado[\"count(*)\"]>0)\n {\n return \"Datos no validos\";\n }else\n {\n session_start();\n $_SESSION[\"correo\"]=$resultado[\"correo\"];\n $_SESSION[\"nombre\"]=$resultado[\"nombre\"];\n return \"Correcto\";\n }\n\n \n }else\n {\n return \"error\";\n }\n }",
"public function login(){\n \t$M_User = new M_User();\n\n \t// Default view\n $view = LOGIN_PAGE;\n $options = [\n 'errors' => array(), // Form errors array\n 'title' => 'Connexion', // Page title\n 'script' => self::ENCRYPTION_URL, // SHA256 encryption script URL\n 'action' => 'Users/login' // Route\n ];\n\n helper(['form', 'url','cookie']);\n\n $request = $this->request->getPostGet('user');\n\n // Has a cookie been set ?\n\t\tif (empty($_COOKIE[SESSION_REMEMBER_ME])) {\n \n // The validation process returned some errors\n\t\t\tif (!$this->validate($this->loginRules) && $this->request->getRawInput() != null) {\n $options['errors'] = $this->validator->getErrors();\n }\n // The validation process ran without any error\n\t\t\telseif ($this->validate($this->loginRules)) {\n\t\t\t\t// The given credentials have been verified, a new session is opened\n\t\t\t\tif ($M_User->verifyLogin($request['email'], $request['password'])) {\n \n /** @var E_User $loggedUser */\n\t\t\t\t\t$loggedUser = $M_User->findOneBy(\"email\", $request['email']);\n\n\t\t\t\t\t// Defining session data for the logged user\n\t\t\t\t\t$userData = [\n 'id' => $loggedUser->getId(),\n 'email' => $loggedUser->getEmail(),\n 'roles' => $loggedUser->getRoles(),\n 'logged_in' => TRUE\n ];\n\t\t\t\t\tsession()->set($userData);\n\n\t\t\t\t\t$ret = redirect()->to(base_url());\n\n\t\t\t\t\t// \"Remember me\" checkbox checked ?\n\t\t\t\t\tif ($request['rememberMe'] != null) {\n\t\t\t\t\t\t// Encrypting logged user's email with BCRYPT\n\t\t\t\t\t\t$cookieToken = password_hash($loggedUser->getEmail(), PASSWORD_BCRYPT);\n\t\t\t\t\t\t// Saving it in the DB\n\t\t\t\t\t\t$M_User->setCookieToken($loggedUser->getEmail(), $cookieToken);\n\t\t\t\t\t\t// Setting the cookie for 21 days (86400 seconds * 21 days = 3 weeks)\n\t\t\t\t\t\t$ret = $ret->setCookie(SESSION_REMEMBER_ME, $cookieToken, 86400*21); // TODO -> Constant\n\t\t\t\t\t}\n\t\t\t\t\t// Setting options to null so the return value is not overwritten\n\t\t\t\t\t$options = null;\n\t\t\t\t} else {\n\t\t\t\t\t// The given credentials could not be verified\n\t\t\t\t\t$options['errors'] = ['user.password' => 'Identifiants incorrects'];\n\t\t\t\t}\n\t\t\t}\n }\n else{\n\t\t\t// A cookie exists for the user\n\t\t\t// Retrieving the corresponding user data\n\t\t\t$loggedUser = $M_User->findOneBy(\"cookieToken\", $_COOKIE[SESSION_REMEMBER_ME]);\n\n\t\t\t// Defining session data for the logged user\n\t\t\t$userData = [\n\t\t\t\t'id' => $loggedUser->getId(),\n\t\t\t\t'email' => $loggedUser->getEmail(),\n\t\t\t\t'roles' => $loggedUser->getRoles(),\n\t\t\t\t'logged_in' => TRUE\n\t\t\t];\n\t\t\tsession()->set($userData);\n\n\t\t\t$ret = redirect()->to(base_url());\n\t\t\t$options = null;\n }\n\n\t\t// If options = NULL : everything went well; otherwise : re displaying the login form\n\t\tif ($options != null) {\n\t\t\t$ret = render($view, $options);\n }\n\n\t\treturn $ret;\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 }",
"function verificarlogin(){\n\t\t//Verificar si estan los datos\n\t\tif((!isset($_POST[\"nomUsuario\"]) || (!isset($_POST[\"pass\"])))){\n\n\t\t}\n\t\t//Variables a usar\n\t\t$nomUsuario=$_POST['nomUsuario'];\n \t\t$contrasenia=$_POST['pass'];\n \t\t//Se llama al metodo y pasan parametros\n \t\t$verificar = Usuario::verificarUsuario($nomUsuario,$contrasenia);\n \t\tif(!$verificar){\n \t\t\t $estatus = \"Datos incorrectos\";\n \t\t\trequire \"app/Views/login.php\";\n\n }else{\n \n \t\t // $_SESSION['Usuarios']=$verificar;\n \t$_SESSION['Usuarios']=$nomUsuario;\n header(\"Location:/Proyecto/index.php?controller=Publicaciones&action=home\");\n }\n\n\t}",
"function Authentification($login, $password)\r\n{\r\n if ($password == 'toto') {\r\n $_SESSION['login'] = $login;\r\n }\r\n}",
"public function invalidateCurrentLogin();",
"function initSession($usuario, $tipo, $codigo_usuario) {\r\n //include 'credenciales.php';\r\n \r\n //Iniciando la sesión en el servidor\r\n session_start();\r\n \r\n if($_SESSION[\"logged\"] == null || $_SESSION[\"logged\"] == false) {\r\n //Seteando las variables que permitirán saber si ha sido logueado el usuario\r\n $_SESSION[\"logged\"] = true;\r\n $_SESSION[\"usuario\"] = $usuario;\r\n $_SESSION[\"tipo\"] = $tipo;\r\n $_SESSION[\"codigo\"] = $codigo_usuario;\r\n \r\n echo '<br> Sesión iniciada<br>';\r\n \r\n }\r\n else {\r\n echo '<br> Sesión existente<br>';\r\n }\r\n}",
"function login_user($user,$pass,$activo=false,$h=false){\n $c = ($h)?$pass:md5($pass);\n $sql = sprintf(\"SELECT * FROM `login` WHERE `email` = %s AND `contrasena` = %s AND `cloud` = %s LIMIT 1\",\n varSQL($user),\n varSQL($c),\n varSQL(__sistema));\n $datos = consulta($sql,true);\n if($datos != false){\n $_SESSION['usuario'] = $datos['resultado'][0]['id'];\n $_SESSION['session_key']= md5($pass);\n //obtener los datos adicionales del usuario en cuestion de acuerdo al perfil de usuario que pertenesca\n $sql = sprintf(\"SELECT * FROM `%s` WHERE `id_login` = %s\",(obtener_campo(sprintf(\"SELECT `tabla` FROM `usuarios_perfiles_link` WHERE `id_perfil` = %s\",varSQL($datos['resultado'][0]['perfil'])))),varSQL($datos['resultado'][0]['id']));\n $datos1 = consulta($sql,true);\n if($datos1!=false){\n unset($datos1['resultado'][0]['id']);\n $d = array_merge($datos['resultado'][0],$datos1['resultado'][0]);\n $_SESSION['data_login'] = $d;\n }else{\n $_SESSION['data_login'] = $datos['resultado'][0];\n }\n //obteniendo los detalles de los modulos disponibles para cada usuario\n $con = sprintf(\"SELECT * FROM `componentes_instalados` WHERE `id` IN(SELECT `id_componente` FROM `usuarios_perfiles_permisos` WHERE `id_perfil` = %s)\",varSQL($datos['resultado'][0]['perfil']));\n $r = consulta($con,true);\n //detalles del perfil\n $p = consulta(sprintf(\"SELECT `nombre`,`p` FROM `usuarios_perfiles` WHERE `id` = %s\",varSQL($datos['resultado'][0]['perfil'])),true);\n $_SESSION['usuario_perfil'] = $p['resultado'][0];\n $_SESSION['usuario_componentes'] = $r['resultado'];\n $detalles = array(\"estado\"=>\"ok\",\"detalles\"=>\"\");\n }else{\n $_SESSION['usuario']='';\n $_SESSION['session_key']='';\n $detalles = array(\"estado\"=>\"error\",\"detalles\"=>\"no_log_data\",\"mensaje\"=>\"Nombre de usuario o contraseña incorrecta\");\n }\n return $detalles;\n}",
"function logInAndForward() {\n global $session, $conn, $MAX_SESSION_AGE;\n if ($session === null) {\n if (isset($_POST[\"username\"]) && isset($_POST[\"password\"])) {\n $username = $_POST[\"username\"];\n $password = $_POST[\"password\"];\n\n $getPasswd = $conn -> prepare(\"\nselect password_hash, pk_user_id from user\nwhere username = :user\");\n $getPasswd -> bindParam(\":user\", $username);\n $getPasswd -> execute();\n if ($getPasswd -> rowCount() > 0) {\n $getPasswd = $getPasswd -> fetch(PDO::FETCH_ASSOC);\n $passwdHash = $getPasswd[\"password_hash\"];\n $userID = $getPasswd[\"pk_user_id\"];\n\n if (password_verify($password, $passwdHash)) {\n $sessionID = hash(\"sha3-512\", openssl_random_pseudo_bytes(2056));\n $createSession = $conn -> prepare(\"\ninsert into session (pk_session_id, fk_user_id)\nvalues (:session_id, :user_id)\");\n $createSession -> bindParam(\":session_id\", $sessionID);\n $createSession -> bindParam(\":user_id\", $userID);\n $createSession -> execute();\n setcookie(\"sessionID\", $sessionID, time() + $MAX_SESSION_AGE, \"/\");\n\n mainPage();\n\n } else {\n\n loginPage(\"invalid_user\");\n\n }\n } else {\n\n loginPage(\"invalid_user\");\n\n }\n } else {\n\n loginPage(\"invalid_user\");\n\n }\n } else {\n\n mainPage();\n\n }\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 }",
"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 }",
"function EstoyLogueado()\n\t{\n\t\tif (!isset($_SESSION['clientecod']) || $_SESSION['clientecod']==0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}",
"function user_login ($user_details) {\n //\n // For security reasons, the password is not stored as it is only required\n // during authentication and not for further identification.\n // Clear the session\n $_SESSION = array();\n $_SESSION['user'] = $user_details;\n $_SESSION['is_user_authenticated'] = true;\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}",
"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 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 }",
"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 guardarUsuario()\n {\n \n //ACCESO A DATOS\n $usu = new Usuario('usuarios');\n if (isset($this->request['usuario']))\n {\n $usu->load(\"id=\".$_SESSION['id']);\n }\n\n $usu->usuario=$this->request['usuario'];\n $usu->password=$this->request['nuevapassword'];\n $usu->fechamodificacion=date('Y-m-d');\n \n \n if($usu->save()){\n $this->cerrarSesion ();\n header('Location: /appnutri/index.php');\n }else echo'<script> \n alert(\"Error. No se pudo cerrar la conexion\") \n window.location=\"/appnutri/index.php\";\n </script>';\n \n }",
"public function doregister() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $useremail=$_POST['useremail'];\n $username=$_POST['username'];\n $password=$_POST['password'];\n $rpassword=$_POST['rpassword'];\n if ($password==$rpassword && !empty($useremail) && !empty($username) && $this->model->putuser($useremail,$password,$username)) {\n $this->view->set('infomessage', \"Użytkownik zarejestrowany!<br>Możesz się teraz zalogować.\");\n $this->view->set('redirectto', \"?v=user&a=login\");\n $this->view->render('info_view');\n } else {\n $this->view->set('errormessage', \"Błędne dane do rejestracji!\");\n $this->view->set('redirectto', \"?v=user&a=register\");\n $this->view->render('error_view');\n }\n }\n }",
"function loginUser($db, $emailadres, $wachtwoord) {\n\t$emailzonderhoofdletters = strtolower($emailadres);\n\t$takenEmail = takenEmail($db, $emailzonderhoofdletters);\n\t\n\tif ($takenEmail === false) {\n\t\theader(\"location: ../login.php?error=verkeerdeLogin\");\n\t\texit;\n\t}\n\n\t$encryptwachtwoord = $takenEmail[\"wachtwoord\"];\n\n\t$checkwachtwoord = password_verify($wachtwoord, $encryptwachtwoord);\n\t\n\tif ($checkwachtwoord === false) {\n\t\theader(\"location: ../login.php?error=verkeerdeLogin\");\n\t\texit;\n\t}elseif ($checkwachtwoord === true) {\n\t\tsession_start();\n\n\t\t$_SESSION[\"klantnummer\"] = $takenEmail[\"klantnummer\"];\n\t\t$_SESSION[\"voornaam\"] = $takenEmail[\"voornaam\"];\n\t\t$_SESSION[\"achternaam\"] = $takenEmail[\"achternaam\"];\n\t\t$_SESSION[\"email\"] = $takenEmail[\"email\"];\n\t\t$_SESSION[\"telefoonnummer\"] = $takenEmail[\"telefoonnummer\"];\n\t\t$_SESSION[\"woonplaats\"] = $takenEmail[\"woonplaats\"];\n\t\t$_SESSION[\"postcode\"] = $takenEmail[\"postcode\"];\n\t\t$_SESSION[\"straatnaam\"] = $takenEmail[\"straatnaam\"];\n\t\t$_SESSION[\"huisnummer\"] = $takenEmail[\"huisnummer\"];\n\n\t\theader(\"location: ../index.php\");\n\t\texit;\n\t}\n}",
"function autenticado(){\n\tif(isset($_SESSION['DNI'])){//Si existe, existe\n\t\treturn true;\n\t}else{//Si no existe, no existe\n\t\treturn false;\n\t}\n}",
"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 }"
] | [
"0.67499024",
"0.66614926",
"0.65676844",
"0.65343386",
"0.65327966",
"0.65325856",
"0.652679",
"0.64687973",
"0.64659995",
"0.6440434",
"0.64241284",
"0.64235526",
"0.64089704",
"0.63879555",
"0.6358569",
"0.63473326",
"0.63448554",
"0.6338781",
"0.6335519",
"0.6323981",
"0.6304811",
"0.63013756",
"0.62867767",
"0.6271186",
"0.62527496",
"0.6248035",
"0.62475413",
"0.6237576",
"0.6237285",
"0.62040085",
"0.6188033",
"0.61816096",
"0.6181126",
"0.61793756",
"0.61701703",
"0.6162582",
"0.61594695",
"0.6153251",
"0.6152179",
"0.61512727",
"0.6147948",
"0.6147262",
"0.6141955",
"0.61384296",
"0.6135585",
"0.613189",
"0.613102",
"0.61290693",
"0.6122207",
"0.6119161",
"0.61188275",
"0.6118597",
"0.61168176",
"0.6116073",
"0.6109911",
"0.6101155",
"0.6100353",
"0.6091963",
"0.6082459",
"0.6064018",
"0.60588723",
"0.60528547",
"0.6046075",
"0.60421205",
"0.6035344",
"0.60332006",
"0.60263526",
"0.6016942",
"0.6016597",
"0.60137814",
"0.6003125",
"0.60020804",
"0.59996957",
"0.59912384",
"0.59878564",
"0.5986263",
"0.59856755",
"0.5983953",
"0.59824425",
"0.59801066",
"0.59789705",
"0.597523",
"0.59683365",
"0.59630924",
"0.59607273",
"0.59564596",
"0.5955691",
"0.5952062",
"0.5951911",
"0.5951692",
"0.59453934",
"0.59389645",
"0.5935403",
"0.5935403",
"0.5935224",
"0.5933856",
"0.5933657",
"0.5926216",
"0.5924329",
"0.591247",
"0.59062743"
] | 0.0 | -1 |
Efetua a instancia??o da classe Model | public function _instanciar_model() {
$Model = ClassRegistry::init('Autenticacao.' . $this->config['model_usuario']);
return $Model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }",
"function __construct () {\n\t\t$this->_model = new Model();\n\t}",
"public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }",
"function __construct() {\r\n parent::Model();\r\n }",
"function __construct()\r\n {\r\n parent::Model();\r\n }",
"public function model();",
"public function model();",
"public function __construct() {\n $this->docenteModel = $this->model('DocenteModel');\n }",
"abstract protected function model();",
"abstract protected function model();",
"function __construct()\n {\n parent::Model();\n }",
"public function __CONSTRUCT(){\n $this->model = new Estadobien();\n }",
"public function __construct()\n {\n $this->model = app()->make($this->model());\n }",
"function __construct() {\n // Call the Model constructor \n parent::__construct();\n }",
"protected abstract function model();",
"public function __construct() {\n\t\t$this->empleadoModel = $this->model('Empleado');\n\t}",
"abstract public function model();",
"abstract public function model();",
"abstract public function model();",
"abstract public function model();",
"public abstract function model();",
"public function createModel()\n {\n }",
"public function __construct() {\n // Call the Model constructor\n parent::__construct();\n }",
"function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }",
"public function model()\n {\n //use model\n }",
"public function __construct()\n {\n parent::Model();\n\n }",
"function __construct() {\n\t\t$this->cotizacionModel = new cotizacionModel();\n\t}",
"public function __construct() {\n // und lädt das zugehörige Model\n $this->userModel = $this->model('User');\n }",
"function __construct() {\n $this->loteModel = new loteModel();\n }",
"public function __construct() {\n $this->porcentajesCursoModel = $this->model('PorcentajesCursoModel');\n $this->tipoModuloModel = $this->model('TipoModuloModel');\n $this->cursoModel = $this->model('CursoModel');\n }",
"public function __construct()\n {\n $this->model = new BaseModel;\n }",
"function __construct(){\n\t\t\t$this->model = new model(); //variabel model merupakan objek baru yang dibuat dari class model\n\t\t\t$this->model->table=\"tb_dosen\";\n\t\t}",
"function __construc()\r\n\t{\r\n\t\tparent::Model();\r\n\t}",
"public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }",
"abstract function model();",
"abstract function model();",
"abstract function model();",
"abstract function model();",
"function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }",
"function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }",
"function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }",
"function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }",
"private function __construct($model)\r\n {\r\n\r\n }",
"public function __construct()\n {\n $this->model = new Post();\n }",
"function __construct()\n\t{\n\t\t// this->model = new Producto();\n\t}",
"function\t__construct()\t{\n\t\t\t\t/* contrutor da classe pai */\n\t\t\t\tparent::__construct();\n\t\t\t\t/* abaixo deverão ser carregados helpers, libraries e models utilizados\n\t\t\t\t\t por este model */\n\t\t}",
"function __construct(){\r\n\t\t$this->database = new Model;\r\n\t}",
"public function __construct(){\n $this->userModel = $this->model('User');\n\n }",
"public static function model()\n {\n return new self;\n }",
"function __construct() {\n $this->model = new HomeModel();\n }",
"public function __construct()\n {\n echo \"constructeur model\";\n }",
"public function __construct()\n {\n \t parent::__construct();\n \t $this->load->model('Modelo');\n }",
"abstract public function instanceModel(): Model;",
"public function __construct()\n {\n $this->model= new Estudiante;\n $this->curso= new Curso;\n $this->usuario= new Usuario;\n $this->centrointeres= new Centrointeres;\n $this->clase= new Clase;\n $this->grado = new Grado;\n $this->asistencia= new Asistencia;\n }",
"function __construct(){\n $this->toko = new M_Toko();\n $this->produk = new M_Produk(); //variabel model merupakan objek baru yang dibuat dari class model\n }",
"public function __construct(){\n\t\t$mysql = MySQL::getInstance(array('localhost', 'root', '', 'amdb'));\n\t\t$this->bewertungsmodel = new Model($mysql, 'bewertung');\n\t\t$this->videomodel = new Model($mysql, 'lied');\n\t}",
"public function __construct() {\n $this->noticia_modelo = $this->modelo('NoticiaModelo');\n }",
"public function __construct()\n\t{\n\t\t// \\ladybug_dump($model);\n\t}",
"public function __construct(Model $model) {\n parent::__construct($model);\n \n }",
"public function __construct(){\n\n\t\t$this->types_model = new Types();\n\t}",
"public function __construct()\n {\n $this->MemberModel = new MemberModel();\n }",
"public function __construct() {\r\n $this->model = new CompanyModel();\r\n }",
"public function __construct()\n {\n $this->modelName = explode('.', Route::currentRouteName())[0];\n $this->model = new Model($this->modelName);\n }",
"public function __construct()\n {\n $this->mkamar = new KamarModel();\n }",
"public function createModel() {\n return null;\n }",
"public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }",
"public function __construct() {\n // load our model\n $this->userModel = $this->model('User'); // will check models folder for User.php\n }",
"public function __construct()\n {\n parent::__construct();\n //METODO CARGADO EN EL MODELO\n $this->load->model(array('PublicacionModel'));\n }",
"function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}",
"function __construct(){\n\t\tparent::__construct();\n\t\t\t$this->set_model();\n\t}",
"public function __construct(){\n $this->user = $this->model('users');\n $this->mailer = $this->model('mailer');\n $this->friendModel = $this->model('Friends_relationship');\n }",
"protected function get_model_obj(){ return new Session_Model(); }",
"public function getModel(){ }",
"public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}",
"public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}",
"function __construct($model)\n {\n $this->model = $model;\n }",
"public function __construct(){\n $this->sliderModel = $this->model('Slider');\n $this->siteInfoModel = $this->model('SiteInfo');\n $this->officeModel = $this->model('Office');\n $this->categoryModel = $this->model('Category');\n $this->brandModel = $this->model('Brands');\n $this->productModel = $this->model('Products');\n $this->imgModel = $this->model('Image');\n }",
"public function __construct () {\n\t\tparent::__construct ();\n\t\t\n\t\tif ($this->models)\n\t\tforeach ($this->models as $model) {\n\t\t\tunset ($this->models[$model]);\n\t\t\t$this->models[$model] = $this->session->getModel ($model,$this);\n\t\t\t$this->$model = $this->models[$model];\n\t\t}\n\t}",
"function FichaDron_model(){\n\t\tparent::__construct();\n\t\t//Cargamos la base de datos\n\t\t$this->load->database();\n\n\t}",
"public function __construct() {\n//to make connection db \n//when you make object from class baseModel Or any child(extends) Class\n\n parent::__construct();\n $this->connecToDB();\n }",
"function __construct(Model $model)\n {\n $this->model=$model;\n }",
"public function __construct()\n\t{\n\t\tif (!$this->model_name)\n\t\t{\n\t\t\t$this->model_name = str_replace('Model_', '', get_class($this));\n\t\t}\n\t\t$this->model_name = strtolower($this->model_name);\n\t\t\n\t\t$this->_initialize_db();\n\t}",
"public function __construct() {\n\t\t\t$this->modelName = 'concreeeeeete';\n\t\t}",
"public function __construct($model)\n {\n //\n $this->model = $model;\n }",
"public function __construct() {\n $this->model = new Model_Jiafuyun_Regulator();\n\t}",
"function __construct(){\n parent::__construct(\"ModelPaciente\");\n }",
"public function __construct(){\n parent::__construct();\n\n // Memanggil model Pasien\n $this->load->model('Pasien');\n }",
"public function __construct(){\n $this->vehicle_model = VehicleModel::getVehicleModel();\n }",
"public function __construct()\n\t{\n\t\t$this->modelProducts = new ProductsModel();\n\t\t/* ********** fin initialisation Model ********** */\n\t}",
"function __construct() {\r\n parent::__construct();\r\n $this->load->model(\"Siswa\"); //constructor yang dipanggil ketika memanggil siswa.php untuk melakukan pemanggilan pada model : siswa_model.php yang ada di folder models\r\n }",
"abstract protected function getModel();",
"abstract public function getModel();",
"function __construct()\n {\n $this->pembeli = new Model_Pembeli();\n }",
"public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }",
"public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }",
"public function __construct($model){\r\n\t\t$this->model = $model;\r\n\t}",
"abstract function getModel();",
"public function __construct(){\n $this->taskHistoryModel = $this->model('TaskHistoryModel');\n }",
"public function __construct( Model $model ) {\n\t\t$this->model = $model;\n\t}",
"public function __construct()\n {\n if (verifyCsrf()) {\n redirect('error/show/csrf');\n exit();\n }\n /**Instancia del Modelo Usuario*/\n $this->usuarioModel = $this->model('Usuario');\n /**Instancia del Modelo Mesas Finales*/\n $this->mesaFinalModel = $this->model('MesaFinal');\n /**Instancia del Modelo Inscripciones Finales*/\n $this->inscripcionFinalModel = $this->model('InscripcionMesa');\n }"
] | [
"0.80193174",
"0.8005423",
"0.7882268",
"0.7790446",
"0.7694262",
"0.76793605",
"0.76793605",
"0.76712567",
"0.75983024",
"0.75983024",
"0.75803226",
"0.7571385",
"0.75544435",
"0.7550826",
"0.754674",
"0.75459206",
"0.7541064",
"0.7541064",
"0.7541064",
"0.7541064",
"0.7537596",
"0.7512575",
"0.74914527",
"0.74794716",
"0.74760675",
"0.7473658",
"0.7471586",
"0.746101",
"0.7454949",
"0.744125",
"0.74259806",
"0.7420686",
"0.7415904",
"0.7407754",
"0.7398947",
"0.7398947",
"0.7398947",
"0.7398947",
"0.7392812",
"0.7392812",
"0.7392812",
"0.7392812",
"0.7387617",
"0.7378418",
"0.7326087",
"0.73014057",
"0.7297513",
"0.72904474",
"0.7265355",
"0.7232918",
"0.72217214",
"0.7184493",
"0.7184332",
"0.7181144",
"0.71776885",
"0.71458536",
"0.7144182",
"0.71425986",
"0.7123618",
"0.71107507",
"0.71095735",
"0.7107942",
"0.7105256",
"0.7103303",
"0.71026546",
"0.7102342",
"0.7094688",
"0.70933974",
"0.70825195",
"0.70739126",
"0.7069162",
"0.70678973",
"0.70567954",
"0.7051732",
"0.7051732",
"0.704491",
"0.7036165",
"0.7035872",
"0.70357275",
"0.7029136",
"0.70274365",
"0.70236266",
"0.70124686",
"0.7011621",
"0.70011663",
"0.70006573",
"0.6997986",
"0.69962627",
"0.69900393",
"0.69879377",
"0.69815123",
"0.69795144",
"0.69720846",
"0.69718647",
"0.69718647",
"0.69713867",
"0.6953162",
"0.69518703",
"0.6946966",
"0.6943113"
] | 0.71847 | 51 |
Atualiza os dados de sess?o do usu?rio logado | public function _atualiza_usuario_sessao($row) {
$session_key = $this->config['prefixo_sessao'] . '.' . $this->config['hashkey'] . '.' . $this->config['model_usuario'];
$ses = $this->Session->read($session_key);
$row = $row["{$this->config['model_usuario']}"];
$ses = array_merge($ses, $row);
$this->Session->write($this->config['prefixo_sessao'] . '.' . $this->config['hashkey'] . '.' . $this->config['model_usuario'], $ses);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }",
"public function salvar(){\n \n\t\t/*\n\t\t\tReceber dados vindos do formulario.\n\t\t*/\n\n\t\t$login = $this->post(\"login\");\n\t\t$senha = $this->post(\"senha\");\n\t\t$senha = md5($senha);\n\t\t$tipo = 2;\n\n\t\t/*\n\t\t\tInserindo dados na tabela usuário.\n\t\t*/\n\t\t$campos = \"(login,senha,tipo)\";\t\t\n\t\t$valores = \"('\".$login.\"','\".$senha.\"','\".$tipo.\"')\";\t\t\n\t\t$tabela = \"usuarios\";\n\t\t\n\t\t$this->insert( $tabela, $campos, $valores );\t\n\t\t\n\t}",
"public function autualizar_dados_login()\n {\n \ttry {\n \t\t \n \t\t$con = FabricaDeConexao::conexao();\n \t\t \n \t\t$sqlquery = 'update usuario set usuario = :usuario,senha=md5(:senha),email = :email where id = :id; ';\n \t\t$stmt->$con-> prepare($sqlquery);\n \t\t$stmt->bindValue(':usuario',$dados->usuario);\n \t\t$stmt->bindValue(':senha',$dados->senha);\n \t\t$stmt->bindValue(':email',$dados->email);\n \t\t$stmt->bindValue(':id',$dados->id);\n \t\t\n \t\t$stmt->execute();\n \t\t$rowaf = $stmt->rowCount();\n \t\treturn $rowaf;\n \t}\n \tcatch (PDOException $ex)\n \t{\n \t\techo \"Erro: \".$ex->getMessage();\n \t}\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 set_session()\r\n {\r\n $usuario = $this->session->userdata('id_usuario');\r\n \r\n $this->db->set('sesion_activa','t');\r\n $this->db->where('id_usuario',$usuario);\r\n $this->db->update('usuarios');\r\n \r\n $this->session->set_userdata('sesion_activa','t');\r\n }",
"public function loginUsuario($login = '', $clave = '') {\n $password = md5($clave);\n $this->consulta = \"SELECT * \n FROM usuario \n WHERE login = '$login' \n AND password = '$password' \n AND estado = 'Activo' \n LIMIT 1\";\n\n if ($this->consultarBD() > 0) {\n $_SESSION['LOGIN_USUARIO'] = $this->registros[0]['login'];\n $_SESSION['ID_USUARIO'] = $this->registros[0]['idUsuario'];\n $_SESSION['PRIVILEGIO_USUARIO'] = $this->registros[0]['privilegio'];\n $_SESSION['ACTIVACION_D'] = 0;\n// $_SESSION['ACCESOMODULOS'] = $this->registros[0]['accesoModulos'];\n\n $tipoUsuario = $this->registros[0]['tipoUsuario'];\n\n switch ($tipoUsuario) {\n case 'Empleado':\n $idEmpleado = $this->registros[0]['idEmpleado'];\n $this->consulta = \"SELECT primerNombre, segundoNombre, primerApellido, segundoApellido, cargo, cedula, tipoContrato \n FROM empleado \n WHERE idEmpleado = $idEmpleado \n LIMIT 1\";\n $this->consultarBD();\n// $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['ID_EMPLEADO'] = $idEmpleado;\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['primerApellido'];\n $_SESSION['CARGO_USUARIO'] = $this->registros[0]['cargo'];\n $_SESSION['TIPO_CONTRATO'] = $this->registros[0]['tipoContrato'];\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['segundoNombre'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['primerApellido'] . ' ' . $this->registros[0]['segundoApellido'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Residencial':\n $idResidencial = $this->registros[0]['idResidencial'];\n $this->consulta = \"SELECT nombres, apellidos, cedula \n FROM residencial \n WHERE idResidencial = $idResidencial \n LIMIT 1\";\n $this->consultarBD();\n $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['nombres'] . ' ' . $apellidos[0];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Residencial';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['nombres'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['apellidos'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Corporativo':\n $idCorporativo = $this->registros[0]['idCorporativo'];\n $this->consulta = \"SELECT razonSocial, nit \n FROM corporativo \n WHERE idCorporativo = $idCorporativo \n LIMIT 1\";\n\n $this->consultarBD();\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Corporativo';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['nit'];\n break;\n case 'Administrador':\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = 'Administrador';\n $_SESSION['CARGO_USUARIO'] = 'Administrador';\n $_SESSION['TIPO_CONTRATO'] = 'Laboral Administrativo';\n\n $_SESSION['NOMBRES_USUARIO'] = 'Administrador';\n $_SESSION['APELLIDOS_USUARIO'] = 'Administrador';\n $_SESSION['CEDULA_USUARIO'] = '10297849';\n $_SESSION['ID_EMPLEADO'] = '12';\n $_SESSION['ID_CAJA_MAYOR_FNZAS'] = 2;\n $idEmpleado = 12;\n break;\n default:\n break;\n }\n\n //******************************************************************\n // VARIABLES DE SESSION PARA EL ACCESO AL MODULO RECAUDOS Y FACTURACION DE swDobleclick\n\n $_SESSION['user_name'] = $_SESSION['NOMBRES_APELLIDO_USUARIO'];\n $_SESSION['user_charge'] = $_SESSION['CARGO_USUARIO'];\n\n $_SESSION['user_id'] = 0; //$this->getIdUsuarioOLD($idEmpleado);\n $_SESSION['user_privilege'] = 0; //$this->getPrivilegioUsuarioOLD($idEmpleado);\n\n //******************************************************************\n\n $fechaHora = date('Y-m-d H:i:s');\n $idUsuario = $_SESSION['ID_USUARIO'];\n $consultas = array();\n $consultas[] = \"UPDATE usuario \n SET fechaHoraUltIN = '$fechaHora' \n WHERE idUsuario = $idUsuario\";\n $this->ejecutarTransaccion($consultas);\n return true;\n } else {\n return false;\n }\n }",
"private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }",
"public function Logueo()\n{\nself::SetNames();\nif(empty($_POST[\"usuario\"]) or empty($_POST[\"password\"]))\n{\n\techo \"<div class='alert alert-danger'>\";\n\techo \"<span class='fa fa-info-circle'></span> LOS CAMPOS NO PUEDEN IR VACIOS\";\n\techo \"</div>\";\t\t\n\texit;\n}\n$pass = sha1(md5($_POST[\"password\"]));\n$sql = \" SELECT * FROM usuarios WHERE usuario = ? and password = ? and status = 'ACTIVO'\";\n$stmt = $this->dbh->prepare($sql);\n$stmt->execute( array( $_POST[\"usuario\"], $pass));\n$num = $stmt->rowCount();\nif($num == 0)\n{\n\techo \"<div class='alert alert-danger'>\";\n\techo \"<span class='fa fa-info-circle'></span> LOS DATOS INGRESADOS NO EXISTEN\";\n\techo \"</div>\";\t\t\n\texit;\n}\nelse\n{\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[]=$row;\n\t\t}\n\t\t\n\t\t$_SESSION[\"codigo\"] = $p[0][\"codigo\"];\n\t\t$_SESSION[\"cedula\"] = $p[0][\"cedula\"];\n\t\t$_SESSION[\"nombres\"] = $p[0][\"nombres\"];\n\t\t$_SESSION[\"nrotelefono\"] = $p[0][\"nrotelefono\"];\n\t\t$_SESSION[\"cargo\"] = $p[0][\"cargo\"];\n\t\t$_SESSION[\"email\"] = $p[0][\"email\"];\n\t\t$_SESSION[\"usuario\"] = $p[0][\"usuario\"];\n\t\t$_SESSION[\"nivel\"] = $p[0][\"nivel\"];\n\t\t$_SESSION[\"status\"] = $p[0][\"status\"];\n\t\t\n\t\t$query = \" insert into log values (null, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1,$a);\n\t\t$stmt->bindParam(2,$b);\n\t\t$stmt->bindParam(3,$c);\n\t\t$stmt->bindParam(4,$d);\n\t\t$stmt->bindParam(5,$e);\n\t\t\n\t\t$a = strip_tags($_SERVER['REMOTE_ADDR']);\n\t\t$b = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t$c = strip_tags($_SERVER['HTTP_USER_AGENT']);\n\t\t$d = strip_tags($_SERVER['PHP_SELF']);\n\t\t$e = strip_tags($_POST[\"usuario\"]);\n\t\t$stmt->execute();\n\n\t\t\n\t\tswitch($_SESSION[\"nivel\"])\n\t\t{\n\t\t\tcase 'ADMINISTRADOR':\n\t\t\t$_SESSION[\"acceso\"]=\"administrador\";\n\n\t\t\t?>\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\twindow.location=\"panel\";\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t\tbreak;\n\t\t\tcase 'CAJERO':\n\t\t\t$_SESSION[\"acceso\"]=\"cajero\";\n\t\t\t?>\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\twindow.location=\"panel\";\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t\tbreak;\n\t\t\tcase 'COCINERO':\n\t\t\t$_SESSION[\"acceso\"]=\"cocinero\";\n\t\t\t?>\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\twindow.location=\"panel\";\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t\tbreak;\n\t\t\tcase 'MESERO':\n\t\t\t$_SESSION[\"acceso\"]=\"mesero\";\n\t\t\t?>\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\twindow.location=\"panel\";\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t\tbreak;\n\t\t\tcase 'REPARTIDOR':\n\t\t\t$_SESSION[\"acceso\"]=\"repartidor\";\n\t\t\t?>\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\twindow.location=\"panel\";\n\t\t\t</script>\n\n\t\t\t<?php\n\t\t\tbreak;\n\t\t//}\n\t}\n}\n\t//print_r($_POST);\n\texit;\n}",
"function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}",
"public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }",
"public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }",
"public function guardarUsuario()\n {\n \n //ACCESO A DATOS\n $usu = new Usuario('usuarios');\n if (isset($this->request['usuario']))\n {\n $usu->load(\"id=\".$_SESSION['id']);\n }\n\n $usu->usuario=$this->request['usuario'];\n $usu->password=$this->request['nuevapassword'];\n $usu->fechamodificacion=date('Y-m-d');\n \n \n if($usu->save()){\n $this->cerrarSesion ();\n header('Location: /appnutri/index.php');\n }else echo'<script> \n alert(\"Error. No se pudo cerrar la conexion\") \n window.location=\"/appnutri/index.php\";\n </script>';\n \n }",
"function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }",
"public function cadastrar()\n\t{\n\t\t//conexao com o banco\n\t\t$connect = new Connect('user_login');\n\n\t\t$this->id = $connect->insert([\n\t\t\t\t'login'=> $this->login,\n\t\t\t\t'password'=> $this->password\n\t\t]);\n\n\t}",
"public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }",
"public function persist() {\n $bd = BD::getConexion();\n $sqlInsertUsuario = \"insert into usuarios (nomUsuario, clave) values (:nomUsuario, :clave)\";\n $sthSqlInsertUsuario = $bd->prepare($sqlInsertUsuario);\n $result = $sthSqlInsertUsuario->execute([\":nomUsuario\" => $this->nomUsuario, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }",
"function conectar(){\n global $Usuario;\n global $Clave;\n global $_SESSION;\n $this->dataOrdenTrabajo->SetUserName($Usuario);\n $this->dataOrdenTrabajo->SetUserPassword($Clave);\n $this->dataOrdenTrabajo->SetDatabaseName($_SESSION['database']);\n $this->dataOrdenTrabajo->setConnected(true);\n }",
"private function __setSessionLoginUsuario($usuario) {\n $sessionUsuario = ['id' => $usuario->id, 'email' => $usuario->email];\n $usuario->last_login = date('Y-m-d H:i:s');\n $usuario->save();\n $this->session->set('Usuario', $sessionUsuario);\n return;\n }",
"static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\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\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\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}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function saveToSession()\n {\n $_SESSION[PMF_SESSION_CURRENT_USER] = $this->getUserId();\n }",
"public function saveToDatabase() {\n if($this->id != 0) {\n $dbResult = System::database()->query('update :table_users \n set `role_id` = :role_id, \n `login` = :login, \n `password` = :password, \n `auth_key` = :auth_key, \n `auth_expire` = :auth_expire, \n `last_login` = :last_login\n where `id` = :id');\n \n $dbResult->bindInt(':id', $this->id);\n $dbResult->bindValue(':auth_key', $this->authKey);\n $dbResult->bindInt(':auth_expire', $this->authExpired);\n $dbResult->bindInt(':last_login', $this->lastLoginTime);\n } else {\n $dbResult = System::database()->query('insert into :table_users (`role_id`, `login`, `password`)\n values (:role_id, :login, :password);');\n }\n $dbResult->bindTable(':table_users', TABLE_USERS);\n $dbResult->bindInt(':role_id', $this->role['id']);\n $dbResult->bindValue(':login', $this->login);\n $dbResult->bindValue(':password', $this->password);\n\n $dbResult->execute();\n }",
"public function touchLogin() {\n $this->last_login = date( 'Y-m-d H:i:s' );\n $this->save();\n }",
"public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}",
"static public function ctrIngresoUsuario()\n{ \n if(isset($_POST[\"ingUsuario\"]))\n {\n\n if(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])) {\n\n\n //$encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t//print_r($_POST);\n $tabla = \"usuarios\";\n $item= \"codusuario\";\n $valor= $_POST[\"ingUsuario\"];\t\t\t\t\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuarios($tabla, $item, $valor );\n\n if($respuesta[\"codusuario\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"] ){\n\n if($respuesta[\"bloqueado\"] == 0 ) {\n $_SESSION[\"iniciarSesion\"] = \"ok\";\n $_SESSION[\"id\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"nombre\"] = $respuesta[\"nomusuario\"];\n $_SESSION[\"usuario\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"perfil\"] = $respuesta[\"codperfil\"];\n $_SESSION[\"foto\"] = \"\";\n $_SESSION[\"id_local\"] = 1;\n\n date_default_timezone_set('America/Bogota');\n $fecha = date('Y-m-d');\n $hora = date('H:i:s');\n $fechaActual = $fecha.' '.$hora;\n\n $tabla = 'usuarios';\n $item1 = 'fecingreso';\n $valor1 = $fechaActual ;\n $item2 = 'codusuario';\n $valor2= $respuesta[\"codusuario\"] ;\n $respuestaUltimoLogin = ModeloUsuarios::mdlActualizarUsuario($tabla,$item1, $valor1, $item2, $valor2 );\n\n if($respuestaUltimoLogin == \"ok\")\n {\n echo '<script> window.location = \"inicio\"</script>';\n\n }\n\n } \n else \n echo '<br><div class=\"alert alert-danger\">El usuario no se encuentra activado.</div>';\n\n }else {\n\n echo '<br><div class=\"alert alert-danger\">Error al ingresar vuelve a intentarlo.</div>';\n }\t\t\t\t\n\n }//\n\n }\n\n}",
"public function autentificacion($username,$password){\n $userService = new UsuariosServiceImp();\n //objeto de tipo usuario\n $usuario = new Usuarios();\n //llamdo al metodo definido en la capa de servicio\n $usuario = $userService->buscarPorUsernamePassword($username,$password);\n if ( is_object($usuario)){\n /*\n variable de sesion mediante variables locales\n \n $_SESSION['nombre'] = $usuario->getNombre();\n $_SESSION['correo'] = $usuario->getEmail();\n $_SESSION['id'] = $usuario->getId();\n */\n /* variable de sesion mediante un arreglo asociado\n */\n $_SESSION['miSesion'] = array();\n $_SESSION['miSesion']['nombre'] = $usuario->getNombre();\n $_SESSION['miSesion']['correo'] = $usuario->getEmail();\n $_SESSION['miSesion']['id'] = $usuario->getId();\n \n //echo \"<br>El usuario es valido\";\n header(\"location:../view/productos.class.php\");\n }else{\n //echo \"<br>Este usuario no esta registrado en la base de datos\";\n header(\"location:../view/formLogin.html\");\n }\n }",
"public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}",
"public function iniciar() {\r\n session_regenerate_id();\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}",
"public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }",
"public static function saveUserSession(){\n\t\t$_SESSION['user']=self::$_leuser;\n\t}",
"function logout() {\n\t\t$this->id_admin = 0;\n\t\t$this->admin = \"\";\n\t\t$this->senha = \"\";\n\t\t$this->nome = \"\";\n\t\t$this->email = \"\";\n\t\t$this->privilegios = Array();\n\t\t$this->logado = 0;\n\n\t}",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"private function logInVOUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(44);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\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 }",
"function Save(){\n $rowsAffected = 0;\n if(isset($this->legajo)){\n $rowsAffected = $this->UpdateSQL([\"legajo = \".$this->legajo]);\n }else{\n $rowsAffected = $this->InsertSQL();\n if($rowsAffected > 0){\n $this->legajo = $this->Max(\"legajo\");\n }\n }\n if($rowsAffected == 0){\n throw new \\Exception(\"Error al guardar Usuario\");\n }else{\n $this->Refresh();\n }\n }",
"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 }",
"function registrarSesion () {\n\n if (!empty($this->id_usuario)) {\n $this->salvar(['ultima_session' => 'current_timestamp',\n 'activo' => 1\n ]);\n Helpers\\Sesion::sessionLogin();\n }\n else return false;\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 }",
"public function controle()\n\t{ \n\t\tif (isset($_COOKIE[GBA_COOKIE_NAME]))\n\t\t{\n\t\t\tsession_name(GBA_COOKIE_NAME);\n\t\t\tsession_start();\t\n\t\t}\n\t\tif (isset($_SESSION) && isset($_SESSION['sessao']) && isset($_SESSION['sessao']['codsessao']))\n\t\t{\n\t\t\t$boAutenticado = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$boAutenticado = false;\n\t\t}\n\t\tif ($boAutenticado === false)\n\t\t{\n\t\t\theader(\"Location: \" . GBA_URL_SISTEMA . \"login.php\");\n\t\t}\n // Adiciona registro no Historico de navegacao\n // Verificando se a ultima pagina ja nao esta gravada\n\t\t$stUltimaPagina = str_replace(GBA_PATH_SISTEMA, '', $_SERVER['SCRIPT_FILENAME']);\n\n\t\tif (count($_SESSION['historico']) == 0)\n\t\t{\n\t\t\t\t$_SESSION['historico'][] = $stUltimaPagina;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( isset($_SESSION['historico'][count($_SESSION['historico'])-1]) && ($_SESSION['historico'][count($_SESSION['historico'])-1] != $stUltimaPagina) )\n\t\t\t{\n\t\t\t\t$_SESSION['historico'][] = $stUltimaPagina;\n\t\t\t}\n\t\t}\n\t}",
"public function generateSession()\n\t{\n\t\t$name = $_POST['name'];\n\t\t$password = $_POST['password'];\n\t\t//validación de Usuario con un name y password ya definido\n\t\t$this->validaUsuario($name,$password);\n\n\t\t//validacion de un Usuario a Nivel Base de Datos cargar la base de datos y en la clase de la conexion poner los datos de la base de datos\n\t\t//$this->validaUsuarioDB($name,$password);\n\n\n\t}",
"public function agregarUsuario(){\n \n }",
"public function Login($dados){\n // //$conexao = $c->conexao();\n\n $email = $dados[0];\n $senha = md5($dados[1]);\n\n $sql = \"SELECT a.*, c.permissao FROM tbusuarios a, tbpermissao c WHERE email = '$email' and senha = '$senha' and a.idpermissao = c.idpermissao limit 1 \";\n $row = $this->ExecutaConsulta($this->conexao, $sql);\n\n // print_r($sql);\n\n // $sql=ExecutaConsulta($this->conecta,$sql);\n // $sql = $this->conexao->query($sql);\n // $sql = $this->conexao->query($sql);\n // $row = $sql->fetch_assoc();\n // print_r($row); \n\n if ($row) {\n $_SESSION['chave_acesso'] = md5('@wew67434$%#@@947@@#$@@!#54798#11a23@@dsa@!');\n $_SESSION['email'] = $email;\n $_SESSION['nome'] = $row['nome'];\n $_SESSION['permissao'] = $row['permissao'];\n $_SESSION['idpermissao'] = $row['idpermissao'];\n $_SESSION['last_time'] = time();\n $_SESSION['usuid'] = $row['idusuario'];\n $_SESSION['ip'] = $_SERVER[\"REMOTE_ADDR\"];\n $mensagem = \"O Usuário $email efetuou login no sistema!\";\n $this->salvaLog($mensagem);\n return 1;\n }else{\n return 0;\n }\n\n }",
"public function limpar_dados(){\n\n\t\n\t$this->session->set_userdata(\"cpf_inserido_gerente\",'');\n\t$this->session->set_userdata(\"nome_inserido_gerente\",'');\n\t$this->session->set_userdata(\"dataDN_inserido_gerente\",'');\n\t$this->session->set_userdata(\"rg_inserido_gerente\",'');\n\t$this->session->set_userdata(\"email_inserido_gerente\",'');\n\t$this->session->set_userdata(\"dataAD_inserido_gerente\",'');\n\t$this->session->set_userdata(\"senha_inserido_gerente\",'');\n\t$this->session->set_userdata(\"senhaC_inserido_gerente\",'');\n\n\n}",
"public function changeLoggedUserInfo() {\n try {\n /* Check if for the empty or null id, username and password parameters */\n if (isset($_POST[\"id\"]) && isset($_POST[\"username\"]) && isset($_POST[\"password\"]) && isset($_POST[\"email\"])) {\n // Get the id, username and password parameters from POST request\n $form_data = array(\n ':id' => $_POST[\"id\"],\n ':username' => $_POST[\"username\"],\n ':password' => $_POST[\"password\"],\n ':email' => $_POST[\"email\"]\n );\n // Check for existent data in Database\n $query = \"\n select access\n from tb_user \n where id = ?\n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query with passed parameter id\n $statement->execute([$form_data[':id']]);\n // Get affect rows in associative array\n $row = $statement->fetch(PDO::FETCH_ASSOC);\n // Check if any affected row\n if ($row) {\n // Create a SQL query to update the existent user with a new username and password for this passed id\n $query = \"\n update tb_user\n set username = :username, \n password = :password, \n email = :email\n where id = :id\n \";\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query with passed parameter id, username and password\n $statement->execute($form_data);\n // Check if any affected row\n if ($statement->rowCount()) {\n // Check for open session\n if (isset($_SESSION['views'])) {\n // Update new logged user info into session\n $_SESSION[$_SESSION['views'].'id'] = $form_data[':id'];\n $_SESSION[$_SESSION['views'].'username'] = $form_data[':username'];\n $_SESSION[$_SESSION['views'].'password'] = $form_data[':password'];\n $_SESSION[$_SESSION['views'].'email'] = $form_data[':email'];\n $_SESSION[$_SESSION['views'].'access'] = $row['access'];\n // data[] is a associative array that return json\n $data[] = array('result' => '1');\n } else {\n $data[] = array('result' => 'There is no such session available!');\n }\n } else {\n $data[] = array('result' => 'No operations performed on the database!');\n }\n } else {\n $data[] = array('result' => 'Nvalid user id!');\n }\n } else {\n // Check for missing parameters\n if (!isset($_POST[\"id\"]) && !isset($_POST[\"username\"]) && !isset($_POST[\"password\"]) && !isset($_POST[\"email\"])) {\n $data[] = array('result' => 'All missing parameters for changing the authenticated user data!');\n } elseif (!isset($_POST[\"id\"])) {\n $data[] = array('result' => 'Missing id parameter !!');\n } elseif (!isset($_POST[\"username\"])) {\n $data[] = array('result' => 'Missing username parameter!!');\n } elseif (!isset($_POST[\"password\"])) {\n $data[] = array('result' => 'Missing password parameter!!');\n } else {\n $data[] = array('result' => 'Missing email parameter !!');\n }\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }",
"private function verificar_cookie_sesion()\n\t{\n\t\t$session = \\Config\\Services::session();\n\t\t//verificar cookies\n\t\tif (isset($_COOKIE['ivafacil_admin_nick']) && isset($_COOKIE['ivafacil_admin_pa']) ) {\n\n\t\t\t$nick= $_COOKIE['ivafacil_admin_nick'];\n\t\t\t$pass=$_COOKIE['ivafacil_admin_pa'];\n\t\t\t//comparar passw hasheadas\n\t\t\t$usuarioCookie = new Admin_model();\n\t\t\t$result_pass_comparison =\n\t\t\t$usuarioCookie->where(\"nick\", $nick) \n\t\t\t->where(\"session_id\", $pass)->first();\n\n\t\t\tif (is_null($result_pass_comparison)) {\n\t\t\t\t//MOSTRAR FORM\n\n\t\t\t\treturn view(\"admin/login\");\n\t\t\t} else {\n\n\t\t\t\t//Se pidio recordar password?\n\t\t\t\tif ($result_pass_comparison->remember == \"S\") {\n\t\t\t\t\t//recuperar sesion si es valida\n\t\t\t\t\t$hoy = strtotime(date(\"Y-m-d H:i:s\"));\n\t\t\t\t\t$expir = strtotime($result_pass_comparison->session_expire);\n\t\t\t\t\tif ($hoy > $expir) return view(\"admin/login\");\n\n\t\t\t\t\t//crear sesion \n\t\t\t\t\t$newdata = [\n\t\t\t\t\t\t'nick' => $nick, \n\t\t\t\t\t\t'pass_alt' => $pass,\n\t\t\t\t\t\t'remember'=> \"S\"\n\t\t\t\t\t];\n\t\t\t\t\treturn view(\"admin/login\", $newdata);\n\t\t\t\t} else {\n\t\t\t\t\treturn view(\"admin/login\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//MOSTRAR FORM\n\t\treturn view(\"admin/login\");\n\t}",
"public function saveLoginData()\n {\n //Get user data (ip, time, browser)\n $request = \\Yii::$app->getRequest();\n $userData = [\n 'ip' => $request->getUserIP(),\n 'login_time' => time(),\n 'browser' => UserAgent::model()->browser,\n 'user_id' => \\Yii::$app->user->id\n ];\n\n //Save it to DB\n $loginStories = new LoginStories();\n $loginStories->attributes = $userData;\n $loginStories->save();\n }",
"private function accesoUsuario()\n {\n if ($this->adminSession) {\n $usuario = $this->session->userdata('admin');\n if ($usuario['id'] > 0) {\n redirect('admin/dashboard');\n } else {\n $this->adminSession = false;\n $this->session->sess_destroy();\n redirect('admin/index'); \n }\n }\n }",
"static public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$item = \"usu_descri\";\n\t\t\t\t$valor = $_POST[\"ingUsuario\"];\n\t\t\t\t$pass = $_POST[\"ingPassword\"];\n\n\t\t\t\t$respuesta = ModeloUsuarios::MdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\tif($respuesta[\"usu_descri\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"])\n\t\t\t\t{\n\n\t\t\t\t\tif($respuesta['estado'] == 'A')\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$_SESSION[\"iniciarSesion\"] = \"ok\";\n\t\t\t\t\t\t$_SESSION[\"id\"] = $respuesta[\"id\"];\n\t\t\t\t\t\t// $_SESSION[\"nombre\"] = $respuesta[\"nombre\"];\n\t\t\t\t\t\t$_SESSION[\"usuario\"] = $respuesta[\"usu_descri\"];\n\t\t\t\t\t\t// $_SESSION[\"foto\"] = $respuesta[\"foto\"];\n\t\t\t\t\t\t// $_SESSION[\"perfil\"] = $respuesta[\"perfil\"];\n\n\t\t\t\t\t\techo '<script>\n\t\n\t\t\t\t\t\twindow.location = \"inicio\";\n\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activo, porfavor, comuniquese con el administrador</div>';\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t}\n\n\t}",
"function login2($_login, $_password){\n $this->login($_login,$_password);\n $resultado_login = mysql_query(\"SELECT * FROM registro\n\t\tWHERE login_reg = '$_login' AND clave_reg = '$_password'\");\n $num_rows = mysql_num_rows($resultado_login);\n if (isset($num_rows)&& $num_rows == 0){\n $this->mensaje = \"Login or Password incorrect!\";\n $_SESSION['estado_temp'] = -1;\n }\n else{\n $fila_login = mysql_fetch_assoc($resultado_login);\n $this->nombre = $fila_login[\"nombre_reg\"];\n $this->apellido = $fila_login[\"apellido_reg\"];\n $this->mensaje = \"Bienvenido $this->nombre $this->apellido.\";\n $_SESSION['estado_temporal'] = 1;\n $_SESSION['login_temporal'] = $fila_login[\"login_reg\"];\n $___login = $fila_login[\"login_reg\"];\n $_SESSION['nombre_temporal'] = $fila_login[\"nombre_reg\"];\n $_SESSION['apellido_temporal'] = $fila_login[\"apellido_reg\"];\n $_SESSION['id_temporal'] = $fila_login[\"id_reg\"];\n //mysql_query (\"UPDATE usuarios SET last_login = curdate()\n //WHERE login = $___login\");\n //if($_SESSION['_url'])\n header(\"location: panel_usuario.php#next\");\n }\n }",
"private function synchronize()\n {\n $_SESSION['user'] = $this->user;\n }",
"public function storeSession() {}",
"public function guardarUsuario()\r\n {\r\n $user = new \\App\\Models\\User;\r\n \r\n $user->Seq_Usuario = $_REQUEST['Seq_Usuario'];\r\n $user->Usuario = $_REQUEST['username'];\r\n $user->Password = $_REQUEST['password'];\r\n $user->sys_rol_id = $_REQUEST['rolID'];\r\n\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n\r\n if($user->Seq_Usuario > 0) {\r\n $result = $userController->updateUser($user);\r\n } else {\r\n $result = $userController->createUser($user);\r\n }\r\n \r\n /**\r\n * Variable de sesión usada para mostrar la notificación del\r\n * resultado de la solicitud.\r\n */\r\n $_SESSION['result'] = $result;\r\n \r\n header('Location: ?c=Registro&a=usuarios');\r\n }",
"public function saveParamToSession($users) {\n Yii::app()->session[DomainConst::KEY_LOGGED_USER] = $users;\n }",
"function saveUser() {\n\n //datos desde el formulario\n $nombres = $this->input->post('nombres');\n $apellidos = $this->input->post('apellidos');\n $email = $this->input->post('email');\n $marca_favorita = $this->input->post('marca_favorita');\n $modelo_favorito = $this->input->post('modelo');\n $profesion = $this->input->post('profesion');\n $pais = $this->input->post('pais');\n $telefono = $this->input->post('telefono');\n\n //re-verificamos si el user existe\n $exi = $this->Secure_model->checkEmail($email);\n if ($exi == TRUE) {\n redirect(base_url() . 'index.php/site/aviso/2');\n }\n //se enviara a usuario\n //$temp_clave = \"hola\";\n $temp_clave = $this->Secure_model->generateClave($nombres);\n $clave = md5(utf8_encode($temp_clave));\n $tipo_usuario = '2';\n $estado = md5($email);\n $datos = array(\n 'nombres' => $nombres,\n 'apellidos' => $apellidos,\n 'email' => $email,\n 'pais' => $pais,\n 'clave' => $clave,\n 'tipo_usuario' => $tipo_usuario,\n 'estado' => $estado,\n 'primium' => '0',\n 'fecha_registro' => date('Y-m-d'),\n );\n //$this->session->set_userdata('temp_data',$datos);\n // GUARDAMOS QUE ACABAMOS DE CREAR Y OBTENEMOS EL ULTIMO ID\n $last_id = $this->savedata_model->guardar('cq_usuario', $datos);\n //Guardamos numero de telefono\n $dato_tel = array(\n //'id_telefono' => '',\n 'id_usuario' => $last_id,\n 'telefono' => $telefono,\n 'codigo_pais' => $pais\n );\n\n $this->savedata_model->guardar('cq_telefonos', $dato_tel);\n\n // EVIAMOS NOTIFICACION DE CORREO\n $nombre = $nombres . \" \" . $apellidos;\n\n $datos = array('tipo' => 'registro',\n 'to' => $email,\n 'clave' => $temp_clave,\n 'nombre' => $nombre);\n\n\n if ($this->function_model->enviarMail($datos)) {\n\n redirect(base_url() . 'index.php/site/aviso/1');\n } else {\n redirect(base_url() . 'index.php/site/aviso/3');\n }\n }",
"function sobreMeSalvar() {\n \n $usuario = new Estado_pessoal();\n $api = new ApiUsuario();\n $usuario->codgusuario = $_SESSION['unia']->codgusario;\n $this->dados = $api->Listar_detalhe_usuario($usuario);\n if (empty($this->dados->codgusuario) && $this->dados->codgusuario == NULL) {\n \n $this->dados = array('dados'=>$api->Insert_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n } else {\n $this->dados = array('dados'=>$api->Actualizar_sobreMe(new Estado_pessoal ('POST')) );\n header(\"Location:\" .APP_ADMIN.'usuario/detalhe_usuario');\n }\n \n }",
"public function storeSessionData() {}",
"public function login($username,$password)\n {\n try\n {\n $stmt = $this->db->prepare(\"SELECT id,prenom,nom,email,password,pseudo,classe FROM users WHERE email=:email LIMIT 1\");\n $stmt->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8')\n ));\n $userRow = $stmt->fetch(PDO::FETCH_ASSOC);\n if($stmt->rowCount() > 0)\n {\n if(password_verify($password, $userRow['password']))\n {\n $session = md5(rand());\n $lastco = strftime('%d %B %Y à %H:%M');\n $updateMembre = $this->db->prepare('UPDATE users SET session=:session, lastco=:lastco WHERE email=:email');\n $updateMembre->execute(array(\n 'email' => $username,\n 'session' => $session,\n 'lastco' => $lastco\n ));\n $_SESSION['session'] = $session;\n $_SESSION['userid'] = $userRow['id'];\n $_SESSION['userpseudo'] = $userRow['prenom'].\" \".$userRow['nom'];\n $_SESSION['username'] = $userRow['pseudo'];\n $_SESSION['userclasse'] = $userRow['classe'];\n\n if(isset($_POST['rememberme'])) {\n $contentcook = $userRow['id'].\"===\".sha1($username.$_SERVER['REMOTE_ADDR']);\n setcookie('auth', $contentcook, time() + 3600 * 24 * 7, '/', 'www.interminale.fr.nf', false, true);\n }\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }\n catch(PDOException $e)\n {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }",
"public function storeSessionData() {}",
"public function store(LoginRequest $request)\n {\n $request->authenticate();\n\n $request->session()->regenerate();\n\n //En esta parte de aqui puedo configurar el estado de tecnico, distribuidor, beneficiario para que ingrese.\n if((DB::table('users')\n ->join('roles', 'users.role_id','=','roles.id')\n ->where('email', $request->email)->value('roles.descripcion') === 'Donante')){\n $confirmed=DB::table('users')->where('email','=',$request->email)->get(); \n foreach($confirmed as $user){\n if($user->confirmed == 1){\n return redirect()->intended(RouteServiceProvider::DONANTE);\n\n }\n }\n }\n\n if((DB::table('users')\n ->join('roles', 'users.role_id','=','roles.id')\n ->where('email', $request->email)->value('roles.descripcion') === 'Beneficiario')){\n $confirmed=DB::table('users')->where('email','=',$request->email)->get(); \n foreach($confirmed as $user){\n if($user->confirmed == 1){\n return redirect()->intended(RouteServiceProvider::BENEFICIARIO);\n } \n }\n \n \n }\n\n if((DB::table('users')\n ->join('roles', 'users.role_id','=','roles.id')\n ->where('email', $request->email)->value('roles.descripcion') === 'Distribuidor')){\n $confirmed=DB::table('users')->where('email','=',$request->email)->get(); \n foreach($confirmed as $user){\n if($user->confirmed == 1){\n return redirect()->intended(RouteServiceProvider::DISTRIBUIDOR);\n\n } \n }\n \n }\n\n if((DB::table('users')\n ->join('roles', 'users.role_id','=','roles.id')\n ->where('email', $request->email)->value('roles.descripcion') === 'Técnico')){\n $confirmed=DB::table('users')->where('email','=',$request->email)->get(); \n foreach($confirmed as $user){\n if($user->confirmed == 1){\n return redirect()->intended(RouteServiceProvider::TECNICO);\n } \n }\n }\n \n\n if((DB::table('users')\n ->join('roles', 'users.role_id','=','roles.id')\n ->where('email', $request->email)->value('roles.descripcion') === 'Administrador')){\n $confirmed=DB::table('users')->where('email','=',$request->email)->get(); \n foreach($confirmed as $user){\n if($user->confirmed == 1){\n return redirect()->intended(RouteServiceProvider::ADMINISTRADOR);\n } \n }\n \n \n }\n \n }",
"public function addUsuario($usuario){\n $_SESSION[\"usuario\"]=$usuario;\n $this->usuario=$usuario;\n }",
"private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }",
"function verificar_login()\n {\n if (!isset($_SESSION['usuario'])) {\n $this->sign_out();\n }\n }",
"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 store(Request $request)\n {\n //\n $login = false;\n\n $usuarios = Usuario::all();\n\n foreach($usuarios as $user){\n if($request->alias == $user->username && $request->contrasena == $user->contrasena ){\n $value = session('key', 'default');\n /*\n Session::push('id', $user->id);\n Session::push('tipo', $user->tipo_usuario);\n Session::push('username', $user->username);\n Session::push('nombre', $user->nombre);\n Session::push('apellidos', $user->apellidos);\n Session::push('correo_electronico', $user->correo_electronico);\n */\n\n session_start();\n $_SESSION['status'] = 'activa';\n $_SESSION['user'] = $user->username;\n $login = true;\n }\n }\n\n if($login){\n //TODO: Inicializar los datos de session\n \n return view('admin.home');\n }else{\n return view('admin.login'); //TODO: Alertar que el login no se ejecuto\n }\n }",
"private function loginWithSessionData()\n { \n $this->user_name = $_SESSION['user_name'];\n $this->user_email = $_SESSION['user_email'];\n\n // set logged in status to true, because we just checked for this:\n //if(!empty($_SESSION['user_name']) && ($_SESSION['user_logged_in'] == 1)\n // when we called this method (in the constructor)\n $this->user_is_logged_in = true;\n \n if($_SESSION['user_privileges'] == 1)\n $this->user_admin = true;\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 actualizar(){\r\n\t\t\t$user_table = Config::get()->db_user_table;\r\n\t\t\t$consulta = \"UPDATE $user_table\r\n\t\t\t\t\t\t\t SET password='$this->password', \r\n\t\t\t\t\t\t\t \t\tnombre='$this->nombre', \r\n\t\t\t\t\t\t\t \t\temail='$this->email', \r\n\t\t\t\t\t\t\t \t\timagen='$this->imagen',\r\n apellido1='$this->apellido1',\r\n apellido2='$this->apellido2', \r\n fecha_nacimiento='$this->fecha_nacimiento',\r\n direccion='$this->direccion',\r\n cp='$this->cp',\r\n poblacion='$this->poblacion',\r\n telf_movil='$this->telf_movil',\r\n telf_fijo='$this->telf_fijo',\r\n nivel_estudios='$this->nivel_estudios',\r\n nombre_titulacion='$this->nombre_titulacion',\r\n otros='$this->otros',\r\n observaciones='$this->observaciones',\r\n en_activo=$this->en_activo,\r\n razon_social='$this->razon_social',\r\n puesto_trabajo='$this->puesto_trabajo',\r\n regimen=$this->regimen,\r\n activo=$this->activo\r\n\t\t\t\t\t\t\t WHERE dni='$this->dni';\";\r\n\t\t\treturn Database::get()->query($consulta);\r\n\t\t}",
"function initSession($usuario, $tipo, $codigo_usuario) {\r\n //include 'credenciales.php';\r\n \r\n //Iniciando la sesión en el servidor\r\n session_start();\r\n \r\n if($_SESSION[\"logged\"] == null || $_SESSION[\"logged\"] == false) {\r\n //Seteando las variables que permitirán saber si ha sido logueado el usuario\r\n $_SESSION[\"logged\"] = true;\r\n $_SESSION[\"usuario\"] = $usuario;\r\n $_SESSION[\"tipo\"] = $tipo;\r\n $_SESSION[\"codigo\"] = $codigo_usuario;\r\n \r\n echo '<br> Sesión iniciada<br>';\r\n \r\n }\r\n else {\r\n echo '<br> Sesión existente<br>';\r\n }\r\n}",
"function saveUser($sVars)\n{\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/config/config.php\");\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/class/autoload.php\");\n\n // Récupérer les données\n $aData = json_decode($sVars,true);\n $db = new cMariaDb($Cfg);\n if( $aData[\"User\"][\"id\"] == 0 ){\n // id=0 > Ajoute\n $Columns = \"\";\n $Values = \"\";\n foreach( $aData[\"User\"] as $key => $value )\n {\n if( $key != \"id\"){\n $Columns .= $key.\",\";\n $Values .= \"'\".addslashes($value).\"',\"; \n }\n if( $key == \"sEmail\"){\n $Columns .= \"pMotPasse,\";\n $Values .= \"SHA1('\".$value.\"'),\";\n }\n }\n $Columns = substr($Columns,0,-1);\n $Values = substr($Values,0,-1);\n $sSQL = \"INSERT INTO sys_user ($Columns,dDateInscription) VALUES ($Values,CURRENT_TIMESTAMP);\";\n $aTmp = $db->Query($sSQL);\n $id = $db->getLastId();\n } else {\n $Set = \"\";\n foreach( $aData[\"User\"] as $key => $value )\n {\n if( $key != \"id\"){\n $Set .= $key.\"='\".addslashes($value).\"',\";\n }\n }\n $Set = substr($Set,0,-1);\n $id = $aData[\"User\"][\"id\"];\n $sSQL = \"UPDATE sys_user SET $Set WHERE id=$id;\";\n $aTmp = $db->Query($sSQL);\n }\n // Méthode pas très élégante, mais il faudrait faire un delta entre tableaux \n // et agir en conséquence... \n // On supprime tout et on insert\n // Sauvegarde des droits ($aData[\"Rights\"])\n $sSQL = \"DELETE FROM sys_user_rights WHERE idUser=$id\";\n $db->Query($sSQL);\n foreach($aData[\"Rights\"] as $Right) {\n $sSQL = \"INSERT INTO sys_user_rights SET idRights=$Right, idUser=$id;\";\n $db->Query($sSQL);\n }\n\n // $aRet = [\"Errno\" => 2, \n // \"ErrMsg\" => $sTmp, \n // \"SQL\" => $sSQL ];\n\n return [\"Errno\" => 0, \"ErrMsg\" => \"OK\", \"SQL\" => $sSQL ];\n\n header('content-type:application/json');\n echo json_encode($aRet); \n}",
"function saveDataToSession(){\n\t\t$data = $this->getData();\n\t\tunset($data[\"AccountInfo\"]);\n\t\tunset($data[\"LoginDetails\"]);\n\t\tunset($data[\"LoggedInAsNote\"]);\n\t\tunset($data[\"PasswordCheck1\"]);\n\t\tunset($data[\"PasswordCheck2\"]);\n\t\tSession::set(\"FormInfo.{$this->FormName()}.data\", $data);\n\t}",
"static public function ctrIngresoUsuario()\n {\n\n if (isset($_POST['ingEmail'])) {\n if (\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingEmail\"]) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])\n ) {\n\n\n $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $tabla = \"usuarios\";\n $item = \"email\";\n $valor = $_POST[\"ingEmail\"];\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuario($tabla, $item, $valor);\n\n /*Validacion junto con la BD*/\n if ($respuesta[\"email\"] == $_POST[\"ingEmail\"] && $respuesta[\"password\"] == $encriptar) {\n //validacion con la BD si ya esta verficado el email\n if ($respuesta['verificacion'] == 1) {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡NO HA VERIFICADO SU CORREO ELECTRONICO!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise la bandeja de entrada o la carpeta de SPAM, para verifcar la direccion de correo electronico ' . $_POST[\"ingEmail\"] . '\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\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});\n\n\t\t\t\t\t\t</script>';\n } else {\n\n /*Variables de sesion*/\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $respuesta['id'];\n $_SESSION['nombre'] = $respuesta['nombre'];\n $_SESSION['foto'] = $respuesta['foto'];\n $_SESSION['email'] = $respuesta['email'];\n $_SESSION['password'] = $respuesta['password'];\n $_SESSION['modo'] = $respuesta['modo'];\n\n //Utilizando del local storgae, alcenamos la ruta, para cuando inicie sesion, sea redireccionado hacia la ruta\n echo '\n <script> \n window.location = localStorage.getItem(\"rutaActual\");\n </script>\n ';\n\n\n }\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR AL INGRESAR!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise el correo electronico, o la contraseña\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t window.location = localStorage.getItem(\"rutaActual\");\n\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});\n\n\t\t\t\t\t\t</script>';\n }\n\n\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t text: \"¡Error al ingresar al sistema, no se permiten caracteres especiales\",\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\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});\n\n\t\t\t\t\t\t</script>';\n }\n }\n\n\n }",
"public function save(){\n if(isset($_POST)){\n\n $nombre = isset($_POST[\"nombre\"]) ? $_POST[\"nombre\"] : false;\n $apellidos = isset($_POST[\"apellidos\"]) ? $_POST[\"apellidos\"] : false;\n $email = isset($_POST[\"email\"]) ? $_POST[\"email\"] : false;\n $password = isset($_POST[\"password\"]) ? $_POST[\"password\"] : false;\n\n\n\n if($nombre && $apellidos && $email && $password){\n \n $usuario= new Usuario(); \n $usuario->setNombre($nombre);\n $usuario->setApellidos($apellidos);\n $usuario->setEmail($email);\n $usuario->setPassword($password);\n /* llamo al metodo que tengo en el modelo para guardar el usuario */\n $save= $usuario->save();\n /* condicion por si el metodo save falla */\n if($save){\n /* cuando el registro esté correcto, abri una session */\n $_SESSION['register']= \"complete\";\n }else{\n $_SESSION['register']= \"failed\"; \n }\n }else{\n $_SESSION['register']= \"failed\"; \n }\n\n }else{\n $_SESSION['register']= \"failed\"; \n }\n /* para redirigir */\n header(\"Location:\".base_url.'usuario/registro');\n }",
"public function logUser(){\r\n\t\t$email = $_POST['login_email'];\r\n\t\t$password = $_POST['login_password'];\r\n\r\n\t\t$sql = \"SELECT * FROM users where email = ? and password = ? \";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$email,$password]);\r\n\t\t//rezultat smestamo u promenljivu loggedUser i stavljamo samo fetch zzbog toga sto vraca jedan rezultat\r\n\r\n\t\t$loggedUser = $query->fetch(PDO::FETCH_OBJ);\r\n\r\n\t\tif ($loggedUser != NULL) {\r\n\t\t\t//dodeljujemo sesiji celog usera (OBJEKAT)\r\n\t\t\t$_SESSION['loggedUser'] = $loggedUser;\r\n\t\t\t//ovde dodeljujemo usera iz baze varijabli login_result!!!\r\n\t\t\t$this->login_result = $loggedUser;\r\n\t\t}\r\n\t}",
"public function doLogin(){\n $redirect =\"\";\n if(isset($_POST['staticEmail']) && isset($_POST['inputPassword']) && $_POST['staticEmail'] != \"\" && $_POST['inputPassword'] !=\"\")//check if the form is well fill\n {\n $userTabFilter=array(\n '$and' =>array(\n ['email' =>$_POST['staticEmail']],\n ['password' => sha1($_POST['inputPassword'])])\n );//For the filter used on UserManager\n\n $result = $this->_userManager->getUserByPassAndEmail($userTabFilter);\n if($result != null)//return null if the user doesn't exist in DB\n {\n \n $user= array(\n 'id' => $result->_id,\n 'email' => $result->email,\n 'password' => $result->password,\n 'firstname' => $result->firstname,\n 'lastname' => $result->lastname,\n 'pseudo' => $result->pseudo\n );//Filter used on UserManager\n \n $this->_user = $this->_userManager->createUser($user);//Create user, not in DB but, for the session var, as an object\n if($this->_user == 'null'){//In case the creation didn't work\n\n $_SESSION['userStateLogIn'] = ['res'=>'Une erreur a lieu lors de la connexion, veuillez reessayer plus tard.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n\n }else{//In case the connexion worked\n \n $_SESSION['userStateLogIn'] = ['res'=>'Connexion réussie','couleur' => 'green'];\n $redirect = \"calendrier\";//redirect to the calendar\n $_SESSION['user'] =$this->_user;//Init the session var user with the user created before\n }\n \n }else{\n $_SESSION['userStateLogIn'] = ['res'=>'Aucun compte avec votre identifiant et mot de passe existe.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n }\n\n }else{\n $_SESSION['userStateLogIn'] = ['res'=>'Veuillez remplir le formulaire correctement.','couleur' => 'red'];//Session var to explain where the error came from\n $redirect = \"form\";//redirect to the form connection\n }\n header(\"Location : ../{$this->_redirectTab[$redirect]}\");//proceed to redirection\n \n\n \n }",
"public function login()\n\t{\n\t \tif(User::all()->count() == 0){\n\t \t\t$users = [\n\t\t\t [\n\t\t\t \t\"SEG_Usuarios_Nombre\" => \"Administrador\",\n\t\t\t \"SEG_Usuarios_Username\" => \"admin\",\n\t\t\t \"SEG_Usuarios_Contrasena\" => Hash::make(\"hola123\"),\n\t\t\t \"SEG_Usuarios_Email\" => \"[email protected]\",\n\t\t\t \"SEG_Usuarios_Activo\" => true,\n\t\t\t \"SEG_Roles_SEG_Roles_ID\" => 1,\n\t\t\t ]\n\t\t ];\n\t\t \n\t\t foreach ($users as $user) {\n\t\t User::create($user);\n\t\t }\n\t \t}\n\n\t \t//Autentica\n\t if ($this->isPostRequest()) {\n\t \t$validator = $this->getLoginValidator();\t \n\t \tif ($validator->passes()) {\n\t\t $credentials = $this->getLoginCredentials();\n\t\t $credentials[\"SEG_Usuarios_Activo\"] = 1; // Agrega al array el elemento para verificar si usuario esta activo\n\t\t if (Auth::attempt($credentials)) {\n\n\t\t \tif (Auth::user()->SEG_Usuarios_FechaDeExpiracion == null) {\n\t\t\t\t\t\treturn Redirect::to('Auth/Cambio');\n\t\t\t\t\t}\n\n\t\t \t$datetimeUser = new DateTime(Auth::user()->SEG_Usuarios_FechaDeExpiracion);\n\t\t\t\t\t$datetimeHoy = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t$diff = date_diff($datetimeUser, $datetimeHoy);\n\n\t\t \tif ($diff->format(\"%d\") <= 5 && $diff->format(\"%d\") > 0) {\n\t\t\t\t\t\treturn View::make(\"Usuarios.mensaje\");\n\t\t \t} \n\n\t\t \tif ($diff->format(\"%d\") <= 0) {\n\t\t \t\tAuth::logout();\n\t\t \t\treturn Redirect::back()->withErrors([\n\t\t \t\t\t\"errors\" => [\"Su contraseña ha expirado, contacte a su administrador.\"]\n\t\t \t\t]);\n\t\t \t}\n\t\t \t \t\n\t\t \tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t\t\t $ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t} else {\n\t\t\t\t\t $ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$UserAct = User::find(Auth::user()->SEG_Usuarios_ID);\n\t\t\t\t\t$UserAct->SEG_Usuarios_IP3 = $UserAct->SEG_Usuarios_IP2;\n\t\t\t\t\t$UserAct->SEG_Usuarios_IP2 = $UserAct->SEG_Usuarios_IP1;\n\t\t\t\t\t$UserAct->SEG_Usuarios_IP1 = $ip;\n\t\t\t\t\t$UserAct->SEG_Usuarios_UltimaSesion = date(\"Y-m-d h:i:s\");\n\t\t\t\t\t$UserAct->save();\n\t\t\t\t\t\n\t\t\t\t\treturn View::make(\"hello\");\n\t\t }\n\t\t return Redirect::back()->withErrors([\n\t\t \t\"errors\" => [\"Sus credenciales no concuerdan.\"]\n\t\t ]);\n\t \t} else {\n\t \treturn Redirect::back()\n\t\t ->withInput()\n\t\t ->withErrors($validator);\n\t \t}\n\t }\n\n\t //Recoge la IP del cliente y la guarda en la base de datos\n\t return View::make(\"Usuarios.login\");\n \t}",
"function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }",
"public function saveUser($nome,$email,$senha){\n \t$id = time();\n $nome = parent::escapeString($nome);\n $senha = md5(parent::escapeString($senha));\n $email = parent::escapeString($email);\n \t//fazer uma validação para ver se o usuario já não está cad\n \t$sql = \"insert into `usuarios` ( `id`,`nome`, `email`, `senha` ) values ('$id','$nome', '$email', '$senha')\"; \n return parent::executaQuery($sql);\n }",
"public function login($usuario) {\n $_SESSION['usuario'] = $usuario;\n }",
"public static function updateSession($usuario){\n $_SESSION['user'] = $usuario;\n }",
"public function actualizar_conversaciones()\n\t{\n\t\tif($this->session->userdata('logueado'))\n\t\t{\n\t\t\t$usuario=$this->session->userdata('id');\n\t\t\t$datos['conversaciones']=$this->Mensaje_model->buscar_conversaciones($usuario);\n\t\t\t\n\t\t\techo (json_encode($datos['conversaciones']));\n\t\t}\n\t\telse//SI NO ESTA LOGUEADO LE MANDAMOS AL LOGIN CON UN CAMPO REDIRECCION PARA QUE LUEGO LE LLEVE A LA PAGINA QUE QUERIA\n\t\t{\n\t\t\t$datos['errorLogin']='Por favor inicia sesion';\n\t\t\tenmarcar($this,'index.php',$datos);\n\t\t}\n\t}",
"function modeloUserUpdate ($userid,$userdat){\n if ( isset($_SESSION['tusuarios'][$userid])){\n $_SESSION['tusuarios'][$userid]= $userdat;\n \n $user = new Usuario();\n $user->id = $userid;\n $user->nombre = $userdat['nombre'];\n $user->password = $userdat['password'];\n $user->correo = $userdat['correo'];\n $user->plan = $userdat['plan'];\n $user->estado = $userdat['estado'];\n $db = AccesoDatos::getModelo();\n $db->modUsuario($user);\n \n echo \"<script>modificarUser();</script>\"; \n\n }\n return false;\n}",
"public function IniciarSesion(Usuario $usu){\n $conn = new conexion();\n $rol = 0;\n try {\n if($conn->conectar()){\n $str_sql = \"Select usuarios.id_usu, usuarios.nom_usu,usuarios.usuario,usuarios.foto,tp_usuarios.nom_tp as rol,usuarios.idcliente from usuarios \"\n . \"INNER JOIN tp_usuarios WHERE usuarios.id_tp_usu = tp_usuarios.id_tp \"\n . \"and usuarios.usuario = '\".$usu->getUsuario().\"' and usuarios.pass = '\".$usu->getPass().\"' \"\n . \"and estado = 'Activo'\";\n $sql = $conn->getConn()->prepare($str_sql);\n $sql->execute();\n $resultado = $sql->fetchAll();\n foreach ($resultado as $row){\n $rol = 1;\n session_start();\n $_SESSION['id'] = $row['id_usu'];\n //$_SESSION['idcli'] = $row['idcliente'];\n $_SESSION['perfil'] = $row['usuario'];\n $_SESSION['rol'] = $row['rol'];\n $_SESSION['user'] = $row['nom_usu'];\n $_SESSION['img'] = $row['foto'];\n }\n }\n } catch (Exception $exc) {\n $rol = -1;\n echo $exc->getMessage();\n }\n $conn->desconectar();\n return $rol;\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}",
"function saveAdmin(Usuario $objeto) {\n $campos = $this->_getCampos($objeto);\n \n $id = $campos['id'];\n unset($campos['id']);\n unset($campos['falta']);\n unset($campos['activa']);\n \n if($objeto->getPassword() === null || $objeto->getPassword() === ''){\n unset($campos['password']);\n }\n return $this->db->updateParameters(self::TABLA, $campos, array('id' => $id));\n }",
"public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }",
"function saveUsuario(Usuario $objeto) {\n $campos = $this->_getCampos($objeto);\n \n $id = $campos['id'];\n unset($campos['id']);\n unset($campos['tipo']);\n unset($campos['activa']);\n unset($campos['falta']);\n if($objeto->getPassword() === null || $objeto->getPassword() === ''){\n unset($campos['password']);\n }\n return $this->db->updateParameters(self::TABLA, $campos, array('id' => $id));\n }",
"public function connexionAdminAssoLogin(){\n session_destroy();\n }",
"public function saveAction(){\n \n $req=$this->getRequest();\n \n if ($req->getParam('id') === 'new') {\n $record = Doctrine::getTable('Users')->create();\n $usersOrg = Doctrine::getTable('UsersOrganizations')->create();\n } else {\n $record =\tDoctrine_Query::create()\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne();\n }\n \n //Aggiorna \n $password=szGenPass::generatePassword(Constants::PASSWORD_LENGHT); \n if ($req->getParam('id') === 'new') {\n $record->password=md5($password);\n $record->data_iscrizione=new Doctrine_Expression('NOW()');\n }else{\n $record->data_iscrizione=$req->getParam(\"data_iscrizione\");\n }\n $record->merge(array(\n \"nome\"=> $req->getParam(\"nome\"),\n \"cognome\" => $req->getParam(\"cognome\"),\n \"user\" => $req->getParam(\"user\"),\n \"active\" => $req->getParam(\"active\"),\n \"ID_role\" =>$req->getParam(\"ID_role\")\n ));\n \n if(!$record->trySave()){\n $this->errors->addValidationErrors($record); \n }\n //TO DO: se l'utente è nuovo devo conoscere la password\n if ($req->getParam('id') === 'new') {\n if($req->getParam('orgid')!=''){\n \t$usersOrg->merge(array(\n \"orgid\"=>$req->getParam('orgid'),\n \"ID_user\"=>$record->ID,\n \"active\"=>Constants::UTENTE_ATTIVO\n ));\n $usersOrg->save();\n }\n $this->emitSaveData(array(\"success\"=>true,\"message\"=>\"Password: \".$password));\n }else{\n $this->emitSaveData();\n }\n }",
"public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }",
"public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}",
"function logease(){\n session_start();\n\t require(\"Conexion.php\");\n\n\t\n if(isset($_POST['username']) && isset($_POST['password'])){//si se han introducido los dos campos\n\t\t\t \n\t\t\t \n\t\t\t /*mensaje de error*/\n \tif(!isset($_SESSION['rol']) or $_SESSION['rol']!=1){\n\t echo '<div class=\"error\">Error, usuario o contraseña incorrectas</div>';\t\n }\n\t\n\t\t\t \t\t \n\t\t\t $username=$_POST['username'];\n\t\t\t $password=$_POST['password'];\n\t\t\t \n\t\t\t $_SESSION['usuario']=$_POST['username'];//gualdamos el nombre del usuario, el variable super global para mostrar luego\n\t\t\t \n \t\t $db=new Conexion();\n\t\t\t $query=$db->connect()->prepare('select * from usuarios where username=:username and password=:password');\n\t\t\t \n\t\t\t $query->execute(['username'=>$username,'password'=>$password]);\n\t\t\t \n\t\t\t $row=$query->fetch(PDO::FETCH_NUM);\n\n\t\t\t if($row==true){\t\t \n\t\t\t\t $rol=$row[3];//tercera columna de la tabla donde tiene el campo rol\n\t\t\t\t $_SESSION['rol']=$rol;\n\t\t\t\t \n\t\t\tswitch($_SESSION['rol']){//controlamos lo que se visualiza con el rol, depende de numero almacenado en la bd en la tabla rol_usuario\n\t\t\tcase 1:\n\t\t\t\theader('location: ../vista/admin.php');\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\theader('location: ../index.php');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tsession_unset();\t\t\t\t\n \t session_destroy();\n\t\t\t\t}\t\t\t\t\t\t\t \n\t }\t\t\t \n }\n }",
"public function persistSessionToken() {}",
"public function persistSessionToken() {}",
"public function persistSessionToken() {}",
"public function persistSessionToken() {}",
"public function asignar(Request $request){\n if(!$request->ajax() || Auth::user()->rol_id == 11)return redirect('/');\n $rol = $request->rol_id;\n $user = new User();\n $user->id = $request->id_persona;\n $user->usuario = $request->usuario;\n $user->password = bcrypt( $request->password);\n $user->condicion = '1';\n $user->rol_id = $request->rol_id;\n\n if($user->rol_id == 2){\n $vendedor = new Vendedor();\n $vendedor->id = $request->id_persona;\n $vendedor->save();\n }\n\n switch($rol){// se le abilitan los modulos deacuerdo a su tipo de rol\n case 1: // Administrador\n {\n $user->administracion=1;\n $user->desarrollo=1;\n $user->precios=1;\n $user->obra=1;\n $user->ventas=1;\n $user->acceso=1;\n $user->reportes=1;\n //Administracion\n $user->departamentos=1;\n $user->personas=1;\n $user->empresas=1;\n $user->medios_public=1;\n $user->lugares_contacto=1;\n $user->servicios=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n $user->asig_servicios=1;\n $user->mis_asesores=0;\n //Desarrollo\n $user->fraccionamiento=1;\n $user->etapas=1;\n $user->modelos=1;\n $user->lotes=1;\n $user->asign_modelos=1;\n $user->licencias=1;\n $user->acta_terminacion=1;\n $user->p_etapa=0;\n\n //Precios\n $user->agregar_sobreprecios=1;\n $user->precios_etapas=1;\n $user->sobreprecios=1;\n $user->paquetes=1;\n $user->promociones=1;\n //Obra\n $user->contratistas=1;\n $user->ini_obra=1;\n $user->aviso_obra=1;\n $user->partidas=1;\n $user->avance=1;\n //Ventas\n $user->lotes_disp=1;\n $user->mis_prospectos=0;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->hist_creditos=1;\n $user->contratos=1;\n $user->docs=1;\n //Acceso\n $user->usuarios=1;\n $user->roles=1;\n //Reportes\n $user->mejora=1;\n break;\n }\n case 2: //Asesor de ventas\n {\n $user->administracion=1;\n $user->ventas=1;\n //Administracion\n $user->empresas=1;\n //Ventas\n $user->lotes_disp=1;\n $user->mis_prospectos=0;\n $user->simulacion_credito=1;\n break;\n }\n case 3: //Gerente de proyectos\n {\n $user->desarrollo=1;\n //Desarrollo\n $user->fraccionamiento=1;\n $user->modelos=1;\n $user->lotes=1;\n $user->licencias=1;\n $user->acta_terminacion=1;\n break;\n }\n case 4: //Gerente de ventas\n {\n $user->administracion=1;\n $user->ventas=1;\n $user->reportes=1;\n //Administracion\n $user->empresas=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n $user->mis_asesores=0;\n //Ventas\n $user->lotes_disp=1;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->contratos=1;\n $user->docs=1;\n //Reportes\n $user->mejora=1;\n break;\n }\n case 5: // Gerente de obra\n {\n $user->obra=1;\n\n //Obra\n $user->contratistas=1;\n $user->aviso_obra=1;\n $user->partidas=1;\n $user->avance=1;\n break;\n }\n case 6: // Admin ventas\n {\n $user->administracion=1;\n $user->desarrollo=1;\n $user->precios=1;\n $user->obra=1;\n $user->ventas=1;\n $user->acceso=1;\n $user->reportes=1;\n //Administracion\n $user->empresas=1;\n $user->personas=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n //Desarrollo\n $user->fraccionamiento=1;\n $user->etapas=1;\n $user->modelos=1;\n $user->asign_modelos=1;\n //Precios\n $user->agregar_sobreprecios=1;\n $user->precios_etapas=1;\n $user->sobreprecios=1;\n $user->paquetes=1;\n $user->promociones=1;\n //Obra\n $user->ini_obra=1;\n //Ventas\n $user->lotes_disp=1;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->hist_creditos=1;\n $user->contratos=1;\n $user->docs=1;\n //Acceso\n $user->usuarios=1;\n $user->roles=1;\n //Reportes\n $user->mejora=1;\n break;\n }\n case 7: // Publicidad\n {\n $user->administracion=1;\n $user->desarrollo=1;\n $user->reportes=1;\n //Administracion\n $user->medios_public=1;\n $user->lugares_contacto=1;\n $user->servicios=1;\n $user->asig_servicios=1;\n //Desarrollo\n $user->modelos=1;\n $user->p_etapa=0;\n\n //Reportes\n $user->mejora=1;\n break;\n }\n case 8: // Gestor ventas\n {\n $user->administracion=1;\n $user->ventas=1;\n //Administracion\n $user->empresas=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n //Ventas\n $user->lotes_disp=1;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->hist_creditos=1;\n $user->contratos=1;\n $user->docs=1;\n break;\n }\n case 9: // Contabilidad\n {\n $user->administracion=1;\n $user->saldo=1;\n //Administracion\n $user->cuenta=1;\n //Saldos\n $user->edo_cuenta=1;\n $user->depositos=1;\n $user->gastos_admn=1;\n break;\n }\n\n }\n\n $user->save();\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\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}",
"public function signin(){\r\n if(isset($_SESSION['user'])){\r\n if(isset($_POST['mail']) && isset($_POST['password'])){\r\n $mail = $_POST['mail']; \r\n $password = $_POST['password'];\r\n \r\n if($this->user->setMail($mail) && $this->user->setPassword($password)){\r\n $this->user->db_set_Users($this->user);\r\n die(\"REGISTRO EXITOSO\");\r\n }else{\r\n die(\"ERROR AL REALIZAR EL REGISTRO\");\r\n }\r\n }\r\n }else{\r\n die(\"ERROR AL REQUEST ERRONEO\");\r\n }\r\n }",
"public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}"
] | [
"0.7282858",
"0.671208",
"0.65712005",
"0.6548097",
"0.6518177",
"0.6453015",
"0.6430746",
"0.64189696",
"0.63864267",
"0.6355001",
"0.63537407",
"0.63127524",
"0.6289298",
"0.6287329",
"0.6285953",
"0.62531877",
"0.62486",
"0.62477535",
"0.6234281",
"0.62164235",
"0.6203251",
"0.62031007",
"0.6194869",
"0.6192626",
"0.61918896",
"0.61694574",
"0.61650735",
"0.615715",
"0.6154062",
"0.61385083",
"0.6132459",
"0.61229867",
"0.61009455",
"0.6081486",
"0.60798305",
"0.602788",
"0.60171694",
"0.6017004",
"0.601503",
"0.6003676",
"0.59942055",
"0.59909683",
"0.5973935",
"0.59647053",
"0.59615433",
"0.59571594",
"0.5947848",
"0.59388876",
"0.5938294",
"0.5936136",
"0.5930023",
"0.5929396",
"0.59230655",
"0.5922029",
"0.59070677",
"0.59058785",
"0.59051543",
"0.5902887",
"0.59012055",
"0.58904016",
"0.5882359",
"0.58763546",
"0.5872368",
"0.5869026",
"0.5866721",
"0.58632916",
"0.58615315",
"0.5860025",
"0.58595544",
"0.5857199",
"0.585383",
"0.58517337",
"0.5851579",
"0.5845771",
"0.58337235",
"0.58307576",
"0.5828852",
"0.58236927",
"0.5814933",
"0.5814603",
"0.57939345",
"0.5792103",
"0.5791863",
"0.5790956",
"0.57878625",
"0.57805026",
"0.5772007",
"0.5771213",
"0.5768866",
"0.5762993",
"0.57569593",
"0.57533735",
"0.57533735",
"0.57533735",
"0.57533735",
"0.57526654",
"0.5750247",
"0.57436275",
"0.5739233",
"0.5738883"
] | 0.6621825 | 2 |
Retorna o hash de $str de acordo com o algortimo definido na configura??o | public function _hash($str) {
switch ($this->config['algoritmo_criptografia']) {
case 'sha1':
return ($str == '') ? '' : sha1($str);
break;
case 'crypt':
return crypt($str);
break;
case 'base64':
return base64_encode($str);
break;
case 'plain':
return $str;
break;
case 'md5':
default:
return md5($str);
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function hash($str)\n\t{\n\t\treturn hash($this->config['hash_method'], $str);\n\t}",
"public function hash($str)\n\t{\n\t\treturn hash($this->_config['hash_method'], $str);\n\t}",
"function getHash($str)\n{\n\treturn hash('sha256', $str);\n}",
"public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['salt_prefix'].$str.$this->config['salt_suffix']); \n\t}",
"public function hash($str) {\n\n return hash($this->hash_method, $str);\n }",
"private function hash($str)\n {\n return ($this->hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }",
"private static function getHash($string)\n\t{\n\t\treturn base64_encode(extension_loaded('hash') ?\n\t\thash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(\n\t\t(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .\n\t\tpack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^\n\t\t(str_repeat(chr(0x36), 64))) . $string)))));\n\t}",
"private static function key($str) {\n\t\treturn md5($str);\n\t}",
"public static function GetPasswordHash($str)\n {\n global $PASSWORD_HASH_INFO;\n if (empty($PASSWORD_HASH_INFO)) {\n $type = 'sha256';\n $user_salt = '';\n $random_salt_length = 8;\n } else {\n $type = $PASSWORD_HASH_INFO['type'];\n $user_salt = $PASSWORD_HASH_INFO['user_salt'];\n $random_salt_length = $PASSWORD_HASH_INFO['random_salt_length'];\n }\n $random_salt = ($random_salt_length)? substr(md5(uniqid(rand())), 0, $random_salt_length) : '';\n return $random_salt . hash($type, $random_salt . $str . $user_salt);\n }",
"public function hash ($string){\n\t\treturn hash('sha512', $string . config_item('encryption_key'));\n\t\t}",
"public function hash($str)\n {\n return ($this->_hashType == 'sha1') ? $this->sha1($str) : md5($str);\n }",
"protected function _getHash($string) {\n\n\t\t\treturn sha1($string);\n\t\t}",
"public static function hash($string) {\n $hash = hash_init(Config::get('HASH'));\n hash_update($hash, $string);\n hash_update($hash, Config::get('SALT'));\n\n return hash_final($hash);\n }",
"public function hash($string){\n return hash('sha512', $string . config_item('encryption_key'));\n }",
"public function hash( $string ) {\n\n return hash( 'sha512', $string.config_item( 'encryption_key' ) );\n }",
"function get_hash($string) {\r\n return hash('sha1', $string);\r\n}",
"static function hash_string($input, $config = []) {\n\t\t$defaults = [\n\t\t\t'use_salt' => true,\n\t\t\t'encryption' => PASSWORD_BCRYPT\n\t\t];\n\t\t$config = array_merge($defaults, $config);\n\n\t\t//Create random bytes\n\t\t$salt_byte = random_bytes(15);\n\t\t//Make the bytes into a readable string (to save to the database)\n\t\t$salt_string = $config['use_salt'] ? bin2hex($salt_byte) : \"\";\n\t\t//Put the salt-string after the password for the hashing for both creation and login\n\t\t$string_hashed = password_hash($input . $salt_string, $config['encryption']);\n\n\t\treturn ['hash' => $string_hashed, 'salt' => $salt_string];\n\t}",
"public function hashPass($str)\n {\n // Phalcon's hashing system\n //return $this->_security->hash($str);\n\n // Using PHP5.5's built in system\n return password_hash($str, PASSWORD_DEFAULT, ['cost' => \\Phalcon\\DI::getDefault()->getShared('config')->auth->hash_workload]);\n }",
"public static function hashCode($_str) {\n\t\treturn str_pad(\n\t\t\tbase_convert(sprintf('%u',crc32($_str)),10,36),7,'0',\n\t\t\t\tSTR_PAD_LEFT\n\t\t);\n\t}",
"public static function hash($str, $type = 'sha1')\n {\n if ($type == 'sha1') {\n return sha1($str);\n } else {\n return md5($str);\n }\n }",
"private static function hash($str) {\n $hash = 0;\n\n for ($i = 0, $l = strlen($str); $i < $l; $i++) {\n $hash += ord($str[$i]);\n $hash += $hash << 10;\n $hash ^= $hash >> 6;\n }\n\n $hash += $hash << 3;\n $hash ^= $hash >> 6;\n $hash += $hash << 16;\n\n return $hash;\n }",
"function getHash($str, $hashSize) {\n // Sum the ascii of every char of the string\n // and return the modulus of $hashsize\n $str_arr = str_split($str);\n $sum = 0;\n foreach ($str_arr as $char) {\n $sum += ord($char);\n }\n return $sum % $hashSize;\n}",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"function _hash($string) {\n\t\t\t// Use sha1() if possible, php versions >= 4.3.0 and 5\n\t\t\tif(function_exists('sha1')) {\n\t\t\t\t$hash = sha1($string);\n\t\t\t} else {\n\t\t\t\t// Fall back to md5(), php versions 3, 4, 5\n\t\t\t\t$hash = md5($string);\n\t\t\t}\n\t\t\t$out ='';\n\t\t\t// Convert hexadecimal hash value to binary string\n\t\t\tfor($c=0;$c<strlen($hash);$c+=2) {\n\t\t\t\t$out .= $this->_hex2chr($hash[$c] . $hash[$c+1]);\n\t\t\t}\n\t\t\treturn $out;\n\t\t}",
"public function getHash() {}",
"private function hash($string)\n {\n if (!function_exists('hash')) {\n return sha1($string);\n }\n return hash('sha256', $string);\n }",
"function _salt($str)\n\t{\n\t\treturn sha1($this->CI->config->item('encryption_key').$str);\n\t}",
"public function getHash();",
"protected function hash($string)\n {\n return hash_hmac('sha1', $string, $this->key(), true);\n }",
"public function hash(): string;",
"public static function hash($string)\n\t{\n\t\tif(extension_loaded('hash')) {\n\t\t\tif(!($key = Config::getVar('secret_key'))) {\n\t\t\t\tthrow new BakedCarrotException('\"secret_key\" parameter is not defined');\n\t\t\t}\n\n\t\t\treturn hash_hmac('sha256', $string, $key);\n\t\t}\n\t\telse {\n\t\t\treturn sha1($key);\n\t\t}\n\t}",
"final public function getHash() {}",
"public function set_hash($string){\n\t\t\t$string = hash($this->hash_algorithm, $string . $this->password_salt);\n\t\t\t$string = $this->password_addenda . $string . $this->password_addenda;\n\t\t\treturn $string;\n\n\t\t}",
"public function myHash($str) {\n $hash = 0;\n $s = md5($str);\n $seed = 5;\n $len = 32;\n for ($i = 0; $i < $len; $i++) {\n // (hash << 5) + hash 相当于 hash * 33\n //$hash = sprintf(\"%u\", $hash * 33) + ord($s{$i});\n //$hash = ($hash * 33 + ord($s{$i})) & 0x7FFFFFFF;\n $hash = ($hash << $seed) + $hash + ord($s{$i});\n }\n\n return $hash & 0x7FFFFFFF;\n }",
"public static function hashFunction($str)\n {\n return md5($str);\n }",
"function key_gen($str=''){\n\treturn str_replace('=','',base64_encode(md5($str)));\n}",
"function GetNameForHash($hash){\n $hash_array = parse_ini_file(\"Hashes.txt\");\n return $hash_array[$hash];\n }",
"abstract protected static function getHashAlgorithm() : string;",
"protected static function create_hash($string)\n\t{\n\t\t$check1 = static::string_to_number($string, 0x1505, 0x21);\n\t\t$check2 = static::string_to_number($string, 0, 0x1003F);\n\n\t\t$factor = 4;\n\t\t$halfFactor = $factor/2;\n\n\t\t$check1 >>= $halfFactor;\n\t\t$check1 = (($check1 >> $factor) & 0x3FFFFC0 ) | ($check1 & 0x3F);\n\t\t$check1 = (($check1 >> $factor) & 0x3FFC00 ) | ($check1 & 0x3FF);\n\t\t$check1 = (($check1 >> $factor) & 0x3C000 ) | ($check1 & 0x3FFF); \n\n\t\t$calc1 = (((($check1 & 0x3C0) << $factor) | ($check1 & 0x3C)) << $halfFactor ) | ($check2 & 0xF0F );\n\t\t$calc2 = (((($check1 & 0xFFFFC000) << $factor) | ($check1 & 0x3C00)) << 0xA) | ($check2 & 0xF0F0000 );\n\n\t\treturn ($calc1 | $calc2);\n\t}",
"public static function lm_hash( $string )\n {\n $string = strtoupper( substr( $string, 0, 14 ) );\n\n $part_1 = self::des_encrypt( substr( $string, 0, 7 ) );\n $part_2 = self::des_encrypt( substr( $string, 7, 7 ) );\n\n return strtoupper( $part_1.$part_2 );\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 }",
"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}",
"private static function getHashKey($f) {\n\t\t\n\t\t//normalize path: removing nlac_static from the end if there is\n\t\t//$f = preg_replace('/\\\\??&*nls_static$/','',$f); \n\n\t\tif (Yii::app()->clientScript->hashMode == 'PATH') {\n\t\t\t//Composing thekey from the file name\n\t\t\t\n\t\t\t//If the file name contains \"jquery\" then chunk the path \n\t\t\t//(assuming that the file name is unique over the project)\n\t\t\tif (stristr($f,'jquery')!==false) {\n\t\t\t\tpreg_match('/[^\\\\/\\\\\\\\]+$/', $f, $matches);\n\t\t\t\treturn @$matches[0];\n\t\t\t}\n\t\t\treturn $f;\n\t\t}\n\t\t\n\t\t//Composing the key from the file content\n\t\t$c = $this->getResourceContent($f);\n\t\t//Yii::log('fullpath: ' . $fullPath . ', dirsep='.DIRECTORY_SEPARATOR, 'warning');\n\t\treturn substr(md5( $c ),0,8);\n\t}",
"private function generatePasswordHash($string)\n\t{\n\t\t$string = is_string($string) ? $string : strval($string);\n\t\t$pwHash = encrypto($string);\n\t\treturn $pwHash;\n\t}",
"public static function hash($string) {\n\treturn hash('sha512',$string);\n }",
"private static function getUrlHash() {\n $queryStr = self::getUrlQueryString();\n return strRightFrom($queryStr, '#', 1, true);\n }",
"function hash_ligne($ligne) {\n\treturn urldecode ( $ligne );\n}",
"public function formatUrlKey($str)\n {\n return $this->filter->translitUrl($str);\n }",
"public function getHash() : string {\n\t\t// sha256 = 64 characters\n\t\treturn hash_hmac('sha256', $this->token, getenv('ENCRYPTION_KEY'));\n\t}",
"private function getHash()\n {\n if (isset($this->config['hash']) && $this->config['hash']) {\n return $this->config['hash'];\n } else {\n throw new Exception('Please make sure you have set a code with php artisan code:set ****');\n }\n }",
"function criptografa($str)\r\n\t{\r\n\t\t$str = sha1( md5( sha1 ( md5 ( $str ) ) ) );\r\n\r\n\t\treturn $str; \t\t\r\n\t}",
"function make_hash($str)\n{\n return sha1(md5($str));\n}",
"function make_hash($str)\n{\n return sha1(md5($str));\n}",
"public function getHash() /*: string*/ {\n if ($this->hash === null) {\n throw new \\Exception(\"Hash is not initialized\");\n }\n return $this->hash;\n }",
"private static function HashURL($String)\n\t{\n\t\t$Check1 = self::StrToNum($String, 0x1505, 0x21);\n\t\t$Check2 = self::StrToNum($String, 0, 0x1003F);\n\t\t$Check1 >>= 2;\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);\n\t\t$Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);\n\t\t$T1 = (((($Check1 & 0x3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );\n\t\t$T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );\n\t\treturn ($T1 | $T2);\n\t}",
"function getCryptHash($str)\n{\n $salt = '';\n if (CRYPT_BLOWFISH) {\n if (version_compare(PHP_VERSION, '5.3.7') >= 0) { // http://www.php.net/security/crypt_blowfish.php\n $algo_selector = '$2y$';\n } else {\n $algo_selector = '$2a$';\n }\n $workload_factor = '12$'; // (around 300ms on Core i7 machine)\n $val_arr = array(\n '.',\n '/'\n );\n $range1 = range('0', '9');\n $range2 = range('a', 'z');\n $range3 = range('A', 'Z');\n $res_arr = array_merge($val_arr, $range1, $range2, $range3);\n $salt = $algo_selector . $workload_factor . getRandomStr($res_arr, 22); // './0-9A-Za-z'\n \n } else if (CRYPT_MD5) {\n $algo_selector = '$1$';\n $char1 = chr(33);\n $char2 = chr(127);\n $range = range($char1, $char2);\n $salt = $algo_selector . getRandomStr($range, 12); // actually chr(0) - chr(255), but used ASCII only\n \n } else if (CRYPT_SHA512) {\n $algo_selector = '$6$';\n $workload_factor = 'rounds=5000$';\n $char1 = chr(33);\n $char2 = chr(127);\n $range = range($char1, $char2);\n $salt = $algo_selector . $workload_factor . getRandomStr($range, 16); // actually chr(0) - chr(255), but used ASCII only\n \n } else if (CRYPT_SHA256) {\n $algo_selector = '$5$';\n $workload_factor = 'rounds=5000$';\n $char1 = chr(33);\n $char2 = chr(127);\n $range = range($char1, $char2);\n $salt = $algo_selector . $workload_factor . getRandomStr($range, 16); // actually chr(0) - chr(255), but used ASCII only\n \n } else if (CRYPT_EXT_DES) {\n $algo_selector = '_';\n $val_arr = array(\n '.',\n '/'\n );\n $range1 = range('0', '9');\n $range2 = range('a', 'z');\n $range3 = range('A', 'Z');\n $res_arr = array_merge($val_arr, $range1, $range2, $range3);\n $salt = $algo_selector . getRandomStr($res_arr, 8); // './0-9A-Za-z'.\n \n } else if (CRYPT_STD_DES) {\n $algo_selector = '';\n $val_arr = array(\n '.',\n '/'\n );\n $range1 = range('0', '9');\n $range2 = range('a', 'z');\n $range3 = range('A', 'Z');\n $res_arr = array_merge($val_arr, $range1, $range2, $range3);\n $salt = $algo_selector . getRandomStr($res_arr, 2); // './0-9A-Za-z'\n \n }\n return crypt($str, $salt);\n}",
"public static function hash($string)\n {\n if (function_exists('md5')) {\n return md5($string);\n }\n\n if (is_array($string) || is_object($string)) {\n $type = gettype($string);\n $caller = next(debug_backtrace());\n $eror['line'] = $caller['line'];\n $eror['file'] = strip_tags($caller['file']);\n $error['type'] = E_USER_ERROR;\n trigger_error(\n \"md5() expects parameter 1 to be string, \"\n . $type\n . \" given in <b>{$file}</b> on line <b>{$line}</b><br />\\n\",\n E_USER_ERROR\n );\n\n return;\n }\n\n // convert into string\n $string = \"{$string}\";\n $instance = self::singleton();\n $A = \"67452301\";\n $a = $A;\n $B = \"efcdab89\";\n $b = $B;\n $C = \"98badcfe\";\n $c = $C;\n $D = \"10325476\";\n $d = $D;\n $words = $instance->binArray($string);\n for ($i = 0; $i <= count($words)/16-1; $i++) {\n $a = $A;\n $b = $B;\n $c = $C;\n $d = $D;\n /* ROUND 1 */\n $a = $instance->pad($a, $b, $c, $d, $words[0 + ($i * 16)], 7, \"d76aa478\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[1 + ($i * 16)], 12, \"e8c7b756\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[2 + ($i * 16)], 17, \"242070db\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[3 + ($i * 16)], 22, \"c1bdceee\", '1');\n $a = $instance->pad($a, $b, $c, $d, $words[4 + ($i * 16)], 7, \"f57c0faf\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[5 + ($i * 16)], 12, \"4787c62a\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[6 + ($i * 16)], 17, \"a8304613\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[7 + ($i * 16)], 22, \"fd469501\", '1');\n $a = $instance->pad($a, $b, $c, $d, $words[8 + ($i * 16)], 7, \"698098d8\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[9 + ($i * 16)], 12, \"8b44f7af\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[10 + ($i * 16)], 17, \"ffff5bb1\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[11 + ($i * 16)], 22, \"895cd7be\", '1');\n $a = $instance->pad($a, $b, $c, $d, $words[12 + ($i * 16)], 7, \"6b901122\", '1');\n $d = $instance->pad($d, $a, $b, $c, $words[13 + ($i * 16)], 12, \"fd987193\", '1');\n $c = $instance->pad($c, $d, $a, $b, $words[14 + ($i * 16)], 17, \"a679438e\", '1');\n $b = $instance->pad($b, $c, $d, $a, $words[15 + ($i * 16)], 22, \"49b40821\", '1');\n\n /* round 2 */\n $a = $instance->pad($a, $b, $c, $d, $words[1 + ($i * 16)], 5, \"f61e2562\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[6 + ($i * 16)], 9, \"c040b340\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[11 + ($i * 16)], 14, \"265e5a51\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[0 + ($i * 16)], 20, \"e9b6c7aa\", '2');\n $a = $instance->pad($a, $b, $c, $d, $words[5 + ($i * 16)], 5, \"d62f105d\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[10 + ($i * 16)], 9, \"2441453\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[15 + ($i * 16)], 14, \"d8a1e681\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[4 + ($i * 16)], 20, \"e7d3fbc8\", '2');\n $a = $instance->pad($a, $b, $c, $d, $words[9 + ($i * 16)], 5, \"21e1cde6\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[14 + ($i * 16)], 9, \"c33707d6\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[3 + ($i * 16)], 14, \"f4d50d87\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[8 + ($i * 16)], 20, \"455a14ed\", '2');\n $a = $instance->pad($a, $b, $c, $d, $words[13 + ($i * 16)], 5, \"a9e3e905\", '2');\n $d = $instance->pad($d, $a, $b, $c, $words[2 + ($i * 16)], 9, \"fcefa3f8\", '2');\n $c = $instance->pad($c, $d, $a, $b, $words[7 + ($i * 16)], 14, \"676f02d9\", '2');\n $b = $instance->pad($b, $c, $d, $a, $words[12 + ($i * 16)], 20, \"8d2a4c8a\", '2');\n\n /* round 3 */\n $a = $instance->pad($a, $b, $c, $d, $words[5 + ($i * 16)], 4, \"fffa3942\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[8 + ($i * 16)], 11, \"8771f681\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[11 + ($i * 16)], 16, \"6d9d6122\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[14 + ($i * 16)], 23, \"fde5380c\", '3');\n $a = $instance->pad($a, $b, $c, $d, $words[1 + ($i * 16)], 4, \"a4beea44\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[4 + ($i * 16)], 11, \"4bdecfa9\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[7 + ($i * 16)], 16, \"f6bb4b60\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[10 + ($i * 16)], 23, \"bebfbc70\", '3');\n $a = $instance->pad($a, $b, $c, $d, $words[13 + ($i * 16)], 4, \"289b7ec6\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[0 + ($i * 16)], 11, \"eaa127fa\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[3 + ($i * 16)], 16, \"d4ef3085\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[6 + ($i * 16)], 23, \"4881d05\", '3');\n $a = $instance->pad($a, $b, $c, $d, $words[9 + ($i * 16)], 4, \"d9d4d039\", '3');\n $d = $instance->pad($d, $a, $b, $c, $words[12 + ($i * 16)], 11, \"e6db99e5\", '3');\n $c = $instance->pad($c, $d, $a, $b, $words[15 + ($i * 16)], 16, \"1fa27cf8\", '3');\n $b = $instance->pad($b, $c, $d, $a, $words[2 + ($i * 16)], 23, \"c4ac5665\", '3');\n\n /* round 4 */\n $a = $instance->pad($a, $b, $c, $d, $words[0 + ($i * 16)], 6, \"f4292244\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[7 + ($i * 16)], 10, \"432aff97\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[14 + ($i * 16)], 15, \"ab9423a7\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[5 + ($i * 16)], 21, \"fc93a039\", '4');\n $a = $instance->pad($a, $b, $c, $d, $words[12 + ($i * 16)], 6, \"655b59c3\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[3 + ($i * 16)], 10, \"8f0ccc92\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[10 + ($i * 16)], 15, \"ffeff47d\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[1 + ($i * 16)], 21, \"85845dd1\", '4');\n $a = $instance->pad($a, $b, $c, $d, $words[8 + ($i * 16)], 6, \"6fa87e4f\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[15 + ($i * 16)], 10, \"fe2ce6e0\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[6 + ($i * 16)], 15, \"a3014314\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[13 + ($i * 16)], 21, \"4e0811a1\", '4');\n $a = $instance->pad($a, $b, $c, $d, $words[4 + ($i * 16)], 6, \"f7537e82\", '4');\n $d = $instance->pad($d, $a, $b, $c, $words[11 + ($i * 16)], 10, \"bd3af235\", '4');\n $c = $instance->pad($c, $d, $a, $b, $words[2 + ($i * 16)], 15, \"2ad7d2bb\", '4');\n $b = $instance->pad($b, $c, $d, $a, $words[9 + ($i * 16)], 21, \"eb86d391\", '4');\n\n $A = $instance->add(\n $instance->hexdec($a),\n $instance->hexdec($A)\n );\n $B = $instance->add(\n $instance->hexdec($b),\n $instance->hexdec($B)\n );\n $C = $instance->add(\n $instance->hexdec($c),\n $instance->hexdec($C)\n );\n $D = $instance->add(\n $instance->hexdec($d),\n $instance->hexdec($D)\n );\n }\n\n $words = $instance->str2Hex($A)\n . $instance->str2Hex($B)\n . $instance->str2Hex($C)\n . $instance->str2Hex($D);\n unset($a, $b, $c, $d, $A, $B, $C, $D, $string, $instance);\n return $words;\n }",
"private function getStringJson($str)\n {\n // fisrt filter\n $firstFilter = \"]='\"; \n if (!strstr($str, $firstFilter)) {\n return false;\n } \n $array = explode($firstFilter, $str); \n \n // filter clear tab enter return car\n foreach ($array as $key => $value) {\n $haystack = \"';\";\n $value = str_replace(array(\"\\n\", \"\\r\", '\\t'), '', $value);\n $value = preg_replace('/\\s+/', ' ', $value);\n $value = trim ($value);\n $array[$key] = $value;\n }\n \n // second filter\n $ids = array();\n foreach ($array as $key => $value) {\n $haystack = \"';\"; \n if (strstr($value, $haystack)) {\n $part = explode($haystack, $value);\n if (strlen($part[0]) == 11) {\n $ids[] = array('id' => $part[0]);\n } \n }\n }\n \n return (count($ids) > 0) ? json_encode($ids) : false;\n }",
"public function hash();",
"function HashURL($String) {\n\t\t$Check1 = $this->StrToNum($String, 0x1505, 0x21);\n\t\t$Check2 = $this->StrToNum($String, 0, 0x1003F);\n\t\n\t\t$Check1 >>= 2; \t\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);\n\t\t$Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);\n\t\t$Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);\t\n\t\t\n\t\t$T1 = (((($Check1 & 0x3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );\n\t\t$T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );\n\t\t\n\t\treturn ($T1 | $T2);\n\t}",
"public function hashID()\n {\n return $this->getCleanString(self::$_hash_id_clean);\n }",
"public function sha1($str)\n {\n if (!function_exists('sha1')) {\n if (!function_exists('mhash')) {\n Fly::import('system.libraries.Sha1');\n $SH = new Sha1();\n return $SH->generate($str);\n } else {\n return bin2hex(mhash(MHASH_SHA1, $str));\n }\n } else {\n return sha1($str);\n }\n }",
"public function getPasswordHash() : string{\n \treturn $this->getConfig()->getAll()[\"passwordHash\"];\n }",
"public function getHashService();",
"public function hashString(){ return $this->ulA->db->ID . \"_\" . $this->ulA->ID . \"_\" . $this->ulB->db->ID . \"_\" . $this->ulB->ID; }",
"public function getHash(): string\n {\n return hash_hmac('sha256', $this->token, Config::SECRET_KEY);\n }",
"private function randKey($str='', $long=0){//este\n $key = null;\n $str = str_split($str);\n $start = 0;\n $limit = count($str)-1;\n for($x=0; $x<$long; $x++)\n {\n $key .= $str[rand($start, $limit)];\n }\n return $key;\n }",
"private function createHash($string, $params = array())\n {\n $query = null;\n\n if ($string) {\n $query .= $string;\n }\n\n if ($params && is_array($params)) {\n $query .= http_build_query($params);\n }\n\n if ($query) {\n $hash = 'stub_' . hash('fnv1a64', $query);\n return $hash;\n }\n\n return false;\n }",
"public static function zend_hash_str_find(HashTable $ht, string $key, int $len): Zval {\n }",
"public function formatUrlKey(string $str): string\n {\n return $this->filter->translitUrl($str);\n }",
"private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}",
"static private function passwordToHash($realString) {\r\n\t\treturn md5(trim($realString).self::$SALT);\r\n\t}",
"public function getHash(): string\n {\n return $this->data->hash;\n }",
"public function getHashIdentifier() : string;",
"function string4(){\n\n $string4 = \"Hola mundo\";\n $hash1 = password_hash($string4, PASSWORD_DEFAULT);\n\n echo $hash1;\n\n}",
"protected function hash($string)\n\t{\n\t\treturn md5($string);\n\n\t}",
"public function hashCode() : string;",
"private function getHash($url){\r\n return $url;\r\n }",
"public function hashCode(): string;",
"public function getHash(){\n\t\treturn $this->name->getHash();\n\t}",
"public function getStringAlgorithm() {}",
"function my_hash($string, $username = null) {\r\n\t\t$salt = getStoredSalt($username);\r\n\t\tif (!$salt) {\r\n\t\t\t// generate the salt and store it in the database\r\n\t\t\t$salt = substr(md5(uniqid(rand(),true)),0,24);\r\n\t\t\tstoreSalt($username, $salt);\r\n\t\t}\r\n\t\treturn sha1($salt . $string);\r\n\t}",
"public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}",
"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 getProjectHash() {\n\t\t$hash\t= '';\n\n\t\tif( $this->_param['useHash'] ) {\n\t\t\t$string = '';\n\t\t\t$vals\t= array();\n\n\t\t\t// build an array with values only - all values except 'language_id''\n\t\t\tforeach( $this->formData as $key => $value ) {\n\t\t\t\tif( $key != 'language_id' ) {\n\t\t\t\t\t$vals[] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$string\t= implode( '|', $vals );\n\t\t\t$hash\t= $this->getHash( $string );\n\n\t\t\tif( $this->_debug == 1 ) {\n\t\t\t\t$msg = 'values for hash calculation:<br />'\n\t\t\t\t. 'values as array:<br />'\n\t\t\t\t. print_r( $vals, true )\n\t\t\t\t. '<hr />'\n\t\t\t\t. 'values as string:<br />'\n\t\t\t\t. $string\n\t\t\t\t. '<hr />'\n\t\t\t\t. 'hash value [' . $hash . ']';\n\n\t\t\t\t$this->writeLog( $msg, 5 );\n\t\t\t}\n\t\t}\n\n\t\t// add the hash value to the form datas\n\t\t$this->formData = array_merge( $this->formData, array( 'hash' => $hash ) );\n\t}",
"public function makeHash(\\codename\\core\\credential $credential) : string;",
"public function hash($string, $type = null, $salt = false) {\n\t\treturn Security::hash($string, $type, $salt);\n\t}",
"public function getSharedSecretHash()\n {\n return isset($this->shared_secret_hash) ? $this->shared_secret_hash : '';\n }",
"protected static function getHash($what)\n {\n if (\\is_string($what)) {\n return \\md5($what);\n }\n if ($what instanceof Reflector) {\n return self::getHashFromReflector($what);\n }\n $str = \\is_object($what) ? \\get_class($what) : \\gettype($what);\n return \\md5($str);\n }",
"public function getHash($string, array $options = [])\n {\n $path = $this->buildPath(static::HASH_ENDPOINT);\n\n $data = [\n 'string' => $string\n ];\n\n if (ArrayUtils::has($options, 'hasher')) {\n $data['hasher'] = ArrayUtils::pull($options, 'hasher');\n }\n\n $data['options'] = $options;\n\n $request = $this->performRequest('POST', $path, ['body' => $data]);\n return $request->data->hash;\n }",
"private function getHash( $val, $log = false ) {\n\t\t$ret = '';\n\n\t\tif( $this->_debug == 1 && $log ) {\n\t\t\techo \"\\n\" . '## using hash method [' . $this->_param['hashMethod'] . ']' . \"\\n\";\n\t\t\techo \"\\n\" . 'values to calculate:' . \"\\n\";\n\t\t\techo $val;\n\t\t\techo \"\\n\";\n\t\t}\n\n\t\t// clean value from &\n\t\t$val = str_replace( '&', '&', $val );\n\t\t// calculate hash\n\t\t$ret = hash( $this->_param['hashMethod'], $val );\n\n\t\tif( $this->_debug == 1 && $log ) {\n\t\t\techo \"\\n\" . 'generated hash:' . \"\\n\";\n\t\t\techo $ret;\n\t\t\techo \"\\n\";\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public function fromString($string)\n\t{\n\t\t$prefix = SteemHelper::str_slice($string, 0, strlen($this->address_prefix));\n\t\tif ($prefix != $this->address_prefix) {\n\t\t\treturn \"Expecting key to begin with \".$this->address_prefix.\", instead got \".$prefix;\n\t\t} else {\n\t\t\t$addy = SteemHelper::str_slice($string, strlen($this->address_prefix));\n\t\t\t$addy = new Buffer(Base58::decode($addy)->getHex());\n\t\t\t$checksum = $addy->slice(-4);\n\t\t\t$addy = $addy->slice(0, 4);\n\t\t\t$new_checksum = Hash::ripemd160($addy);\n\t\t\t$new_checksum = $new_checksum->slice(0, 4);\n\t\t\tif ($checksum->getHex() != $new_checksum->getHex())\n\t\t\t{\n\t\t\t\treturn 'Checksum did not match';\n\t\t\t}\n\t\t\t$SteemAddress = new SteemAddress($addy->getHex(), $this->address_prefix);\n\t\t\treturn $SteemAddress->toString();\n\t\t}\n\t}",
"public function hash(string $value)\n {\n }",
"function get_wp_hash($hashkey=\"\") {\n\t\t$wassuphash = \"\";\n\t\tif (function_exists('wp_hash')) { \n\t\t\tif (empty($hashkey)) {\n\t\t\t\tif (defined('SECRET_KEY')) { \n\t\t\t\t\t$hashkey = SECRET_KEY;\n\t\t\t\t} else { \n\t\t\t\t\t$hashkey = \"wassup\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$wassuphash = wp_hash($hashkey);\n\t\t}\n\t\treturn $wassuphash;\n\t}",
"function RSHash($string) {\n $a = 63689;\n $b = 378551;\n $hash = 0;\n\n for ($i = 0, $x = strlen($string); $i < $x; $i++) {\n $hash = $hash * $a + (int) ord($string[$i]);\n $hash = fmod($hash, 65535);\n $a = $a * $b;\n $a = fmod($a, 65535);\n }\n\n return $hash;\n }",
"function verify($string)\n{\n\t$string = preg_replace(\"/[^a-z0-9\\-]/\", \"\", $string);\n\tif(strlen($string) == 36)\n\t{\n\t\t$hash = explode(\"-\", $string);\n\t\t$hash = $hash[4].$hash[0].$hash[3].$hash[1].$hash[2];\n\t\treturn $hash;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}",
"function mcsha1($str)\n{\n\t$gmp = gmp_import(sha1($str, true));\n\tif(gmp_cmp($gmp, gmp_init(\"0x8000000000000000000000000000000000000000\")) >= 0)\n\t{\n\t\t$gmp = gmp_mul(gmp_add(gmp_xor($gmp, gmp_init(\"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\")), gmp_init(1)), gmp_init(-1));\n\t}\n\treturn gmp_strval($gmp, 16);\n}"
] | [
"0.71996737",
"0.7061308",
"0.6919904",
"0.67925525",
"0.6655747",
"0.65481097",
"0.6514853",
"0.64912003",
"0.6231753",
"0.62079966",
"0.6176047",
"0.61236596",
"0.6118815",
"0.60848767",
"0.6081343",
"0.6071801",
"0.6018405",
"0.59719974",
"0.59462076",
"0.59116787",
"0.590701",
"0.5872514",
"0.58669555",
"0.58669555",
"0.58669555",
"0.58669555",
"0.5840456",
"0.5819923",
"0.5801209",
"0.5776424",
"0.57761467",
"0.5770575",
"0.57562184",
"0.5728396",
"0.57131267",
"0.57104737",
"0.5681023",
"0.56450003",
"0.5581889",
"0.5551446",
"0.55476",
"0.5546394",
"0.55447227",
"0.55264735",
"0.5517221",
"0.551608",
"0.55016327",
"0.54911923",
"0.5486961",
"0.54847735",
"0.5481232",
"0.54591024",
"0.54576254",
"0.5440318",
"0.5421852",
"0.5421852",
"0.5396602",
"0.5376058",
"0.5367085",
"0.5348351",
"0.53360206",
"0.53182405",
"0.53160685",
"0.531441",
"0.5304291",
"0.5302285",
"0.5293342",
"0.5293062",
"0.52863497",
"0.5278891",
"0.5278686",
"0.5268822",
"0.52630585",
"0.52399707",
"0.5235745",
"0.52339876",
"0.5231941",
"0.5230058",
"0.52180076",
"0.52051884",
"0.5198717",
"0.51935196",
"0.5192971",
"0.5169472",
"0.5151931",
"0.5133321",
"0.5133106",
"0.51240873",
"0.5112344",
"0.5110324",
"0.5106028",
"0.508872",
"0.5074274",
"0.50542927",
"0.50478435",
"0.5039567",
"0.5039475",
"0.50388503",
"0.5036434",
"0.5021682"
] | 0.7244635 | 0 |
Passa dos dados do componente para a view para ser usada pelo helper | public function _dados_para_view() {
$data = get_object_vars($this);
unset($data['controller']);
unset($data['components']);
unset($data['Session']);
unset($data['RequestHandler']);
$this->controller->set('seguranca_data', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function componente()\n {\n $logoEmpresa = DB::table('empresas')\n ->select('logo_empresa', 'nombre_corto')\n ->get();\n return view('/cliente/nuevaCita', ['logoEmpresa' => $logoEmpresa]);\n }",
"public function Parametros_Equipos_C(){\n\t\treturn view('Administrador/Formularios.Create_Parametros');\n\t}",
"public function getViewComponent();",
"public function render()\n {\n return view('components.producto');\n }",
"function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }",
"protected function getViewData() {\n\n }",
"public function __invoke()\n {\n //$data = [\"listeproduit\"=>config(\"app.listeproduit\")];\n $db = Produit::query()->select(\"nom\",'image','quantite','id')->get();// au lieu de \"Produit::all()\" pour pouvoir choisir quelle donne envoyé\n $tableaffichage=[]; //pour avoir un tableau vide pour pourvoir stocker des string et non des objets\n foreach($db as $yuumi){\n\n array_push($tableaffichage, $yuumi->getAttributes());//insere la valeur dans le tableau\n }\n return view('liste',[\"db\"=>$db]);//[\"db\"=>$db] tableau associatif pour pouvoir lui donner un nom et l'appeler dans le blade\n }",
"public function render()\n {\n return view('components.horario-component');\n }",
"public function listaViajesAltaAgendaViajes(){\n $this->view->listaViajesAltaAgendaViajes();\n}",
"public function getFormProductos(){\n $productos=productos::getFormProductosSQL();\n $categorias=categorias::getFormCategoriasSQL();\n $marcas=marcas::getFormMarcasSQL();\n return view('productosDashboard', compact('productos', 'categorias', 'marcas'));\n\n }",
"public function callViewHelper() {}",
"public function buscar(){\t\t\n\t\treturn view('emitente.editar');\n\t}",
"public function showDataObservado()\n {\n #1. Obtengo la información solicitada\n $estado = 4;\n $data = ExpedienteSdaUr::getDataExpediente($estado);\n #2. retorno al menu principal\n return view($this->path.'.data-observado', compact('data'));\n }",
"public function render()\n {\n if(strlen($this->search) > 0)\n {\n $info = Personal::where('name', 'like', '%' . $this->search . '%')\n ->orwhere('last_name', 'like', '%' . $this->search . '%')\n ->orwhere('nro_ci', 'like', '%' . $this->search . '%')\n ->paginate(5);\n return view('livewire.personal.component',[\n 'info'=>$info,\n ]);\n }else {\n // caso contrario solo retornamos el componente inyectado con 5 registros\n return view('livewire.personal.component', [\n 'info' => Personal::paginate(5),\n ]);\n }\n }",
"public function actionView($id_cat_puesto)\n{\n$this->render('view',array(\n'catPuesto'=>$this->loadModel($id_cat_puesto),\n));\n}",
"public function render()\n {\n // $datas=tapel::all();\n // dd($datas);\n return view('components.table-tapel');\n }",
"public function cadastro()\n {\n\n return view('veiculo.cadastro', [\n 'lista_clientes' => $this->lista_clientes(),\n 'ano' => $this->ano(),\n ]);\n }",
"public function get_component() {\n return \"dataformview_$this->type\";\n }",
"function render(){\r\n $productos2 = $this->model->get();\r\n $this->view->productos = $productos;\r\n $this->view->render('burger/index');\r\n }",
"public function getRender(){\n //Adiciona a funcionalidade para definir o campo que deve receber o foco inicial\n if($this->getCampoFoco() != null){\n $sFuncao = View::campoFocus($this->getCampoFoco()->getId());\n $this->addListener(Base::EVENTO_APOS_MONTAR, $sFuncao);\n }\n \n //Adiciona a funcionalidade que centraliza o formulário na tela\n if($this->getCentraliza()){\n $sFuncao = Base::getFuncaoCentraliza();\n $this->addListener(Base::EVENTO_MONTAR, $sFuncao);\n }\n \n //Adiciona a funcionalidade que indica que será possível arrastar o formulário\n if($this->getPermiteArrastar()){\n $sFuncao = Base::getFuncaoLimitaArrasto($this->getId(),$this->getRenderTo());\n $this->addListener(Base::EVENTO_MONTAR, $sFuncao);\n }\n \n $aRender = array(\n \"animCollapse\" => true,\n \"autoScroll\" => true,\n \"waitMsgTarget\" => true,\n \"bodyPadding\" => 10,\n \"iconCls\" => 'icon-form',\n \"border\" => $this->getAdicionaBorda(),\n //\"glyph\" => 36,\n \"layout\" => $this->getLayout(),\n \"id\" => $this->getId(),\n \"title\" => $this->getTitulo(),\n \"closable\" => $this->getPermiteFechar(),\n \"resizable\" => $this->getPermiteRedimensionar(),\n \"draggable\" => $this->getPermiteArrastar(),\n \"collapsible\" => $this->getPermiteRecolher(),\n \"height\" => $this->getAltura(),\n \"width\" => $this->getLargura(),\n \"html\" => $this->getHtml(),\n \"items\" => $this->getStringItemsLayout(),\n \"buttons\" => $this->getBotoes(),\n \"listeners\" => $this->getListeners(),\n \"reloadPreviousOnClose\" => $this->getReloadPreviousOnClose()\n );\n \n $oForm = \"Ext.create('Ext.panel.Panel', {\".Base::getRender($aRender).\"})\";\n \n return Base::addObj($oForm,$this->getRenderTo());\n }",
"public function informacionViaje(){\n $this->view->informacionDetalladaViaje();\n}",
"public function viewPDS(){\n//\n// return view('Employee/PdsOfEmp')->with(\"employeedata\", $employeedata);\n }",
"public function render()\n {\n return view('dwbtui::components.html');\n }",
"public function buscarEmpleado($id)\n {\n if($id){\n $empleado = $this->empleadorepo->buscar($id);\n }\n\n return view('empleado.detalle', compact('empleado'));\n }",
"public function consulta() {\n return view('tiempo');\n }",
"public function viajesFuturos(){\n // $viajes = $this->model->viajesFuturos($usuario, $email);\n $this->view->viajesFuturos();\n}",
"public function services()\n {\n $comptes = compte::all();\n return view('pages.services')->with('comptes',$comptes);//->with($data);\n }",
"public function actionView($id_curso_disponible_servidor_publico)\n{\n$this->render('view',array(\n'cursoDisponibleServidorPublico'=>$this->loadModel($id_curso_disponible_servidor_publico),\n));\n}",
"public function render()\n {\n return view('components.acrostico');\n }",
"public function actionVariables(){\n\n \n $model= new AccionCentralizadaVariableEjecucion();\n \n return $this->render('variables', [\n 'model' => $model->variablesAsignadas(),//provider,\n ]);\n\n }",
"public function compose()\n {\n view()->composer('intern.ikm.statistik.index', function ($view){\n\n $view->with('id', static::$data->id); \n\n $view->with('questions', Question::all());\n\n $view->with('ikm', Jadwal::select('id', 'keterangan')->get());\n\n $view->with('ikm_ket', Jadwal::select('keterangan')->whereId(static::$data->id)->first()); \n \n }); \n }",
"function Contenido(){\n \n $sql = 'SELECT id_planta codigo, descripcion from plantas WHERE activo = 1';\n $arrPlantas = $this->Consulta($sql);\n \n $html= '<section class=\"main-content-wrapper\">\n <div class=\"pageheader\">\n <h1>'.$this->_titulo.'</h1>\n <p class=\"description\">'.$this->_subTitulo.'</p>\n <div class=\"breadcrumb-wrapper hidden-xs\">\n <span class=\"label\">Estas Aquí:</span>\n <ol class=\"breadcrumb\">\n <li class=\"active\">Administrar Componentes</li>\n </ol>\n </div>\n </div>\n \n <div class=\"col-md-8\">\n <div class=\"panel panel-default panelCrear\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">COMPONENTES</h3>\n <div class=\"actions pull-right\">\n <i class=\"fa fa-expand\"></i>\n <i class=\"fa fa-chevron-down\"></i>\n <i class=\"fa fa-times\"></i>\n </div>\n </div>\n <div class=\"panel-body\">\n <form id=\"formCrear\" role=\"form\">\n <div class=\"form-group\">\n <label for=\"nombre\">Nombre Componente:</label>\n '.\n \n $this->create_input('text','descripcion','descripcion','Nombre del componente',false,'form-control required').\n $this->create_input('hidden',$this->PrimaryKey,$this->PrimaryKey,false,'0').\n $this->create_input('hidden','id_usuario','id_usuario',false,$_SESSION['id_usuario']).\n '\n \n </div>\n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Planta:</label>\n '.$this->crearSelect('id_planta','id_planta',$arrPlantas,false,false,false,'class=\"form-control required\" onchange=\"traerCombo(this.value,\\'combo_id_secciones\\',\\'comboSeccion\\')\"').'\n \n \n </div>\n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Seccion:</label>\n <span id=\"combo_id_secciones\"> -- </span>\n \n </div> \n \n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Equipos:</label>\n <span id=\"combo_id_equipos\"> -- </span>\n </div>\n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Codigo Empresa:</label>\n '.$this->create_input('text','codigo_empresa','codigo_empresa','Codigo de la empresa',false,'form-control required').'\n \n </div> \n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Consecutivo:</label>\n '.$this->create_input('text','consecutivo','consecutivo','escriba consecutivo',false,'form-control required').'\n \n </div>\n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Fabricante:</label>\n '.$this->create_input('text','id_fabricante','id_fabricante','cod fabricante',false,'form-control required').'\n \n </div>\n \n <div class=\"form-group\">\n <label for=\"id_cursos\">Temperatura Maxima:</label>\n '.$this->create_input('text','tempmaxima','tempmaxima','Temperatura Maxima ',false,'form-control required').'\n \n </div>'; \n if(\t$_SESSION[\"tipo_usuario\"]<>3){\n $html.='<button type=\"button\" id=\"guardarCurso\" class=\"btn btn-primary\">Guardar Componente</button>';\n }\n $html.='<div id=\"Resultado\" style=\"display:none\">RESULTADO</div>\n </form>\n </div>\n </div>\n </div> '.$this->tablaDatos().'\n \n </div>\n </div>\n </div> \n\n </section> '; \n return $html;\n \n }",
"public function retorno(){\n\n $cod_pedido = $_REQUEST[\"cod_pedido\"];\n $sacarDatosPedido = (new Orm)->sacarDatosPedidoPasarela($cod_pedido);\n $data=0;\n echo Ti::render(\"view/pedido.phtml\", compact( \"sacarDatosPedido\", \"data\",\"cod_pedido\"));\n\n }",
"public function index()\n {\n // Se obtienen todos lo equipos que estan creados en la base de datos \n $equipos = ActivoFijo::all(); \n /* Se obtienen los tipos de equipos */ \n $tipoEquipos = TipoEquipo::orderBy('descripcion','ASC')->lists('descripcion','id');\n /* Se recorre la informacion para obtener la descripcion del tipo del equipo */\n $equipos->each(function($equipos){\n $equipos->tipoEquipo();\n });\n /* se envia la informacion a la vista */\n return view('equipos.index')->with('equipos',$equipos)->with('tipoEquipos',$tipoEquipos);\n }",
"public function getRender(){\n /*\n * adiciona os listeners de comportamento padrão do componente\n */\n \n //ação que executa ao clicar sobre algum evento, abre a tela com as informações carregadas\n $sFuncao = \"eventWindow.show(record, el);\";\n $this->addListener(self::EVENTO_CLICK,$sFuncao,\"view, record, el\");\n \n //ação que ocorre ao clicar sobre os grids (dia, semana, mês)\n $sFuncao = \"eventWindow.show({\"\n .\"StartDate: date,\"\n .\"IsAllDay: allDay\"\n .\"}, el);\";\n $this->addListener(self::EVENTO_DAY_CLICK,$sFuncao,\"view, date, allDay, el\");\n \n //ação que ocorre ao redimensionar (aumentar ou reduzir) o tempo de um evento\n $sFuncaoUpdate = \"var calendarEventStore = Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].eventStore;\"\n .\"calendarEventStore.sync({\"\n .\"callback: function(batch, operation){\"\n .\"var result = batch.operations[0].request.scope.reader.jsonData['success'];\"\n .\"if(!result){\"\n .\"calendarEventStore.rejectChanges();\"\n .\"}\"\n .\"}\"\n .\"});\";\n $this->addListener(self::EVENTO_RESIZE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao mover um evento na tela\n $this->addListener(self::EVENTO_MOVE,$sFuncaoUpdate,\"view, record\");\n \n //ação que ocorre ao iniciar a movimentação dos elementos na tela\n $sFuncao = \"if(eventWindow && eventWindow.isVisible()){\"\n .\"eventWindow.hide();\"\n .\"}\";\n $this->addListener(self::EVENTO_DRAG,$sFuncao,\"view\");\n \n //ação que ocorre após selecionar várias linhas no grid (permite criar novo eventos por intervalos)\n $sFuncao = \"eventWindow.show(dates);\"\n .\"eventWindow.on('hide', onComplete, this, {single:true});\";\n $this->addListener(self::EVENTO_RANGE,$sFuncao,\"window, dates, onComplete\");\n \n /*\n * eventos que podem ser implementados no componente\n */\n //$this->addListener(self::EVENTO_OVER,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_OUT,\"\",\"view, record, el\");\n //$this->addListener(self::EVENTO_ADD,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_UPDATE,$sFuncao,\"form, record\");\n //$this->addListener(self::EVENTO_DELETE,$sFuncao,\"window, record\");\n //$this->addListener(self::EVENTO_CANCEL,\"\",\"form, record\");\n //$this->addListener(self::EVENTO_VIEW_CHANGE,$sFuncao,\"panel, view, info\");\n \n $aRender = array(\n \"xtype\" => 'calendarpanel',\n \"itemId\" => $this->getId().\"-calendar\",\n \"calendarStore\" => $this->getRenderStoreTipoEvento(),\n \"eventStore\" => $this->getRenderStoreEvento(),\n \"activeItem\" => $this->getPerspectiva(),\n \"showNavBar\" => $this->getMostraBarraPerspectivas(),\n \"showDayView\" => $this->getMostraPerspectivaDia(),\n \"showWeekView\" => $this->getMostraPerspectivaSemana(),\n \"showMonthView\" => $this->getMostraPerspectivaMes(),\n \"showTime\" => $this->getMostraHora(),\n \"monthViewCfg\" => $this->getConfiguracaoMes(),\n \"eventIncrement\" => $this->getDuracaoEvento(),\n \"viewStartHour\" => $this->getHoraInicial(),\n \"viewStartMinute\" => $this->getMinutoInicial(),\n \"viewEndHour\" => $this->getHoraFinal(),\n \"viewEndMinute\" => $this->getMinutoFinal(),\n \"viewConfig\" => $this->getConfiguracao(),\n \"listeners\" => $this->getListeners()\n );\n \n $sRender = \"Ext.create('Ext.panel.Panel', {\"\n .\"layout: 'border',\"\n .\"border: true,\"\n .\"items: [{\"\n .\"xtype: 'panel',\"\n .\"itemId: '\".$this->getId().\"-region-west',\"\n .\"region: 'west',\"\n .\"title: 'Calendário',\"\n .\"collapsible: true,\"\n .\"split: true,\"\n .\"width: 220,\"\n .\"maxWidth: 220,\"\n .\"layoutConfig: {\"\n .\"fill: false,\"\n .\"animate: true\"\n .\"},\"\n .\"padding: '3',\"\n .\"bodyStyle:{\"\n .\"backgroundColor: '#157fcc'\"\n .\"},\"\n .\"items: [{\"\n .\"xtype: 'datepicker',\"\n .\"itemId: '\".$this->getId().\"-picker',\"\n .\"cls: 'ext-cal-nav-picker',\"\n .\"listeners: {\"\n .\"'select': {\"\n .\"fn: function(dp, dt){\"\n .\"Ext.ComponentQuery.query('#\".$this->getId().\"-calendar')[0].setStartDate(dt);\"\n .\"},\"\n .\"scope: this\"\n .\"}\"\n .\"}\"\n .\"},{\"\n .$this->getListaAgenda()\n .\"}]\"\n .\"},{\"\n .\"region: 'center',\"\n .\"itemId: '\".$this->getId().\"-region-center',\"\n .\"style:{\"\n .\"border: '3px solid #5A91D2',\"\n .\"borderLeft: 'none'\"\n .\"},\"\n .Base::getRender($aRender)\n .\"}]\"\n .\"})\";\n \n return Base::addObj($sRender,$this->getRenderTo()).$this->getTelaManutencao();\n }",
"public function createLocatorio(){\n\n //cuando tiene más de un local preguntar antes de iniciar sesión\n //cual nombre comercial para setearla\n\n\n\n\n return view('panel.register.encargadoRegister')->with([\n 'companies' => Company::all(),\n ]);\n\n\n }",
"function view(){\n\n $course_id = $this->params[0];\n $this->course = get_first(\"SELECT * FROM course WHERE course_id = '{$course_id}'\");\n $this->lessons = get_all(\"SELECT * FROM lesson WHERE course_id = '{$course_id}'\");\n }",
"public function getContent()\n {\n /**\n * If values have been submitted in the form, process.\n */\n if (((bool)Tools::isSubmit('submitPromoModule')) == true) {\n $this->postProcess();\n }\n\n $promo = $this->getSlides();\n\n $code = $this->getPromo();\n \n $this->context->smarty->assign('promoActuelles',$code);\n\n $variables = $this->getWidgetVariables();\n\n \n $this->context->smarty->assign('id','');\n $this->context->smarty->assign('title','');\n $this->context->smarty->assign('description','');\n $this->context->smarty->assign('legend','');\n $this->context->smarty->assign('url','');\n $this->context->smarty->assign('image','');\n $this->context->smarty->assign('debut','');\n $this->context->smarty->assign('fin','');\n\n $this->context->smarty->assign('eid','');\n $this->context->smarty->assign('etitle','');\n $this->context->smarty->assign('edescription','');\n $this->context->smarty->assign('elegend','');\n $this->context->smarty->assign('eurl','');\n $this->context->smarty->assign('eimage','');\n $this->context->smarty->assign('edebut','');\n $this->context->smarty->assign('efin','');\n\n $this->context->smarty->assign('msg',$variables['msg']);\n $this->context->smarty->assign('variables',$variables);\n $this->context->smarty->assign('slides',$promo);\n $this->context->smarty->assign('module_dir', $this->_path);\n $today = date('Y-m-d');\n $this->context->smarty->assign('date',$today);\n\n $this->context->smarty->assign('jsdata', '<script src=\"../modules/promo/views/js/jquery.dataTables.min.js\" type=\"text/javascript\"></script>');\n $this->context->smarty->assign('jsdata1', '<script src=\"../modules/promo/views/js/datatables.min.js\" type=\"text/javascript\"></script>');\n\n $this->context->smarty->assign('cssdata', '<link rel=\"stylesheet\" type=\"text/css\" href=\"../modules/promo/views/css/jquery.dataTables.css\">');\n $output = $this->context->smarty->fetch($this->local_path.'views/templates/admin/configure.tpl');\n\n\n \n $this->context->controller->addJqueryUI('ui.datepicker');\n \n $this->_html = '';\n $this->_html .= $this->ModuleDatepicker(\"datepicker1\", true);\n \n \n\n return $output.$this->renderForm();\n }",
"function view($params, $request){\n\t\t\t$cod_programa = $request->getParam('cod_programa');\n\t\t\t\n\t\t\t$this->includeModel('TComponente');\n\t\n if($this->AppUser->isStudent()){\n\t\t\t\t$cedula = $this->AppUser->getCedula();\n\t\t\t\t$this->includeModel(\"TPersona\");\n\t\t\t\t$cod_programa = $this->TPersona->cod_programa($cedula);\n\t\t\t\t$this->vista->set('cod_programa', $cod_programa);\n }else{\n $this->vista->set('programa', $this->TPrograma->get($cod_programa));\n }\n\t\t\n\t\t\t$CANT_SEMESTRES = 2; #CANTIDAD DE SEMESTRES\n\t\t\t$this->vista->set('cantidad_semestres', $CANT_SEMESTRES);\n $this->vista->set('is_closed', $this->TPrograma->isClosed($cod_programa));\n\t\t\t$this->vista->display();\n }",
"public function __invoke()\n {\n $teams = Team::get();\n $services = Service::get();\n return view('FrontEnd.about_us',['teams' => $teams, 'services' => $services]);\n }",
"public function getParamsToView();",
"public function componentes($vista_id)\n\t{\n\t\t$model \t\t= \"Vistas_model\";\n\t\t$url_page \t= \"admin/vistas/componentes\";\n\t\t$pag \t\t= $this->MyPagination($model, $url_page, $vista_id);\n\n\t\t$data['menu'] \t\t\t= $this->session->menu;\n\t\t$data['links'] \t\t\t= $pag['links'];\n\t\t$data['filtros'] \t\t= $pag['field'];\n\t\t$data['contador_tabla'] = $pag['contador_tabla'];\n\t\t$data['column'] \t\t= $this->columnC();\n\t\t$data['fields'] \t\t= $this->fieldsC();\n\t\t$data['total_pagina'] \t= $pag['config'][\"per_page\"];\n\t\t$data['x_total']\t\t= $pag['config']['x_total'];\n\t\t$data['total_records'] \t= $pag['total_records'];\n\t\t$data['componentes'] \t= $this->Vistas_model->vistas_componente_by_id($vista_id);\n\t\t$data['acciones'] \t\t= $this->Accion_model->get_vistas_acciones($pag['vista_id'], $pag['id_rol']);\n\t\t$data['home'] \t\t\t= 'admin/vistas/componentes_lista';\n\t\t$data['title'] \t\t\t= \"Vistas\";\n\t\t$data['vista_id'] \t\t= $vista_id;\n\n\t\techo $this->load->view('admin/vistas/componentes_lista',$data, TRUE);\n\t}",
"public function actionView($id, $proveedor_codigo)\n { \n $request = Yii::$app->request;\n\n $modelCompra = $this->findModel($id, $proveedor_codigo); \n $modelsDetalle = $modelCompra->detalleCompras;\n\n if($request->isAjax){\n Yii::$app->response->format = Response::FORMAT_JSON;\n return $this->render('view', [\n \n 'modelCompra' => $modelCompra,\n \n 'modelsDetalle' => (empty($modelsDetalle)) ? [new DetalleCompra] : $modelsDetalle\n \n ]); \n }else{\n return $this->render('view', [\n \n 'modelCompra' => $modelCompra,\n \n 'modelsDetalle' => (empty($modelsDetalle)) ? [new DetalleCompra] : $modelsDetalle\n \n ]); \n }\n }",
"public function render()\n {\n return view('components.testimony-component');\n }",
"public function component($id)\n {\n $parent = Device::find($id);\n $rooms = Room::all();\n $vendors = Vendor::all();\n $departments = Department::all();\n return view('devices.create' , compact( 'rooms','vendors', 'departments', 'parent'));\n }",
"function informacao() {\n $this->layout = '_layout.perfilUsuario';\n $usuario = new Usuario();\n $api = new ApiUsuario();\n $usuario->codgusario = $this->getParametro(0);\n\n $this->dados = array(\n 'dados' => $api->Listar_informacao_cliente($usuario)\n );\n $this->view();\n }",
"public function getViewProcedimientos()\n {\n\n\n return view('main.testProcedimientos');\n\n\n }",
"public function index()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'component', 'read')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\t?>\n\t\t<div class=\"block-content\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->headTitle($GLOBALS['_']['component_name']);?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->formStart(array('method' => 'post', 'action' => 'route.php?mod=component&act=multidelete', 'autocomplete' => 'off'));?>\n\t\t\t\t\t\t<?=$this->pohtml->inputHidden(array('name' => 'totaldata', 'value' => '0', 'options' => 'id=\"totaldata\"'));?>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$columns = array(\n\t\t\t\t\t\t\t\tarray('title' => 'Id', 'options' => 'style=\"width:30px;\"'),\n\t\t\t\t\t\t\t\tarray('title' => $GLOBALS['_']['component_title'], 'options' => ''),\n\t\t\t\t\t\t\t\tarray('title' => $GLOBALS['_']['component_type'], 'options' => 'style=\"width:80px;\"'),\n\t\t\t\t\t\t\t\tarray('title' => $GLOBALS['_']['component_date'], 'options' => 'style=\"width:150px;\"'),\n\t\t\t\t\t\t\t\tarray('title' => $GLOBALS['_']['component_active'], 'options' => 'style=\"width:100px;\"'),\n\t\t\t\t\t\t\t\tarray('title' => $GLOBALS['_']['component_action'], 'options' => 'class=\"no-sort\" style=\"width:50px;\"')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<?=$this->pohtml->createTable(array('id' => 'table-component', 'class' => 'table table-striped table-bordered'), $columns, $tfoot = false);?>\n\t\t\t\t\t<?=$this->pohtml->formEnd();?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?=$this->pohtml->dialogDelete('component');?>\n\t\t<?php\n\t}",
"public function compose(){\n\n $data=About::first();\n return view('backend.about.aboutcreate',compact('data'));\n}",
"public function create()\n {\n return view('productos.create', [\n 'departamentos'=>Departamento::all(),\n 'obj'=>new Producto\n ]);\n }",
"public function render($component);",
"public function renderComponents();",
"function estudiantesMatriculados() {\n $this->view->estadoMatricula = $this->model->estadoMatricula();\n \n $this->view->render('header');\n $this->view->render('matricula/estudiantesMatriculados');\n $this->view->render('footer');\n }",
"public function prepareView($params) {\n \textract($params);\n \t$reduction = new ReductionScheme($db); \t\n \t$reduction->loadFactors($facilityID);\n \t$facility = new Facility($db);\n \t$solvent = new SolventManagement($db,$facilityID);\n \t\n \t$company = new Company($db);\n \t$facilityDetails = $facility->getFacilityDetails($facilityID);\n \t$companyDetails = $company->getCompanyDetails($facilityDetails['company_id']);\n \t$reduction->unittypeID = $companyDetails['voc_unittype_id'];\n \t$unittype = new Unittype($db);\n \t$unittypeDescr = $unittype->getDescriptionByID($reduction->unittypeID);\n \t$result = array( \t\t\n \t\t'reduction' => $reduction->getReductionScheme($facilityID),\n \t\t'mulFactorARE' => $reduction->getAREfactor(),\n \t\t'mulFactorTargetEmission' => $reduction->getTargetEmissionFactor(),\n \t\t'unittype' => $unittypeDescr,\n \t\t'solventPlan' =>$solvent->getAnnualActualSolventEmissionList($facilityID)\n \t);\n \t\n \treturn $result;\n }",
"public function render()\n {\n return view('components.agregar-usuario-modal');\n }",
"public function render()\n {\n return view('components.galeria.carrusel-artistas', [\n 'plana_4' => Carrusel::find(4),\n 'plana_5' => Carrusel::find(5),\n 'plana_6' => Carrusel::find(6),\n ]);\n }",
"public function contuctUs()\n {\n return view('Front.page.contuctus');\n }",
"function render($component)\n {\n extract($component->getVars());\n include($component->getTemplate());\n }",
"private function getDatas(){\r\n //$datas = $reqPDO->getDatas($this->userIdentity);\r\n $datas=\"\";\r\n $vue = new Vue(\"Productdetail\", array('datas' => $datas));\r\n }",
"public function render()\n {\n return view('livewire.detail-satwa')\n ->extends('layouts.guest.master')\n ->section('content');\n }",
"function ParmsView() { \n $render = new AdminModel(); \n echo '<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-1\"></div>\n <div class=\"col-md-4\">\n <h2>Administrators:\n <a href=\"'.DIR.'index.php?page=adminView&action=insertNewAdmin\"><i class=\"fa fa-plus-square\"></a></i>\n </h2><br>';\n \n $displayAdmins = $render->getAdmins();\n foreach ($displayAdmins as $admin) {\n echo '<div class=\"box\"><a href=\"'.DIR.'index.php/?page=adminView&action=adminDetails&id='.$admin['adminId'].'\">' .$admin['adminName'].'</a>, </br>'.\n '<img src=\"'.DIR.'upload/'.$admin['adminImage'].'\"/>'. $admin['adminPhone'] . '</br>'. $admin['adminRole'] . '</br>'. $admin['adminEmail'] .'</div></br>';\n };\n\n\t\techo '</div>\n <div class=\"col-md-5\">';\n }",
"public function actionView()\n {\n $param = BaseRequest::getParamOnUrl('param');\n \n $service = $this->getOneByParam('service',['title' => $param]);\n \n return $this->render('view',['service' => $service]);\n }",
"public function index() {\n $cls_name = 'configuracion';\n // ****** TABLA DE PERSISTENCIA DE DATOS DE LA CLASE \n $table = 'tables';\n // ****** RUTA DE ACCESO DEL CONTROLLER\n $route = 'configuracion/';\n // ****** ******************\n \n\n $user = $this -> session -> userdata('logged_in');\n if (is_array($user)) {\n // ****** NAVBAR DATA ********\n $userActs = $this -> app_model -> get_activities($user['userId']);\n $acts = explode(',',$userActs['acciones_id']);\n // ****** END NAVBAR DATA ********\n \n // ************ VAR INYECTA INIT DATA EN LA INDEX VIEW *********** \n $var=array(\n // PREPARO LOS DATOS DEL VIEW\n 'items'=>$this->cmn_functs->mk_dpdown($table,$this->cmn_functs->get_fields_sin_id($table),' WHERE id < 99 ORDER BY id ASC','selecciona un item'),\n 'attr'=> \"class='form-control' onchange=call({'method':'meet','msg':this.value})\",\n 'title'=>'Modificando datos de:',\n 'route'=>$route\n );\n // // ****** LOAD VIEW ****** \n $this -> load -> view('header-responsive');\n $this -> load -> view('navbar',array('acts'=>$acts,'username'=>$this -> app_model -> get_user_data($user['userId'])['usr_usuario']));\n $this -> load -> view($cls_name.'_view',$var);\n } else {\n redirect('login', 'refresh');\n }\n }",
"public function index()\n {\n $componentes=session('componentes'); \n\n return view('admin.relacionesc.index',compact('componentes'));\n }",
"public function create()\n {\n return view('inmobiliario.empleado.create',\n ['departamento' => departamento::get(['id', 'nombre', 'vigencia'])->where('vigencia',1),\n 'area' => area::get(['id', 'nombre', 'vigencia'])->where('vigencia',1)\n ]);\n\n }",
"function beneficiariesView_views_data()\n{\n $data = array();\n\n $data['aj_registration']['table']['group'] = t('Registration');\n\n $data['aj_registration']['table']['base'] = array(\n 'title' => t('Registration'),\n 'help' => t('This is data from the aj_registration table.'),\n );\n\n $data['aj_registration']['table']['join'] = array(\n 'eck_provider' => array(\n 'left_field' => 'id',\n 'field' => 'provider_id',\n ),\n );\n\n\n// The ID field\n$data['aj_registration']['uuid'] = array(\n\t'group' => t('Registration'),\n 'title' => t('UUID'),\n 'help' => t('The beneficiary UUID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The nombre field\n$data['aj_registration']['nombre'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Nombre'),\n 'help' => t('The beneficiary name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t 'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The apellido field\n$data['aj_registration']['apellido'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apellido'),\n 'help' => t('The beneficiary surname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The apodo field\n$data['aj_registration']['apodo'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Apodo'),\n 'help' => t('The beneficiary nickname.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n// The Estecolateralparticipante field\n$data['aj_registration']['Estecolateralparticipante'] = array(\n\t'group' => t('Registration'),\n 'title' => t('¿Indirecto?'),\n 'help' => t('The beneficiary type.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The DOB field\n$data['aj_registration']['DOB'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Nacimiento'),\n 'help' => t('The beneficiary date of birth.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n// The Fecha field\n$data['aj_registration']['Fecha'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Fecha de Registro'),\n 'help' => t('The Beneficiary date of registration.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_date',\n ),\n);\n\n\n\n// The provider_name field\n$data['aj_registration']['provider_name'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Organización name'),\n 'help' => t('The organización name.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_string',\n ),\n);\n\n\n// The provider_id field\n$data['aj_registration']['provider_id'] = array(\n\t'group' => t('Registration'),\n 'title' => t('Esto es provider_id'),\n 'help' => t('The organización ID.'),\n 'field' => array(\n 'handler' => 'views_handler_field',\n \t'click sortable' => TRUE,\n ),\n 'sort' => array(\n 'handler' => 'views_handler_sort',\n ),\n 'filter' => array(\n 'handler' => 'views_handler_filter_numeric',\n ),\n 'relationship' => array(\n 'base' => 'eck_provider',\n 'base field' => 'id',\n \t 'field' => 'provider_id',\n 'handler' => 'views_handler_relationship',\n 'label' => t('aj_registration retlation'),\n \t 'help' => t('This is the relationship with aj_registration and eck_provider'),\n \t 'title' => t('aj_registration relationship'),\n ),\n 'argument' => array(\n 'handler' => 'views_handler_argument',\n 'numeric' => TRUE,\n ),\n);\n return $data;\n}",
"public function actionView($id)\n {\n $dispositivos = PrefacturaDispositivoFijoElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n //$count_fijo = $dispositivos->count();\n // $pag_fijos = new Pagination([\n // 'defaultPageSize'=>10,\n // 'totalCount' => $dispositivos->count()\n // ]);\n // $disp_fijos = $dispositivos\n // ->offset($pag_fijos->offset)\n // ->limit($pag_fijos->limit)\n // ->all();\n\n $modelo=new PrefacturaDispositivoFijoElectronico();\n $variables=PrefacturaDispositivoVariableElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n $monitoreos=PrefacturaMonitoreo::find()->where('id_prefactura_electronica='.$id)->all();\n\n\n if (isset($_POST['fecha_factura'])) {\n $model =PrefacturaElectronica::find()->where('id='.$id)->one();\n $model->setAttribute('numero_factura', $_POST['num_factura']);\n $model->setAttribute('fecha_factura', $_POST['fecha_factura']);\n\n $model->save();\n\n return $this->redirect(['view', 'id' => $id ]);\n }\n\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dispositivos' => $dispositivos/*$disp_fijos*/,\n 'pag_fijos'=>$pag_fijos,\n 'modelo'=>$modelo,\n 'variables'=>$variables,\n 'monitoreos'=>$monitoreos\n ]);\n }",
"public function render()\r\n {\r\n $nombre_usuario = \"Juan Perez\";\r\n return view('components.sidebar', [\r\n \"usuario\" => $nombre_usuario\r\n ]);\r\n }",
"public function obtenerComunas(){\r\n\r\n $data['comunas'] = $this->EmpresaModel->obtenerComunas();\r\n\r\n $this->load->view(\"User/Empresa_view\", $data);\r\n\r\n //return $data;\r\n }",
"public function create()\n {\n // return View::make('producto.partial.modal-producto');\n\n }",
"Public Function ChamaView(){\n $ufModel = new UfModel();\n $cidadeModel = new CidadeModel();\n $bairroModel = new BairroModel();\n $listaUf = $ufModel->ListarUf(false); \n $listaCidade = $cidadeModel->SelecionaCidades(false, $listaUf[1][0][0]); \n $listaBairro = $bairroModel->SelecionaBairro(false, $listaCidade[1][0][0]); \n $params = array('listaUf' => urlencode(serialize($listaUf)),\n 'listaCidade' => urlencode(serialize($listaCidade)),\n 'listaBairro' => urlencode(serialize($listaBairro))); \n echo ($this->gen_redirect_and_form(BaseController::ReturnView(BaseController::getPath(), get_class($this)), $params));\n }",
"public function index()\n {\n //\n $contenido = \"algun valor\";\n $render = view('test.render');\n return view('test.pruebas')->with(\"variable\",$contenido)\n ->with(\"render\",$render);\n // return view('test.pruebas',[\"variable\"=>$contenido]);\n }",
"function ordmarca() {\n $coche=new coches_model();\n\n //Uso metodo del modelo de coches\n $datos=$coche->ordmarca();\n $titulo = \"Listado de Coches ordenado\";\n\n //Cargar vista\n $this->view(\"coches_listado.phtml\",array(\n \"datos\" => $datos,\n \"Listado de Personas\" => $titulo\n ));\n //require_once(\"views/coches_listado.phtml\"); }\n }",
"public function html(){\n\n $all = [];\n $all['id'] = $this->id;\n $all['item'] = $this;\n $all['fields'] = $this->getFields();\n\n foreach ($this->getParams() as $key => $value) {\n $all['p_' . $key] = $value;\n }\n\n return view('components.' . $this->component->name . '.print' , $all)->render();\n }",
"function view() {\n\t\tif (!is_blank($this->params['cod_curso'])){\n $cod_curso = $this->params['cod_curso'];\n $cod_programa = $this->TSubgrupo->programa($cod_curso);\n $this->vista->set('cod_programa', $cod_programa);\n }\n \n\t\t$this->vista->addJS(\"jquery.dataTable\");\n\t\t\n\t\t$estudiantes = null;\n\t\tif($this->TPrograma->esta_activo($cod_programa))\n {\n\t\t\t$estudiantes = $this->TSubgrupo->inscritosActivos($cod_curso);\n\t\t}\n else\n {\n\t\t\t$estudiantes = $this->TSubgrupo->inscritosEgresados($cod_curso);\n }\n \n\t\t$this->vista->set('nombre_curso', $this->TSubgrupo->nombre($cod_curso));\n\t\t$this->vista->set('estudiantes', $estudiantes);\n\t\t$this->vista->display();\n\t }",
"function index(){\n $alumnos=$this->model->get();\n $this->view->alumnos=$alumnos;\n $this->view->render('alumno/index');\n }",
"public function getComponente()\n {\n $retorno = '<div class=\"input-group\">\n<span class=\"input-group-addon\">' . $this->getLabel() . '</span>\n\n<div class=\"list-group\">\n<select name=\"'. $this->getNome() .'\">\n<option value=\"\">Selecione</option>\n';\n\n if (is_array($this->getArrValores()))\n {\n foreach ($this->getArrValores() as $key => $value) \n {\n $retorno .= '<option value=\"'. $key .'\" '. ( $this->getValor() == $key ? 'selected=\"selected\"' : '' ) .'>';\n $retorno .= $value;\n $retorno .= '</option>';\n }\n }\n\n $retorno .= '</select></div>';\n $retorno .= '</div>';\n\n return $retorno;\n }",
"public function createComponents() //:void\n {\n $viewFiles = glob($this->viewPath . '*.blade.php');\n\n if (is_array($viewFiles) && !empty($viewFiles)) {\n foreach ($viewFiles as $view) {\n $this->components[$this->getKey($view)] = (object) [\n 'key' => $this->getKey($view),\n 'html' => $this->renderView(\n $view,\n ['lang' => (object) $this->lang]\n )\n ];\n }\n }\n }",
"public function index()\n {\n $cantidad = ProcesoEleccion::cantidad();\n return view('proceso')->with(array(\n 'mod' => self::MODEL,\n 'cantidad' => $cantidad,\n 'header' => 'Proceso de Eleccion'\n ));\n }",
"function index()\n {\n $pedido_data = $this->get_pedido_data();\n $date = Carbon::now();\n return view('administrador/dynamic_pdf')->with('pedido_data', $pedido_data)->with('date', $date); //Se envian los datos del informe diario a la vista.\n }",
"public function listoaAction() \n { \n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0); \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n $data = $this->request->getPost();\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new tipdocontrolo($this->dbAdapter); // ---------------------------------------------------------- 5 FUNCION DENTRO DEL MODELO (C) \n $u->actRegistro($data); \n }\n $view = new ViewModel(); \n $this->layout('layout/blancoC'); // Layout del login\n return $view; \n //return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n\n }",
"public function render()\n {\n // dd($this->value);\n return view(load_view('components.forms.render'));\n }",
"public abstract function fillComponent(&$smarty_tpl);",
"public function create()\n {\n $compteurs = Compteur::pluck('numero','id');\n // dd($compteurs);\n return view('abonnement.create',compact('compteurs'));\n }",
"public function index(){\n $pedido =new Pedido();\n\n //Conseguimos todos los usuarios\n $allPedidos=$pedido->getAll();\n\n //Cargamos la vista index y le pasamos valores\n /* $this->view(\"index\",array(\n \"allusers\"=>$allusers,\n \"Hola\" =>\"Soy Víctor Robles\"\n ));*/\n }",
"public function crearEvento()\n {\n $listaSeccion = Seccion::where('activo', 'A')->pluck('nombre', 'id');\n $listaSedes = Sede::where('activo', 'A')->pluck('nombre', 'id');\n //Formulario de Creación\n return view('frontend.eventos.nuevo')\n ->with('lista_secciones', $listaSeccion)\n ->with('lista_sedes', $listaSedes);\n }",
"public function data(){\n $activity = Activity::all();\n \n $data = [\n 'activities'=>$activity,\n \n ];\n \n return view('activities.dataManagement',$data)->with('success_message','item berhasi dirubah');\n }",
"public function render()\n {\n return view('bs-component::form.field-template', ['field' => 'bs-component::form.field.datepicker']);\n }",
"public function addData()\n {\n $data['city'] = $this->admin_m->getCities();\n $data['deptt'] = $this->admin_m->getDeptt();\n $data['pName'] = $this->admin_m->getPapers();\n $data['cat'] = $this->admin_m->getCategories();\n\n $data['content'] = 'admin/admin_v';\n $this->load->view('components/template', $data);\n }",
"public function combos()\n {\n $this->view->ambito = array('F' => 'Federal','E'=> 'Estadual','M'=>'Municipal','J'=>'Judicial');\n $this->view->estado = $this->getService('Estado')->comboEstado();\n $this->view->tipoPessoa = $this->getService('TipoPessoa')->getComboDefault(array());\n $this->view->temaVinculado = array('Cavernas', 'Espécies', 'Empreendimentos', 'Unidades de Conservação');\n $this->view->tipoDocumento = $this->getService('TipoDocumento')->getComboDefault(array());\n $this->view->tipoArtefato = $this->getService('TipoArtefato')->listItems(array());\n $this->view->assunto = $this->getService('Assunto')->comboAssunto(array());\n $this->view->prioridade = $this->getService('Prioridade')->listItems();\n $this->view->tipoPrioridade = $this->getService('TipoPrioridade')->listItems();\n $this->view->municipio = $this->getService('VwEndereco')->comboMunicipio(NULL,TRUE);\n }",
"public function objetivos_estrategicos(){\n $data['menu']=$this->menu(1);\n $data['configuracion']=$this->model_proyecto->configuracion_session();\n $data['resp']=$this->session->userdata('funcionario');\n $data['res_dep']=$this->tp_resp();\n $data['indi']= $this->model_proyecto->indicador(); /// indicador\n $data['obj_estrategicos']=$this->mis_objetivos_estrategicos();\n\n $this->load->view('admin/mestrategico/obj_estrategico/objetivos_estrategicos', $data);\n }",
"static function renderComponents()\n {\n extract(self::$data_component);\n\n ob_start();\n foreach(self::$components as $component) {\n $file_view = \"components/{$component['component']}/views/\".SIDE.\"/{$component['view']}.view.php\";\n if (file_exists($file_view))\n {\n require_once $file_view;\n self::$sections[$component['section']].=ob_get_contents();\n ob_clean();\n } else {\n trigger_error(\"Template {$component['view']} not exist\", E_USER_WARNING);\n }\n }\n self::putData(\"sections\",self::$sections,\"L\");\n }",
"public function lista(){\n $produtos = Produto::all();\n return view('produtos.listagem')->with('produtos', $produtos);\n //teste magic method\n // return view('listagem')->withProdutos(produtos);\n\n //tambem poderia executar o\n //return view('listagem', ['produtos' => $produtos]);\n\n //tbm é possivel verifica se a view existe\n // if (view()->exists('listagem'))\n // {\n // return view('listagem');\n // }\n }",
"abstract protected function renderView();",
"public function buscar()\n\t{\n\t\tif(Auth::guest())\n\t\t\treturn redirect()->route('login');\n\n\t\telse if(in_array(Auth::user()->role, ['administrador','supervisor'])){\n\t\t\t//enviar parametros empleados, turnos y clientes para aplicar como filtros de busqueda (jquery?)\n\t\t\t$empleados = Empleado::where('contratable', true)->get();\n\t\t\t$clientes = Cliente::all();\n\t\t\t$turnos = Turno::all();\n\t\t\t\n\t\t\t\t$parametros = ['empleados' => $empleados, 'clientes' => $clientes, 'turnos' => $turnos]; //parametros para filtrar la busqueda\n\t\t\t\n\n\t\t\treturn view('empleados/buscar_checada')->with('parametros', $parametros);\n\t\t}\n\n\t\telse \n\t\t\treturn view('errors/restringido');\n\t}",
"public function getView() {}",
"public function getView() {}",
"public function index()\n {\n return view('compte.allcompte');\n }",
"public function acerca()\r\n {\r\n \t// La vista se la pasamos como string al método View::render()\r\n \t// Y se va a buscar en la carpeta \"views\".\r\n \t// Nota: No lleva la extensión \".php\".\r\n \tView::render('about');\r\n }",
"function __construct() {\n\n /**\n * Definicion de tipos de campos\n */\n $this->assignType(\"id\", \"id\", BaseView::HIDDEN);\n $this->assignType(\"created_by\", \"created_by\", BaseView::HIDDEN);\n $this->assignType(\"code\", JText::_(\"COM_CTC_CODE\"), BaseView::STRING);\n $this->assignType(\"category_id\", \"Categoría\", BaseView::ENTITY, array(\n BaseView::ENT_CLASS => \"Category\",\n BaseView::ENT_FIELD => \"name\",\n BaseView::ENT_FILTER => null));\n $this->assignType(\"mileston_id_ALIAS\", \"Hito\", BaseView::ENTITY, array(\n BaseView::ENT_CLASS => \"Milestone\",\n BaseView::ENT_FIELD => \"name\",\n BaseView::ENT_FILTER => null));\n $this->assignType(\"mileston_id\", \"mileston_id\", BaseView::HIDDEN);\n $this->assignType(\"name\", JText::_(\"COM_CTC_NAME\"), BaseView::STRING);\n $this->assignType(\"description\", JText::_(\"COM_CTC_DESCRIPTION\"), BaseView::HUGE_STRING);\n $funcRes = function($obj) {\n if (strlen($obj->result) > 0) {\n return str_replace(\"Resultado de la generación del Reporte Exitoso.\", \"\", $obj->result);\n }\n };\n $this->assignType(\"result\", \"Resumen\", BaseView::FUNC, $funcRes);\n //$this->assignType(\"result\", \"Resultado\", BaseView::HUGE_STRING);\n $this->assignType(\"comment\", \"Comentario\", BaseView::BIG_STRING);\n $this->assignType(\"creation_date\", JText::_(\"COM_CTC_CREATION_DATE\"), BaseView::HIDDEN);\n $this->assignType(\"update_date\", \"Modificada\", BaseView::HIDDEN);\n $this->assignType(\"creation_date_ALIAS\", JText::_(\"COM_CTC_CREATION_DATE\"), BaseView::DATE, array(\n \"dateFormat\" => 'yy-mm-dd'\n ));\n $this->assignType(\"update_date_ALIAS\", \"Modificada\", BaseView::DATE, array(\n \"dateFormat\" => 'yy-mm-dd'\n ));\n $this->assignType(\"start_date\", \"Comienzo de tarea\", BaseView::DATE_TIME, array(\n \"dateFormatPHP\" => \"Y-m-d H:i\",\n \"dateFormat\" => 'yy-mm-dd'\n ));\n $this->assignType(\"finish_date\", \"Fin de tarea\", BaseView::DATE_TIME, array(\n \"dateFormatPHP\" => \"Y-m-d H:i\",\n \"dateFormat\" => 'yy-mm-dd'\n ));\n $this->assignType(\"status\", JText::_(\"COM_CTC_STATUS\"), BaseView::PICKLIST, array(\n 1 => \"Creado\",\n 2 => \"En proceso\",\n 3 => \"Terminado\",\n 4 => \"En revisión\"\n ));\n $this->assignType(\"type\", \"type\", BaseView::HIDDEN);\n $this->assignType(\"progress\", \"Progreso (%)\", BaseView::STRING);\n $this->assignType(\"user_id\", \"Asignada a\", BaseView::ENTITY, array(\n BaseView::ENT_CLASS => \"UserJ\",\n BaseView::ENT_FIELD => \"name\",\n BaseView::ENT_FILTER => null));\n\n $this->assignType(\"created_by\", \"created_by\", BaseView::HIDDEN);\n $this->assignType(\"created_by_ALIAS\", \"Creada por\", BaseView::ENTITY, array(\n BaseView::ENT_CLASS => \"UserJ\",\n BaseView::ENT_FIELD => \"name\",\n BaseView::ENT_FILTER => null));\n $this->assignType(\"enterprise_id\", \"enterprise_id\", BaseView::HIDDEN);\n $this->assignType(\"notify_by\", JText::_(\"COM_CTC_MEDIA\"), BaseView::PICKLIST, array(\n Task::NONE => JText::_(\"COM_CTC_NONE\"),\n Task::SMS => \"SMS\",\n Task::EMAIL => \"Mail\",\n Task::TELEGRAM => \"Telegram\",\n Task::ALL => JText::_(\"COM_CTC_ALL_MEDIA\"),\n //\"3\" => \"Ambos\"\n ));\n /*\n $path_to_joomla_soran = $GLOBALS['path_to_joomla_soran'];\n $dir = $path_to_joomla_soran . 'repository' . DIRECTORY_SEPARATOR .\n BaseComp::getLoggedEnterpriseId() . DIRECTORY_SEPARATOR .\n BaseComp::getLoggedUserId() . DIRECTORY_SEPARATOR .\n session_id();\n if (!file_exists($dir)) {\n mkdir($dir, 0777, true);\n }\n $this->assignType(\"files_path\", \"Archivos\", BaseView::FILE_LIST, $dir);\n\n $f = function($row) {\n if (strtotime($row->finish_date) < strtotime($row->update_date)) {\n return \"Tarea vencidas\";\n } else {\n if ($row->status == 3) {\n return \"Tarea terminadas a tiempo\";\n } else {\n return \"Tarea en curso\";\n }\n }\n };\n $this->assignType(\"cur_state\", \"Estado actual\", BaseView::FUNC, $f); */\n\n /**\n * Definicion de vistas y sus acciones\n */\n $this->addView(\"form\", array(\n \"id\",\n \"created_by\",\n \"category_id\",\n \"mileston_id\",\n \"name\",\n \"description\",\n \"creation_date\",\n \"update_date\",\n \"start_date\",\n \"finish_date\",\n \"status\",\n \"type\",\n \"progress\",\n \"created_by\",\n \"user_id\",\n \"enterprise_id\",\n \"result\",\n //\"notify_by\",\n //\"files_path\",\n \"comment\",\n ));\n\n\n $this->addAction(\"form\", \"form_submit\", JText::_(\"COM_CTC_SAVE\"), \"save.png\");\n $this->addAction(\"form\", \"form_cancel\", JText::_(\"COM_CTC_CANCEL\"), \"remove.png\");\n\n $this->addView(\"filterform\", array(\n \"category_id\",\n \"mileston_id_ALIAS\",\n \"code\",\n \"name\",\n \"description\",\n \"creation_date_ALIAS\",\n \"update_date_ALIAS\",\n \"start_date\",\n \"finish_date\",\n \"status\",\n \"progress\",\n \"created_by_ALIAS\",\n \"user_id\"\n ));\n\n $this->addAction(\"filterform\", \"filter\", JText::_(\"COM_CTC_FILTER\"), \"search.png\");\n $this->addAction(\"filterform\", \"clearf\", JText::_(\"COM_CTC_CLEAR\"), \"remove.png\");\n\n $this->addView(\"reptable\", array(\n \"code\",\n \"name\",\n \"cur_state\",\n \"description\",\n \"category_id\",\n \"mileston_id_ALIAS\",\n \"creation_date_ALIAS\",\n \"update_date_ALIAS\",\n \"start_date\",\n \"finish_date\",\n \"status\",\n \"progress\",\n \"created_by_ALIAS\",\n \"user_id\"\n ));\n\n\n\n $this->addView(\"table\", array(\"code\", \"name\", \"start_date\", \"finish_date\", \"progress\", \"status\", \"result\"));\n $this->addAction(\"table\", \"table_edit\", JText::_(\"COM_CTC_EDIT\"), \"edit.png\");\n $this->addAction(\"table\", \"table_remove\", \"Eliminar\", \"delete.png\");\n\n $this->addView(\"dialog\", array());\n $this->addAction(\"dialog\", \"dialog_ok\", JText::_(\"COM_CTC_YES\"), \"accept.png\");\n $this->addAction(\"dialog\", \"dialog_cancel\", JText::_(\"COM_CTC_NOT\"), \"remove.png\");\n\n $this->addView(\"aud\", array(\"id\",\n \"name\",\n \"description\",\n \"creation_date\"));\n }"
] | [
"0.64018166",
"0.6277896",
"0.61775315",
"0.6136609",
"0.61081576",
"0.59985346",
"0.59883815",
"0.5897379",
"0.58642536",
"0.5805795",
"0.57831776",
"0.5771163",
"0.5744384",
"0.57136357",
"0.5704334",
"0.5697538",
"0.5683776",
"0.56585383",
"0.56460506",
"0.56453615",
"0.5643545",
"0.5640493",
"0.56347084",
"0.56214917",
"0.5617303",
"0.5617193",
"0.5600371",
"0.5586899",
"0.55849075",
"0.55670345",
"0.5557335",
"0.5552955",
"0.55527043",
"0.554849",
"0.5547211",
"0.5536012",
"0.55096495",
"0.5507487",
"0.5498572",
"0.5497491",
"0.5495363",
"0.54898655",
"0.5486253",
"0.54773456",
"0.5477006",
"0.5474676",
"0.5472422",
"0.5469337",
"0.5459221",
"0.5458185",
"0.54498184",
"0.5447406",
"0.544554",
"0.5444349",
"0.5441776",
"0.5438781",
"0.5430377",
"0.5423842",
"0.5416133",
"0.5413405",
"0.5411559",
"0.5406143",
"0.54060644",
"0.5405795",
"0.5388622",
"0.53876114",
"0.53856725",
"0.5385667",
"0.53801423",
"0.53777045",
"0.5374412",
"0.5363531",
"0.5362964",
"0.5362423",
"0.53553164",
"0.53551733",
"0.5348613",
"0.5343409",
"0.5341444",
"0.5339234",
"0.5337151",
"0.53341025",
"0.5333274",
"0.53324753",
"0.53255814",
"0.5325541",
"0.53246427",
"0.53245896",
"0.5323069",
"0.5321728",
"0.5320568",
"0.5315174",
"0.53149927",
"0.5306231",
"0.5305069",
"0.530422",
"0.530422",
"0.53034323",
"0.53005356",
"0.5298991"
] | 0.60554636 | 5 |
Passa as configura??es do componente para a view para ser usada pelo helper | public function _config_para_view() {
$this->controller->set('ControleAcessoConfig', $this->config);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getViewComponent();",
"public function actionConfig()\r\n\t{\r\n $this->layout = 'table_scroller';\r\n $model = new UserRrhh;\r\n\r\n $this->render('config',array(\r\n 'model'=>$model\r\n ));\r\n\t}",
"public function configuracion()\n {\n $usuarioDato = new UsuarioDatoEntity();\n $usuarioDato->buscarPorPk($this->_userdata->idUser());\n\n $tarifa = new TarifasModel();\n\n $this->_view->_tarifas = $tarifa->getAll();\n\n $this->_view->_social = $usuarioDato;\n $this->_view->paneltitle = \"Configura tu cuenta\";\n $this->_view->titulo = $this->_view->getConfigure()->title;\n $this->_view->meta_descripcion = \"Sistema Perreras\";\n $this->_view->titulo_page = \"Panel principal\";\n $this->_view->renderizar(\"configuracion\", 'index');\n }",
"public function getViewHelperConfig()\n {\n return array(\n 'factories' => array(\n 'comments' => function ($serviceManager) {\n return new \\Swaggerdile\\View\\Helper\\Comments($serviceManager);\n },\n 'ads' => function ($serviceManager) {\n return new \\Swaggerdile\\View\\Helper\\Ads($serviceManager);\n },\n 'isAdult' => function($serviceManager) {\n return new \\Swaggerdile\\View\\Helper\\IsAdult($serviceManager);\n },\n )\n );\n }",
"public function indexView()\n {\n return view('admin.configuracao');\n }",
"public function setViewComponent( $viewComponent );",
"public function componente()\n {\n $logoEmpresa = DB::table('empresas')\n ->select('logo_empresa', 'nombre_corto')\n ->get();\n return view('/cliente/nuevaCita', ['logoEmpresa' => $logoEmpresa]);\n }",
"function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }",
"public function getViewHelperConfig()\n {\n return array(\n 'invokables' => array(\n 'formBannerGlobals' => 'Grid\\Banner\\Form\\View\\Helper\\FormBannerGlobals',\n 'formBannerLocales' => 'Grid\\Banner\\Form\\View\\Helper\\FormBannerLocales',\n 'formBannerTags' => 'Grid\\Banner\\Form\\View\\Helper\\FormBannerTags',\n ),\n );\n }",
"protected function loadDefaultViewParameters()\n {\n # Load Hook component\n $this->oHook = new Hook();\n $this->aView['aHooks'] = array();\n\n $this->aView['aSession'] = $this->oSession->get();\n // @todo provisoire\n if (isset($this->aView['aSession']['auth'])) {\n $aUserSession = $this->aView['aSession']['auth'];\n $this->aView['sGravatarSrc16'] = Gravatar::getGravatar($aUserSession['mail'], 16);\n $this->aView['sGravatarSrc32'] = Gravatar::getGravatar($aUserSession['mail'], 32);\n $this->aView['sGravatarSrc64'] = Gravatar::getGravatar($aUserSession['mail'], 64);\n $this->aView['sGravatarSrc128'] = Gravatar::getGravatar($aUserSession['mail'], 128);\n }\n\n // Views common couch\n $this->aView[\"appLayout\"] = '../../../app/Views/layout.tpl'; // @todo degager ca ou computer\n $this->aView[\"helpers\"] = '../../../app/Views/helpers/';\n\n // Bootstrap\n $oBundles = new Bundles();\n $this->aView[\"aAppBundles\"] = $oBundles->get();\n $this->aView[\"sAppName\"] = $this->aConfig['app']['name'];\n $this->aView[\"sAppSupportName\"] = $this->aConfig['support']['name'];\n $this->aView[\"sAppSupportMail\"] = $this->aConfig['support']['email'];\n $this->aView[\"sAppIcon\"] = '/lib/bundles/' . $this->sBundleName . '/img/icon.png';\n\n // MVC infos\n $this->aView['sLocale'] = $this->sLang;\n $this->aView['sBundle'] = $this->sBundleName;\n $this->aView[\"sController\"] = $this->sController;\n $this->aView[\"sControllerName\"] = substr($this->sController, 0, strlen($this->sController) - strlen('controller'));\n $this->aView[\"sAction\"] = $this->sAction;\n $this->aView[\"sActionName\"] = substr($this->sAction, 0, strlen($this->sAction) - strlen('action'));\n\n // debug\n $this->aView[\"sEnv\"] = ENV;\n $this->aView[\"sDeBugHelper\"] = '../../../app/Views/helpers/debug.tpl';\n $this->aView[\"bIsXhr\"] = $this->isXHR();\n\n // Benchmark\n $this->aView['framework_started'] = FRAMEWORK_STARTED;\n $this->aView['current_timestamp'] = time();\n }",
"public function render()\n {\n return view('dwbtui::components.html');\n }",
"public function __construct()\r\n {\r\n helper([\"url\"]);\r\n }",
"public function config()\n {\n $data = [\n \"fromname\" => config('mail.from.name'),\n \"from\" => config('mail.from.address'),\n \"host\" => config('mail.host'),\n \"username\" => config('mail.username'),\n \"password\" => config('mail.password'),\n \"corpid\" => config('weixin.corpid'),\n \"corpsecret\" => config('weixin.corpsecret'),\n \"agentid\" => config('weixin.agentid'),\n ];\n return view('admin.config', compact('data'))->with([\n 'title' => \"配置\",\n 'email' => \"active\"\n ]);\n \n }",
"public function render()\n {\n return view('components.producto');\n }",
"function renderConfigForm() {\n\t}",
"public function render()\n {\n return view('components.testimony-component');\n }",
"public function render()\n {\n return view('components.horario-component');\n }",
"public function callViewHelper() {}",
"public function loadConfigurationDispath(MvcEvent $e)\n {\n\n $controller = $e->getTarget();\n $controllerClass = get_class($controller);\n\n $moduleNamespace = substr($controllerClass, 0, strpos($controllerClass, '\\\\'));\n\n //set 'variable' into layout...\n $controller->layout()->modulenamespace = $moduleNamespace;\n // You can setting variable using this too : $e->getViewModel()->setVariable('modulenamespace', $moduleNamespace);\n\n /*\n And in the layout, You can call :\n # Current Module Namespace is <?php echo $this->modulenamespace; ?>\n How about call the variable for view, this is it :\n # Current Module Namespace is <?php echo $this->layout()->modulenamespace; ?>\n */\n }",
"public function render()\n\t{\n\t\t$config = json_decode(file_get_contents(JPATH_CONFIGURATION . '/config.json'));\n\n\t\t// @todo Twig can not foreach() over stdclasses...\n\t\t$cfx = ArrayHelper::fromObject($config);\n\n\t\t$this->renderer->set('config', $cfx);\n\n\t\treturn parent::render();\n\t}",
"public function getViewHelperConfig()\n {\n return [\n 'invokables' => [\n 'applicationCalendar' => 'Application\\View\\Helper\\ApplicationCalendar',\n 'applicationSetting' => 'Application\\View\\Helper\\ApplicationSetting',\n 'applicationRoute' => 'Application\\View\\Helper\\ApplicationRoute',\n 'applicationRandId' => 'Application\\View\\Helper\\ApplicationRandId',\n 'applicationDate' => 'Application\\View\\Helper\\ApplicationDate',\n 'applicationHumanDate' => 'Application\\View\\Helper\\ApplicationHumanDate',\n 'applicationIp' => 'Application\\View\\Helper\\ApplicationIp',\n 'applicationFileSize' => 'Application\\View\\Helper\\ApplicationFileSize'\n ],\n 'factories' => [\n 'applicationBooleanValue' => function() {\n return new \\Application\\View\\Helper\\ApplicationBooleanValue($this->serviceLocator->get('Translator'));\n },\n 'applicationAdminMenu' => function() {\n $adminMenu = $this->serviceLocator\n ->get('Application\\Model\\ModelManager')\n ->getInstance('Application\\Model\\ApplicationAdminMenu');\n\n return new \\Application\\View\\Helper\\ApplicationAdminMenu($adminMenu->getMenu());\n },\n 'applicationFlashMessage' => function() {\n $flashMessenger = $this->serviceLocator\n ->get('ControllerPluginManager')\n ->get('flashMessenger');\n \n $messages = new \\Application\\View\\Helper\\ApplicationFlashMessage();\n $messages->setFlashMessenger($flashMessenger);\n \n return $messages;\n },\n 'applicationConfig' => function() {\n return new \\Application\\View\\Helper\\ApplicationConfig($this->serviceLocator->get('config'));\n },\n ]\n ];\n }",
"protected function configureComponents()\n {\n $this->callAfterResolving(BladeCompiler::class, function () {\n Blade::component('sunfire-base-input-container', 'sunfire-base-input-container');\n });\n }",
"function configure() {\n // * You can add a layout, a layout is just a .phtml file that represents\n // the site template.\n Yasc_App::config()->setLayoutScript(dirname(__FILE__) . \"/layouts/default.phtml\");\n \n // * If you want to use a stream wrapper to convert markup of mostly-PHP \n // templates into PHP prior to include(), seems like is a little bit slow,\n // so by default is off.\n // ->setViewStream(true);\n // \n // * You can add more than one folder to store views, each view script\n // is a .phtml file.\n // ->addViewsPath(dirname(__FILE__) . \"/extra_views\");\n // \n // * You can add more than one path of view helpers and set a\n // class prefix for the path added.\n // ->addViewHelpersPath(dirname(__FILE__) . \"/../library/My/View/Helper\", \"My_View_Helper\");\n // \n // or if you don't want a class prefix just leave it blank.\n // ->addViewHelpersPath(dirname(__FILE__) . \"/extra_views/helpers\");\n //\n // * Function helpers, second argument is a prefix class.\n // ->addFunctionHelpersPath(dirname(__FILE__) . \"/extra_function_helpers\");\n // \n // * Add models folder, second argument is a prefix class.\n // ->addModelsPath(dirname(__FILE__) . \"/models\");\n // ->addModelsPath(dirname(__FILE__) . \"/extra_models/My/Model\", \"My_Model\");\n // \n // * Add extra options to the configuration object, like some $mysql connection \n // resource or a global flag, etc.\n // ->addOption(\"db\", $mysql);\n}",
"function render($component)\n {\n extract($component->getVars());\n include($component->getTemplate());\n }",
"public function render()\n {\n return view('adminhub::livewire.components.settings.attributes.show')\n ->layout('adminhub::layouts.base');\n }",
"public function acerca()\r\n {\r\n \t// La vista se la pasamos como string al método View::render()\r\n \t// Y se va a buscar en la carpeta \"views\".\r\n \t// Nota: No lleva la extensión \".php\".\r\n \tView::render('about');\r\n }",
"public function render()\n {\n return view('components.acrostico');\n }",
"public function __construct()\r\n {\r\n $this->model = new LoginModel();\r\n $this->empmodel = new EmployeeModel();\r\n helper(['form', 'url']);\r\n // $this->view = \\Config\\Services::renderer();\r\n }",
"public function index()\n {\n \n\n \n\n return view('director.config-horario.index',['niveles'=>$this->niveles,'dias'=>$this->dias]);\n\n \n\n }",
"public function configAction(): Response\n {\n $user = $this->tokenStorage->getToken()->getUser();\n $contact = $this->contactManager->getById($user->getContact()->getId(), $user->getLocale());\n\n $resourceMetadataEndpoints = [];\n foreach ($this->resourceMetadataPool->getAllResourceMetadata($user->getLocale()) as $resourceMetadata) {\n if ($resourceMetadata instanceof EndpointInterface) {\n $resourceMetadataEndpoints[$resourceMetadata->getKey()] = $this->router->generate($resourceMetadata->getEndpoint());\n }\n }\n\n $view = View::create([\n 'sulu_admin' => [\n 'fieldTypeOptions' => $this->fieldTypeOptionRegistry->toArray(),\n 'routes' => $this->routeRegistry->getRoutes(),\n 'navigation' => $this->navigationRegistry->getNavigation()->getChildrenAsArray(),\n 'resourceMetadataEndpoints' => $resourceMetadataEndpoints,\n 'smartContent' => array_map(function(DataProviderInterface $dataProvider) {\n return $dataProvider->getConfiguration();\n }, $this->dataProviderPool->getAll()),\n 'user' => $user,\n 'contact' => $contact,\n ],\n ]);\n\n $context = new Context();\n $context->setGroups(['frontend', 'partialContact', 'fullRoute']);\n\n $view->setContext($context);\n $view->setFormat('json');\n\n return $this->viewHandler->handle($view);\n }",
"public function Parametros_Equipos_C(){\n\t\treturn view('Administrador/Formularios.Create_Parametros');\n\t}",
"static function includeView($component, $view_name)\n {\n $arg_list = func_get_args();\n list ($component, $view_name) = $arg_list;\n\n if (!empty($arg_list[2])) {\n foreach ($arg_list[2] as $key => $item) {\n if(is_int($key)) {\n if (isset(self::$data_component[$item])) {\n $$item = self::$data_component[$item];\n } else {\n trigger_error(\"Veraible '{$item}' not exists\", E_USER_WARNING);\n }\n } else {\n if (isset(self::$data_component[$key])) {\n trigger_error(\"Veraible '{$key}' allready exists\", E_USER_WARNING);\n } else {\n $$key = $item;\n }\n }\n }\n }\n\n if ($component == \"\") {\n include \"views/{$view_name}.php\";\n } else {\n include \"components/{$component}/views/{$view_name}.php\";\n }\n }",
"public function index() {\n $cls_name = 'configuracion';\n // ****** TABLA DE PERSISTENCIA DE DATOS DE LA CLASE \n $table = 'tables';\n // ****** RUTA DE ACCESO DEL CONTROLLER\n $route = 'configuracion/';\n // ****** ******************\n \n\n $user = $this -> session -> userdata('logged_in');\n if (is_array($user)) {\n // ****** NAVBAR DATA ********\n $userActs = $this -> app_model -> get_activities($user['userId']);\n $acts = explode(',',$userActs['acciones_id']);\n // ****** END NAVBAR DATA ********\n \n // ************ VAR INYECTA INIT DATA EN LA INDEX VIEW *********** \n $var=array(\n // PREPARO LOS DATOS DEL VIEW\n 'items'=>$this->cmn_functs->mk_dpdown($table,$this->cmn_functs->get_fields_sin_id($table),' WHERE id < 99 ORDER BY id ASC','selecciona un item'),\n 'attr'=> \"class='form-control' onchange=call({'method':'meet','msg':this.value})\",\n 'title'=>'Modificando datos de:',\n 'route'=>$route\n );\n // // ****** LOAD VIEW ****** \n $this -> load -> view('header-responsive');\n $this -> load -> view('navbar',array('acts'=>$acts,'username'=>$this -> app_model -> get_user_data($user['userId'])['usr_usuario']));\n $this -> load -> view($cls_name.'_view',$var);\n } else {\n redirect('login', 'refresh');\n }\n }",
"function default_view_context() {\n return array(\n 'metaTitle' => 'Suicide MVC', // Set in \"<head><meta>\"\n 'metaAuthor' => '', // Displayed in \"#container > #footer\" && set in \"<head><meta>\"\n 'heading' => 'Suicide MVC', // Displayed in \"#container > #header > h1\"\n\n 'styleSheets' => 'CakePHP/cake.generic.css', // ';' delimited list of paths from the $viewStyleDirectory\n 'jscripts' => '', // ';' delimited list of paths from the $viewJavascriptDirectory\n // 'sections' => 'data_list.php' // (useful to implement?)\n\n 'data' => NULL // used by model, never need to modify\n );\n}",
"function initPage(){\n if (($c = $_GET[\"configure\"]) && $this->showConfigure()){\n $this->stop_render = true;\n $this->api->stickyGET(\"configure\");\n if ($c == \"page\"){\n $f = $this->add(\"MVCForm\");\n $f->add(\"Hint\")->set(\"Leave blank unless you know what you do\");\n $this->m->getField('name')->system(true);\n $f->setModel($this->m);\n $f->addSubmit(\"Save\");\n if ($f->isSubmitted()){\n $f->update();\n $this->reload();\n }\n } else if ($cid = $_GET[\"component_id\"]){\n /* here? */\n\n $this->api->stickyGET(\"component_id\");\n $m = $this->add(\"cms/Model_Cms_Component\")->loadData($_GET[\"component_id\"]);\n $m2 = $this->add($m->getRef(\"cms_componenttype_id\")->get(\"class\"));\n $m2->useComponent($m);\n $f = $m2->showConfigureForm($this);\n $b = $this->add(\"Button\", \"close\".$cid)->set(\"Close\");\n $b->js(\"click\", $f->js()->univ()->closeDialog());\n \n } else {\n /* configuring tag */\n $m = $this->add(\"cms/Model_Cms_Pagecomponent\");\n $m->addCondition(\"cms_page_id\", $this->m->get(\"id\"));\n $m->addCondition(\"template_spot\", $c);\n $g = $this->add(\"MVCGrid\");\n /* ordering should be done here */\n $g->setModel($m, array(\"id\", \"cms_component\"));\n $g->add('cms/Controller_GridOrder');\n $g->addColumn(\"button\", \"setup\");\n $g->addColumn(\"delete\", \"delete\");\n if ($page_component_id = $_GET[$g->name . \"_setup\"]){\n $m = $this->add(\"cms/Model_Cms_Pagecomponent\");\n $m->load($page_component_id);\n if ($m->loaded()){\n $component_id = $m->get(\"cms_component_id\");\n\n $g->js()->univ()->frameURL(\"Configure\", $this->api->url($this->getCmsAdminPage()\n , array(\"component_id\" => $component_id)))->execute();\n } else {\n $g->js()->univ()->alert(\"error - could not load $page_component_id?\")->execute();\n }\n }\n $this->add(\"Text\")->set(\"Create new component\");\n $f =$this->add(\"MVCForm\");\n $f->setModel($mc=$this->add(\"cms/Model_Cms_Component\"), array(\"name\", \"cms_componenttype_id\"));\n $f->addSubmit(\"Create\");\n if ($f->isSubmitted()){\n $f->update();\n $mc->update(array(\"is_enabled\" => true));\n $m->update(array(\"cms_component_id\" => $mc->get(\"id\")));\n $f->js(null, $g->js(null, $f->js()->reload())->reload()->execute())->univ()->successMessage(\"Component has been created\");\n }\n $this->add(\"Text\")->set(\"Attach existing component\");\n $f =$this->add(\"Form\");\n $f->addField(\"Dropdown\", \"component\")->setModel(\"cms/Cms_Component\");\n $f->addSubmit(\"Attach\");\n if ($f->isSubmitted()){\n $m->update(array(\"cms_component_id\" => $f->get(\"component\")));\n $f->js(null, $g->js(null, $f->js()->reload())->reload()->execute())->univ()->successMessage(\"Component has been attached\");\n }\n\n \n $this->add(\"Button\", \"close\")->set(\"Close\")->js(\"click\")->univ()->location($this->stripUrl($this->cms_page));\n }\n } else {\n \n if ($this->showConfigure('dev')){\n $this->conf->add(\"Button\")->set(\"Page settings\")->js(\"click\")\n ->univ()->frameURL(\"Page settings\", $this->api->url($this->getCmsAdminPage()\n , array(\"configure\" => \"page\")));\n }\n /* add configure buttons for each \"tag\" */\n $tags = array_keys($this->template->tags);\n $api_tags = array_keys($this->api->template->tags);\n foreach ($api_tags as $tag){\n if (in_array($tag, $this->allowed_tags)){\n if (!in_array($tag, $tags)){\n $tags[] = $tag;\n }\n }\n }\n $mc = $this->add(\"cms/Model_Cms_Component\");\n foreach ($tags as $tag){\n if (in_array($tag, $this->protected_tags)){\n continue;\n }\n if (preg_match(\"/^_.*/\", $tag)){\n continue;\n }\n if (!preg_match(\"/#[0-9]+$/\", $tag) && !in_array($tag, array(\"_page\", \"_name\"))){\n if ($this->showConfigure('dev')){\n $this->conf->add(\"Button\")->set(\"Spot: $tag\")->js(\"click\")\n ->univ()->frameURL(\"Mangage content of tag $tag\",\n $this->api->url($this->getCmsAdminPage()\n , array(\"configure\" => $tag)));\n }\n $m = $this->add(\"cms/Model_Cms_Pagecomponent\")->addCondition(\"cms_page_id\", $this->m->get(\"id\"));\n $elems = $m->addCondition(\"template_spot\", $tag)->setOrder(\"ord\")->getRows();\n if (($tag != \"Content\") && in_array($tag, $api_tags)){\n $dest = $this->api;\n } else {\n $dest = $this;\n }\n if ($elems){\n foreach ($elems as $e){\n $component = $m->loadData($e[\"id\"])->getRef(\"cms_component_id\");\n $driver = $component->getRef(\"cms_componenttype_id\");\n $obj=null;\n\n if ($this->showConfigure()){\n $button = $dest->add(\"Button\", null, $tag);\n //if($obj)$button->js('mouseover',$obj->js()->fadeOut()->fadeIn());\n $this->api->stickyGET(\"cms_page\");\n $button->set(\"Edit '\" . $component->get(\"name\").\"'\")->js(\"click\")\n ->univ()->frameURL(\"Configure \" . $component->get(\"name\"),\n $this->api->url($this->getCmsAdminPage()\n , array(\"configure\" => \"component\", \"component_id\" => $component->get(\"id\"))));\n }\n\n if ($component->get(\"is_enabled\")){\n $element = $this->add($driver->get(\"class\"), null, $tag);\n $element->useComponent($component);\n try {\n $obj = $element->configure($dest, $tag);\n } catch (Exception $e){\n //$this->api->caughtException($e);\n if($this->api->logger->log_output){\n // a bit of hacing\n $this->api->logger->logCaughtException($e);\n }\n $dest->add('View_Error')->set('Problem with this widget: '.$e->getMessage());\n }\n }\n }\n }\n /*\n $dest->add('Button',null,$tag)->set('Add Text')\n ->js('click');\n */\n }\n }\n if ($this->showConfigure()){\n if ($this->warning){\n $this->add(\"Text\")->set(\"<div style=\\\"color:red; background: yellow\\\"><b>Warning:</b><br />\" . implode(\"<br />\", $this->warning) . \"</div>\");\n }\n }\n }\n }",
"public function createLocatorio(){\n\n //cuando tiene más de un local preguntar antes de iniciar sesión\n //cual nombre comercial para setearla\n\n\n\n\n return view('panel.register.encargadoRegister')->with([\n 'companies' => Company::all(),\n ]);\n\n\n }",
"public function index()\n {\n \t$this->setTitle($this->app['config']['title']);\n\n $this->useComponent('Header');\n $this->useComponent('Top');\n $this->useComponent('Sidebar');\n $this->useComponent('Footer');\n\n }",
"public function render() {\n\t\tif ( false === (bool) $this->data( 'customize' ) ) {\n\t\t\t$type = $this->setting( 'type' );\n\t\t\t$defaults = (array) $this->get_option( 'newsroom-settings', 'component_defaults', \"{$type}_call_to_action\", 'data' );\n\t\t\t$this->set_data( $defaults );\n\t\t}\n\n\t\tif ( 'sticky' === $this->setting( 'layout' ) ) {\n\t\t\t\\ai_get_template_part(\n\t\t\t\t$this->get_component_path( 'sticky' ),\n\t\t\t\t[\n\t\t\t\t\t'component' => $this,\n\t\t\t\t\t'stylesheet' => 'sticky-cta',\n\t\t\t\t]\n\t\t\t);\n\t\t} else {\n\t\t\t\\ai_get_template_part(\n\t\t\t\t$this->get_component_path( $this->setting( 'type' ) ),\n\t\t\t\t[\n\t\t\t\t\t'component' => $this,\n\t\t\t\t\t'stylesheet' => $this->slug,\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}",
"public function render($component);",
"public function createComponents() //:void\n {\n $viewFiles = glob($this->viewPath . '*.blade.php');\n\n if (is_array($viewFiles) && !empty($viewFiles)) {\n foreach ($viewFiles as $view) {\n $this->components[$this->getKey($view)] = (object) [\n 'key' => $this->getKey($view),\n 'html' => $this->renderView(\n $view,\n ['lang' => (object) $this->lang]\n )\n ];\n }\n }\n }",
"public function render()\n {\n return view('components.test');\n }",
"public function MenuConfig(){\n\t\t\tparent::view('Home/Menu4');\n\t\t}",
"function coalchallan(){\n \t\n \n\t$this->view->render(\"challan/coalchallan\");\n\t\n}",
"public static function connect(){\n $pagetitle = 'Entrez vos informations';\n $controller = 'benevole';\n $view = 'connect';\n require_once (File::build_path(array('view','view.php'))); \n }",
"public function __construct(View $view, array $config = [])\n {\n parent::__construct($view, $config + [\n 'templates' => [\n 'nextActive' => '<li class=\"page-item\"><a class=\"page-link\" rel=\"next\" href=\"{{url}}\">' . __('次へ >>') . '</a></li>',\n 'nextDisabled' => '<li class=\"page-item disabled\"><span class=\"page-link\">' . __('次へ >>') . '</span></li>',\n 'prevActive' => '<li class=\"page-item\"><a class=\"page-link\" rel=\"prev\" href=\"{{url}}\">' . __('<< 前へ') . '</a></li>',\n 'prevDisabled' => '<li class=\"page-item disabled\"><span class=\"page-link\">' . __('<< 前へ') . '</span></li>',\n 'counterPages' => '<li class=\"page-item disabled\"><span class=\"page-link\">' . __('検索結果: {{count}}件') . '</span></li>',\n 'first' => '<li class=\"page-item\"><a class=\"page-link\" href=\"{{url}}\">' . ('<<') . '</a></li>',\n 'last' => '<li class=\"page-item\"><a class=\"page-link\" href=\"{{url}}\">' . ('>>') . '</a></li>',\n 'number' => '<li class=\"page-item\"><a class=\"page-link\" href=\"{{url}}\">{{text}}</a></li>',\n 'current' => '<li class=\"page-item active\"><a class=\"page-link\" href=\"\">{{text}}</a></li>',\n 'checkboxAll' => '<div class=\"custom-control custom-checkbox\"><input type=\"checkbox\" id=\"checkAll{{table}}\" class=\"custom-control-input\"><label class=\"custom-control-label\" for=\"checkAll{{table}}\"></label></div>',\n 'checkbox' => '<div class=\"custom-control custom-checkbox\"><input type=\"checkbox\" id=\"checkRow{{table}}{{id}}\" name=\"checkRow{{table}}{{id}}\" value=\"{{id}}\" data-lock=\"{{lock}}\" class=\"custom-control-input checkRow{{table}}\"><label class=\"custom-control-label\" for=\"checkRow{{table}}{{id}}\"></label></div>',\n 'radio' => '<div class=\"custom-control custom-radio\"><input type=\"radio\" id=\"checkRow{{table}}{{id}}\" name=\"checkRow{{table}}{{id}}\" value=\"{{id}}\" data-lock=\"{{lock}}\" class=\"custom-control-input checkRow{{table}}\"><label class=\"custom-control-label\" for=\"checkRow{{table}}{{id}}\"></label></div>',\n ],\n ]);\n }",
"public function getView() {}",
"public function getView() {}",
"public function index()\n {\n $componentes=session('componentes'); \n\n return view('admin.relacionesc.index',compact('componentes'));\n }",
"public function config()\n {\n\n return view('account.config');\n }",
"function index() {\n\t\tif (!empty($this->params['named']['layout']) && $this->params['named']['layout'] == \"lov\") {\n\t\t\tif ($this->params['named']['retornarA'] == \"EmpleadorActividadId\") {\n\t\t\t\t$this->data['Condicion']['Actividad-tipo'] = \"Empleador\";\n\t\t\t}\n\t\t\telseif ($this->params['named']['retornarA'] == \"RelacionActividadId\") {\n\t\t\t\t$this->data['Condicion']['Actividad-tipo'] = \"Trabajador\";\n\t\t\t}\n\t\t}\n\t\tparent::index();\n\t}",
"public function listaViajesAltaAgendaViajes(){\n $this->view->listaViajesAltaAgendaViajes();\n}",
"public function render()\r\n {\r\n $nombre_usuario = \"Juan Perez\";\r\n return view('components.sidebar', [\r\n \"usuario\" => $nombre_usuario\r\n ]);\r\n }",
"private function viewCommon() {\n $m = $this->getViewModel();\n //$view->assets(['bootstrap','DateTime','SummerNote','links-edit']);\n\n $m->post = '/admin/link/post';\n $m->url = $this->url;\n $m->display = self::display();\n $m->urltypes = self::getUrlTypes();\n $id = $m->link->id ?? 'new';\n $m->title = 'Link#' . $id;\n return $this->render('links', 'edit');\n }",
"public static function component($location)\n {\n require_once(getcwd() . '/views/' . $location);\n }",
"protected function _content_template() {\n ?>\n\n\n\n <section id=\"intro\">\n\n <div class=\"intro-content\">\n <h2>{{{settings.title}}}</h2>\n <div>\n <a href=\"#about\" class=\"btn-get-started scrollto\">\n {{{settings.button1_text}}}\n </a>\n <a href=\"#portfolio\" class=\"btn-projects scrollto\">\n {{{settings.button2_text}}}\n </a>\n </div>\n </div>\n\n <div id=\"intro-carousel\" class=\"owl-carousel\" >\n\n <# _.each( settings.gallery, function( image ) { #>\n\n <div class=\"item\" style=\"background-image: url('{{ image.url }}');\"></div>\n <# }); #>\n\n </div>\n\n </section><!-- #intro -->\n \n <?php\n }",
"public function config($templatify = false)\n {\n $config = parent::config($templatify);\n\n $config['options']['class'] = $config['options']['class'] . ' model-report-item-panel';\n\n // ----------------------------------------------------------------------\n // PANEL\n // ----------------------------------------------------------------------\n $panelId = strtolower(htmlentities(\\Yii::$app->t::getModelClassName($config['model']) . $config['reportItemName'] . '-' . $config['id']));\n $config['panelId'] = $panelId;\n $this->outputJsData([\n 'panelId' => $panelId,\n 'reportItem' => ArrayHelper::getValue($config, 'reportItem.widgetConfig', []),\n 'modelName' => $config['modelName'],\n 'title' => ArrayHelper::getValue($config, 'reportItem.title', null),\n 'reportItemName' => $config['reportItemName'],\n 'apiEndpoint' => \\Yii::$app->reportsManager->apiEndpoint,\n ]);\n return $config;\n }",
"public function configClasificadoresEgreso()\n {\n return view('submodulos.planeacion.configuraciones.clasificadores_egreso');\n }",
"public function getParamsToView();",
"public function getView()\n {\n }",
"public function __invoke()\n {\n $teams = Team::get();\n $services = Service::get();\n return view('FrontEnd.about_us',['teams' => $teams, 'services' => $services]);\n }",
"public function compose()\n {\n view()->composer('intern.ikm.statistik.index', function ($view){\n\n $view->with('id', static::$data->id); \n\n $view->with('questions', Question::all());\n\n $view->with('ikm', Jadwal::select('id', 'keterangan')->get());\n\n $view->with('ikm_ket', Jadwal::select('keterangan')->whereId(static::$data->id)->first()); \n \n }); \n }",
"function render(){\r\n $productos2 = $this->model->get();\r\n $this->view->productos = $productos;\r\n $this->view->render('burger/index');\r\n }",
"public function frontend_configuration()\n {\n if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') != 'Admin') {\n redirect('home/login_page', 'location');\n }\n \n $data['body'] = \"admin/config/frontend_config\";\n $data['time_zone'] = $this->_time_zone_list(); \n $data['language_info'] = $this->_language_list();\n $data['page_title'] = $this->lang->line('front-end settings');\n $this->_viewcontroller($data);\n }",
"public function getViewProcedimientos()\n {\n\n\n return view('main.testProcedimientos');\n\n\n }",
"public function hookConfigForm($args)\n {\n $view = get_view();\n echo $view->partial('plugins/clean-url-config-form.php');\n }",
"public function config() {\n return view('user.config');\n }",
"public function index()\n\t{\n\t\tvalidar_session_admin($this);\n\t\t$this->load->model('admin/Config_model');\n\t\t$this->load->helper('template_admin_helper');\n\t\t$rows = $this->Config_model->get_data();\n\t\t$nombre_empresa = $rows->nombre_empresa;\n\t\t$direccion_empresa = $rows->direccion_empresa;\n\t\t$telefono_empresa = $rows->telefono_empresa;\n\t\t$correo_empresa = $rows->correo_empresa;\n\t\t$web_empresa = $rows->web_empresa;\n\t\t$logo_empresa = $rows->logo_empresa;\n\t\t$data = array(\n\t\t\t'titulo' => \"Configuración General\",\n\t\t\t'urljs' => 'funciones_general.js',\n\t\t\t'nombre_empresa' => $nombre_empresa,\n\t\t\t'direccion_empresa' => $direccion_empresa,\n\t\t\t'telefono_empresa' => $telefono_empresa,\n\t\t\t'correo_empresa' => $correo_empresa,\n\t\t\t'web_empresa' => $web_empresa,\n\t\t\t'logo_empresa' => $logo_empresa,\n\t\t);\n\t\t$extras = array(\n\t\t\t'css' => array(\n\t\t\t\t0 => 'admin/libs/dropify/dropify.min.css'\n\t\t\t),\n\t\t\t'js' => array(\n\t\t\t\t0 => 'admin/libs/dropify/dropify.min.js'\n\t\t\t),\n\t\t);\n\t\tlayout(\"admin/config/config\",$data,$extras);\n\t\t//layout('admin/config/config',$data);\n\t}",
"function createWidgetConfig() {\n // Add the emotion Komponent\n $component = $this->createEmotionComponent(\n array(\n 'name' => 'Social Media Widget',\n 'template' => 'emotion_socialmedia',\n 'description' => 'Bindet Socialmedia Buttons als Widget in den Einkaufswelten ein. Die URLs werden in der Pluginkonfiguration hinterlegt (Pluginmanager)'\n )\n );\n $component->createCheckboxField(\n array(\n 'name' => 'additional_styles',\n 'fieldLabel' => 'Border Box',\n 'supportText' => 'Zusätzliche Styles hinzufügen?',\n 'helpTitle' => 'Border Box',\n 'helpText' => 'Hier können sie dem widget einen optischen Rand verpassen um es optisch an das SW5 Responsive Theme anzupassen',\n 'defaultValue' => true\n ) \n );\n $component->createCheckboxField(\n array(\n 'name' => 'icons_round',\n 'fieldLabel' => 'Runde Icons',\n 'supportText' => 'Icons rund oder Eckig?',\n 'helpTitle' => 'Runde Icons',\n 'helpText' => 'Hier legen sie die Form der Socialmedia Icons fest: Rund oder Eckig',\n 'defaultValue' => true\n ) \n );\n // Facebook\n $component->createCheckboxField(\n array(\n 'name' => 'facebook_active',\n 'fieldLabel' => 'Facebook',\n 'supportText' => 'Facebook Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Google Plus\n $component->createCheckboxField(\n array(\n 'name' => 'google_active',\n 'fieldLabel' => 'GooglePlus',\n 'supportText' => 'GooglePlus Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Twitter\n $component->createCheckboxField(\n array(\n 'name' => 'twitter_active',\n 'fieldLabel' => 'Twitter',\n 'supportText' => 'Twitter Button anzeigen',\n 'defaultValue' => false\n )\n );\n\n // Youtube\n $component->createCheckboxField(\n array(\n 'name' => 'youtube_active',\n 'fieldLabel' => 'YouTube',\n 'supportText' => 'YouTube Button anzeigen',\n 'defaultValue' => false\n )\n );\n }",
"public function __invoke()\n {\n $items = [\n 'admin.users.index' => 'Управление пользователями',\n 'admin.announces.index' => 'Управление объявлениями',\n 'admin.pages.index' => 'Управление страницами',\n ];\n return view('admin.index', ['items'=>$items]);\n }",
"function displayYourself(){\n\t // collect relevant file-contents of this component\n $php = file_get_contents(__FILE__);\n $js = file_get_contents(path . '/src/neoan/neoan.ctrl.js');\n $html = file_get_contents(path . '/src/neoan/neoan.view.html');\n // return array (api-calls are always converted to json)\n return ['php'=>$php,'js'=>$js,'html'=>$html];\n }",
"function configurar() {\n //SOLO EL ADMINISTRADOR PUEDE MATRICULAR\n if(!$this->AppUser->isRoot())\n return $this->vista->acceso_restringido();\n\n $this->includeModel('TComponente');\n\n //TODO: actualizar el codigo del programa a matricular.\n $cod_programa = $this->params['cod_programa'];\n $this->vista->addJS('jquery.dataTable');\n\n $tiene_cursos = $this->TPrograma->tieneCursos($cod_programa);\n \n $this->vista->set('tiene_cursos', $tiene_cursos);\n if(!$tiene_cursos){\n if($this->TPersona == null)\n $this->TPersona = new TPersona();\n $tiene_participantes = $this->TPersona->hayAdmitidos();\n $this->vista->set('tiene_participantes', $tiene_participantes);\n }\n \n $this->vista->display();\n }",
"public function configuracionPorcentajes(Request $request){\n $porcentajes = \\calidad\\configPorcentaje::All();\n $categoria = \\calidad\\categoria::All();\n return view('viewAdministrador/configuracionPorcentajes',compact('porcentajes','categoria')); \n }",
"static function renderComponents()\n {\n extract(self::$data_component);\n\n ob_start();\n foreach(self::$components as $component) {\n $file_view = \"components/{$component['component']}/views/\".SIDE.\"/{$component['view']}.view.php\";\n if (file_exists($file_view))\n {\n require_once $file_view;\n self::$sections[$component['section']].=ob_get_contents();\n ob_clean();\n } else {\n trigger_error(\"Template {$component['view']} not exist\", E_USER_WARNING);\n }\n }\n self::putData(\"sections\",self::$sections,\"L\");\n }",
"public function renderComponents();",
"public function connexion() {\n\t\t$vue = new View(\"Connexion\");\n\t\t$vue->generer();\n\t}",
"public function index()\n {\n /** */\n $configs = Config::all();\n $admobenable= Config::where('title','admobenable')->get()->first()->value;\n $admobappid= Config::where('title','admobappid')->get()->first()->value;\n $admobbanner= Config::where('title','admobbanner')->get()->first()->value;\n $admobinter= Config::where('title','admobinter')->get()->first()->value;\n $fanenable= Config::where('title','fanenable')->get()->first()->value;\n $fanappid= Config::where('title','fanappid')->get()->first()->value;\n $fanbanner= Config::where('title','fanbanner')->get()->first()->value;\n $faninter= Config::where('title','faninter')->get()->first()->value;\n\n return view('config.index')->with(compact(['admobenable','admobappid','admobbanner','admobinter','fanenable','fanappid','fanbanner','faninter']));\n }",
"public function view(){\r\n\r\n\t$this->registry->template->blog_heading = 'This is the blog heading';\r\n\t$this->registry->template->blog_content = 'This is the blog content';\r\n\t$this->registry->template->show('blog_view');\r\n}",
"public function index()\n {\n //\n $contenido = \"algun valor\";\n $render = view('test.render');\n return view('test.pruebas')->with(\"variable\",$contenido)\n ->with(\"render\",$render);\n // return view('test.pruebas',[\"variable\"=>$contenido]);\n }",
"public function getView(){ }",
"function index() {\n\n $this->view->render();\n\n }",
"public function get_component() {\n return \"dataformview_$this->type\";\n }",
"abstract protected function getView();",
"protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }",
"private function _config()\n\t{\n\t\t// Get the base path for the smarty base directory\n\t\t$basePath\t= $this->getBasePath();\n\t\t$configFile\t= $this->getConfigFile();\n\t\t\n\t\tif (null === $basePath){\n\t\t\tthrow new Exception('No view base path specified');\n\t\t}\n\t\t\n\t\tif (null === $configFile){\n\t\t\tthrow new Exception('No config file specified');\n\t\t}\n\t\t\n\t\t// Generate the path to the view xml config file\n\t\tif ( file_exists(Package::buildPath( $basePath , $configFile)) ) {\n\t\t\t$viewBuildFile = Package::buildPath( $basePath , $configFile);\n\t\t} else {\n\t\t\tthrow new Exception(\"Unable to find config file: \" . $configFile);\n\t\t}\n\t\t \n\t\t// Load the config file\n\t\tif (! $viewXml = Zend_Registry::get('site_config_cache')->load('view_config') ) {\n\t\t\ttry {\n\t\t\t\t$xmlSection = (defined('BUILD_ENVIRONMENT')) ? BUILD_ENVIRONMENT : strtolower($_SERVER['SERVER_NAME']);\n\t\t\t\t$viewXml = new Zend_Config_Xml($viewBuildFile, $xmlSection);\n\t\t\t\tZend_Registry::get('site_config_cache')->save($viewXml, 'view_config');\n\t\t\t} catch (Zend_Exception $e) {\n\t\t\t\tthrow new Exception( 'There was a problem caching the config file: ' . $e->getMessage() );\n\t\t\t}\n\t\t}\n\t\tunset($viewBuildFile, $xmlSection);\n\t\t\n\t\t\n\t\t// Alias' replacements\n\t\t$replacements = array(\n ':baseDir' => $basePath\n ); \n\t\t\n $params = str_replace(array_keys($replacements), array_values($replacements), $viewXml->smarty->params->toArray());\n\n\t\t// Set the base smarty parameters\n\t\t$this->setParams($params);\n\t\t\n\t\t// Register plugins\n\t\t/*\n\t\tif (isset($viewXml->smarty->plugins)){\n\t\t\t$plugins\t= $viewXml->smarty->plugins->toArray();\n\t\t\t\n\t\t\t// Loop each plugin entry\n\t\t\tforeach($plugins as $key => $plugin)\n\t\t\t{\n\t\t\t\t// Check if a plugin type has been specified\n\t\t\t\tif (isset($plugin['type'])){\n\t\t\t\t\tswitch($plugin['type'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'resource':\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t$methodArgs\t= array(\n\t\t\t\t\t\t\t\t\t$key . '_get_source',\n\t\t\t\t\t\t\t\t\t$key . '_get_timestamp',\n\t\t\t\t\t\t\t\t\t$key . '_get_secure',\n\t\t\t\t\t\t\t\t\t$key . '_get_trusted'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$methodArgs\t= (is_array($plugin['parameters'])) ? $plugin['parameters'] : array();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//$methodName\t= 'register_' . $plugin['type'];\n\t\t\t\t\t//$this->_setSmartyMethod($methodName, array($key, $methodArgs));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t}",
"public function contuctUs()\n {\n return view('Front.page.contuctus');\n }",
"public function index()\n {\n $id = 1;\n $data['pagina_conf'] = \"Active\";\n $data['configuracao'] = Configuracao::find($id);\n //dd($data);\n return view('admin.configuracao')->with($data);\n }",
"public function view($params = array())\n { \n extract($this->modelOptions);\n $params['route'] = $route;\n $params['activemenu'] = $modulename;\n $params['pagetitle'] = $modulename;\n $params['modulename'] = $modulename;\n $params['breadcrumb'] = array(\n $modulename => base_url().$route\n );\n $params['modelfield'] = $modelfield;\n $page = 'model/view';\n if (array_key_exists('view', $this->modelOptions)) {\n $v = $this->modelOptions['view'];\n if (array_key_exists('view', $v)) {\n $page = $v['view'];\n }\n }\n\n $params['show_created_by'] = isset($this->modelOptions['show_created_by']) ? true : false;\n $params['show_created_date'] = isset($this->modelOptions['show_created_date']) ? true : false;\n $this->view->genView($page, $params);\n }",
"abstract protected function renderView();",
"public function compose(View $view)\n {\n $view->withAboutApp(Markdown::convertToHtml($this->config->get('setting.app_about')));\n $view->withAppAnalytics($this->config->get('setting.app_analytics'));\n $view->withAppAnalyticsGoSquared($this->config->get('setting.app_analytics_gs'));\n $view->withAppAnalyticsPiwikUrl($this->config->get('setting.app_analytics_piwik_url'));\n $view->withAppAnalyticsPiwikSiteId($this->config->get('setting.app_analytics_piwik_site_id'));\n $view->withAppBanner($this->config->get('setting.app_banner'));\n $view->withAppBannerStyleFullWidth($this->config->get('setting.style_fullwidth_header'));\n $view->withAppBannerType($this->config->get('setting.app_banner_type'));\n $view->withAppDomain($this->config->get('setting.app_domain'));\n $view->withAppGraphs($this->config->get('setting.display_graphs'));\n $view->withAppLocale($this->config->get('setting.app_locale'));\n $view->withAppStylesheet($this->config->get('setting.stylesheet'));\n $view->withAppUrl($this->config->get('app.url'));\n $view->withAppHeader($this->config->get('setting.header'));\n $view->withAppFooter($this->config->get('setting.footer'));\n $view->withAppName($this->config->get('setting.app_name'));\n $view->withShowSupport($this->config->get('setting.show_support'));\n $view->withAutomaticLocalization($this->config->get('setting.automatic_localization'));\n $view->withEnableExternalDependencies($this->config->get('setting.enable_external_dependencies'));\n $view->withShowTimezone($this->config->get('setting.show_timezone'));\n $view->withAppRefreshRate($this->config->get('setting.app_refresh_rate'));\n $view->withTimezone($this->dates->getTimezone());\n $view->withSiteTitle($this->config->get('setting.app_name'));\n $view->withFontSubset($this->config->get('langs.'.$this->config->get('app.locale').'.subset', 'latin'));\n $view->withOnlyDisruptedDays($this->config->get('setting.only_disrupted_days'));\n $view->withDashboardLink($this->config->get('setting.dashboard_login_link'));\n $view->withEnableSubscribers($this->config->get('setting.enable_subscribers'));\n }",
"function display()\n\t{\n\t\tJToolBarHelper::title(JText::_('JOOMLAPACK').':: <small><small>'.JText::_('CONFIGURATION').'</small></small>');\n\t\tJToolBarHelper::apply();\n\t\tJToolBarHelper::save();\n\t\tJToolBarHelper::cancel();\n\t\tJoomlapackHelperUtils::addLiveHelp('config');\n\t\t$document =& JFactory::getDocument();\n\t\t$document->addStyleSheet(JURI::base().'components/com_joomlapack/assets/css/joomlapack.css');\n\n\t\t// Load the util helper\n\t\t$this->loadHelper('utils');\n\n\t\t// Load the model\n\t\t$model =& $this->getModel();\n\n\t\t// Pass on the lists\n\t\t$this->assign('backuptypelist',\t\t\t\t$model->getBackupTypeList());\n\t\t$this->assign('loglevellist',\t\t\t\t$model->getLogLevelList() );\n\t\t$this->assign('sqlcompatlist',\t\t\t\t$model->getSqlCompatList() );\n\t\t$this->assign('algolist',\t\t\t\t\t$model->getAlgoList() );\n\t\t$this->assign('listerlist',\t\t\t\t\t$model->getFilelistEngineList() );\n\t\t$this->assign('dumperlist',\t\t\t\t\t$model->getDatabaseEngineList() );\n\t\t$this->assign('archiverlist',\t\t\t\t$model->getArchiverEngineList() );\n\t\t$this->assign('installerlist',\t\t\t\t$model->getInstallerList() );\n\t\t$this->assign('backupmethodlist',\t\t\t$model->getBackupMethodList() );\n\t\t$this->assign('authlist',\t\t\t\t\t$model->getAuthLevelList() );\n\n\t\t// Let's pass the data\n\t\t// -- Common Basic\n\t\t$this->assign('OutputDirectory',\t\t\t$model->getVar('OutputDirectoryConfig') );\n\t\t// -- Common Frontend\n\t\t$this->assign('enableFrontend',\t\t\t\t$model->getVar('enableFrontend') );\n\t\t$this->assign('secretWord',\t\t\t\t\t$model->getVar('secretWord') );\n\t\t$this->assign('frontendemail',\t\t\t\t$model->getVar('frontendemail') );\n\t\t$this->assign('arbitraryfeemail',\t\t\t$model->getVar('arbitraryfeemail'));\n\t\t// -- Basic\n\t\t$this->assign('BackupType',\t\t\t\t\t$model->getVar('BackupType') );\n\t\t$this->assign('TarNameTemplate',\t\t\t$model->getVar('TarNameTemplate') );\n\t\t$this->assign('logLevel',\t\t\t\t\t$model->getVar('logLevel') );\n\t\t$this->assign('authlevel',\t\t\t\t\t$model->getVar('authlevel') );\n\t\t$this->assign('cubeinfile',\t\t\t\t\t$model->getVar('cubeinfile') );\n\t\t// -- Advanced\n\t\t$this->assign('MySQLCompat', \t\t\t\t$model->getVar('MySQLCompat') );\n\t\t$this->assign('dbAlgorithm',\t\t\t\t$model->getVar('dbAlgorithm') );\n\t\t$this->assign('packAlgorithm', \t\t\t\t$model->getVar('packAlgorithm') );\n\t\t$this->assign('listerengine', \t\t\t\t$model->getVar('listerengine') );\n\t\t$this->assign('dbdumpengine', \t\t\t\t$model->getVar('dbdumpengine') );\n\t\t$this->assign('packerengine', \t\t\t\t$model->getVar('packerengine') );\n\t\t$this->assign('InstallerPackage',\t\t\t$model->getVar('InstallerPackage') );\n\t\t$this->assign('backupMethod', \t\t\t\t$model->getVar('backupMethod') );\n\t\t$this->assign('minexectime',\t\t\t\t$model->getVar('minexectime'));\n\t\t$this->assign('enableSizeQuotas',\t\t\t$model->getVar('enableSizeQuotas') );\n\t\t$this->assign('enableCountQuotas',\t\t\t$model->getVar('enableCountQuotas') );\n\t\t$this->assign('sizeQuota',\t\t\t\t\t$model->getVar('sizeQuota') );\n\t\t$this->assign('countQuota',\t\t\t\t\t$model->getVar('countQuota') );\n\t\t$this->assign('enableMySQLKeepalive',\t\t$model->getVar('enableMySQLKeepalive') );\n\t\t$this->assign('gzipbinary',\t\t\t\t\t$model->getVar('gzipbinary'));\n\t\t$this->assign('effvfolder',\t\t\t\t\t$model->getVar('effvfolder'));\n\t\t$this->assign('dereferencesymlinks',\t\t$model->getVar('dereferencesymlinks'));\n\t\t$this->assign('splitpartsize',\t\t\t\t$model->getVar('splitpartsize'));\n\t\t// -- Magic numbers\n\t\t$this->assign('mnRowsPerStep', \t\t\t\t$model->getVar('mnRowsPerStep') );\n\t\t$this->assign('mnMaxFragmentSize',\t\t\t$model->getVar('mnMaxFragmentSize') );\n\t\t$this->assign('mnMaxFragmentFiles', \t\t$model->getVar('mnMaxFragmentFiles') );\n\t\t$this->assign('mnZIPForceOpen',\t\t\t\t$model->getVar('mnZIPForceOpen') );\n\t\t$this->assign('mnZIPCompressionThreshold',\t$model->getVar('mnZIPCompressionThreshold') );\n\t\t$this->assign('mnZIPDirReadChunk',\t\t\t$model->getVar('mnZIPDirReadChunk') );\n\t\t$this->assign('mnMaxExecTimeAllowed',\t\t$model->getVar('mnMaxExecTimeAllowed') );\n\t\t$this->assign('mnMinimumExectime',\t\t\t$model->getVar('mnMinimumExectime') );\n\t\t$this->assign('mnExectimeBiasPercent',\t\t$model->getVar('mnExectimeBiasPercent') );\n\t\t$this->assign('mnMaxOpsPerStep',\t\t\t$model->getVar('mnMaxOpsPerStep') );\n\t\t$this->assign('mnArchiverChunk',\t\t\t$model->getVar('mnArchiverChunk') );\n\t\t// -- MySQLDump\n\t\t$this->assign('mysqldumpPath',\t\t\t\t$model->getVar('mysqldumpPath') );\n\t\t$this->assign('mnMSDDataChunk',\t\t\t\t$model->getVar('mnMSDDataChunk') );\n\t\t$this->assign('mnMSDMaxQueryLines',\t\t\t$model->getVar('mnMSDMaxQueryLines') );\n\t\t$this->assign('mnMSDLinesPerSession',\t\t$model->getVar('mnMSDLinesPerSession') );\n\t\t// -- DirectFTP\n\t\t$this->assign('df_host',\t\t\t\t\t$model->getVar('df_host') );\n\t\t$this->assign('df_port',\t\t\t\t\t$model->getVar('df_port') );\n\t\t$this->assign('df_user',\t\t\t\t\t$model->getVar('df_user') );\n\t\t$this->assign('df_pass',\t\t\t\t\t$model->getVar('df_pass') );\n\t\t$this->assign('df_initdir',\t\t\t\t\t$model->getVar('df_initdir') );\n\t\t$this->assign('df_usessl',\t\t\t\t\t$model->getVar('df_usessl') );\n\t\t$this->assign('df_passive',\t\t\t\t\t$model->getVar('df_passive') );\n\n\t\t// Also load the Configuration HTML helper\n\t\t$this->loadHelper('config');\n\t\tparent::display();\n\t}",
"public function index()\n {\n $produtos = DB::table('tb_produtos')\n ->selectRaw(\"*\")\n ->get();\n return view('config.config', ['produtos' => $produtos]);\n }",
"public function MenuConfigInventaire(){\n\t\t\tparent::view('Home/Menu6');\n\t\t}",
"public function index()\n {\n //\n $data = Config::find(1);\n\n return view('admin.config.index',['data'=>$data]);\n }",
"public function actionView()\n {\n $param = BaseRequest::getParamOnUrl('param');\n \n $service = $this->getOneByParam('service',['title' => $param]);\n \n return $this->render('view',['service' => $service]);\n }",
"public function index()\n {\n\n\n $this->view->render();\n }",
"public function index(){\n $this->set('title_for_layout', 'О компании');\n $About = ClassRegistry::init('About');\n $about = $About->getAbout();\n $this->set('data',$about);\n }",
"public function __construct()\n {\n $this->view = 'frontend.contents.home';\n }",
"public function render(){\n\n }",
"public function render()\n {\n return view('adminhub::livewire.components.settings.languages.create')\n ->layout('adminhub::layouts.base');\n }",
"public function viewTest()\n\t{\n\t\treturn $this->viewComponent;\n\t}"
] | [
"0.6310901",
"0.6207613",
"0.60912395",
"0.60407805",
"0.600658",
"0.59511584",
"0.5931364",
"0.5891508",
"0.5820077",
"0.58165723",
"0.58055013",
"0.5796077",
"0.5765872",
"0.57508284",
"0.57245326",
"0.5723973",
"0.5722933",
"0.568104",
"0.5664576",
"0.56618834",
"0.5643895",
"0.56102824",
"0.5608038",
"0.56035554",
"0.5599263",
"0.559116",
"0.55882156",
"0.5586524",
"0.5574591",
"0.5571194",
"0.5552604",
"0.554773",
"0.554458",
"0.5537514",
"0.55340797",
"0.55183136",
"0.5516549",
"0.55141616",
"0.5509832",
"0.5503795",
"0.5490759",
"0.54894197",
"0.54863685",
"0.54830724",
"0.5479263",
"0.5471235",
"0.5471235",
"0.5469801",
"0.54598576",
"0.5459475",
"0.5449461",
"0.54475504",
"0.5442638",
"0.54365003",
"0.5433232",
"0.5432027",
"0.5427017",
"0.54236007",
"0.54192895",
"0.5416937",
"0.5415753",
"0.54144853",
"0.53965884",
"0.53931016",
"0.53914565",
"0.5386101",
"0.5375868",
"0.5366255",
"0.53647643",
"0.53639334",
"0.535017",
"0.53489125",
"0.5339394",
"0.53378755",
"0.5332264",
"0.5328255",
"0.53268677",
"0.5323269",
"0.53198314",
"0.5316793",
"0.53151995",
"0.5314722",
"0.5313891",
"0.53136367",
"0.53104866",
"0.5309273",
"0.5307952",
"0.5304849",
"0.53006905",
"0.52996826",
"0.52994746",
"0.52989626",
"0.52985686",
"0.5295494",
"0.5286089",
"0.52782625",
"0.5277937",
"0.52744067",
"0.52690417",
"0.5258128"
] | 0.61629796 | 2 |
Trata as rotas prefixadas do cake | public function _tratar_rotas_prefixadas($controller, $action) {
$routing_prefixes = Configure::read('Routing.prefixes');
//Existe prefixos
if (!empty($routing_prefixes)) {
//Verifica para cada prefixo se a action come?a por ele
foreach ($routing_prefixes as $prefix) {
$strpos = strpos($action, $prefix . '_');
if ($strpos === 0) {
$function = substr($action, strlen($prefix . '_'));
if ($controller == null) {
return $function . '/';
}
if (empty($this->controller->request->params['plugin']) || $controller == $this->controller->request->params['plugin']) {
//Se o plugin for vazio ou for igual ao controlador retorna /prefix/controller/action
$controller_action = sprintf('%s/%s/%s', $prefix, $controller, $function);
} else {
//Caso contr?rio, retorna /prefix/plugin/controller/action
$plugin = $this->controller->request->params['plugin'];
$controller_action = sprintf('%s/%s/%s/%s', $prefix, $plugin, $controller, $function);
}
return $controller_action;
}
}
}
//Se n?o encontrar nenhum prefixo na a??o atual retorna por aqui
if ($controller == null) {
return $action . '/';
} else {
return $controller . '/' . $action . '/';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prefixKey($prefix);",
"public function getPrefix() {}",
"public function setPrefix() {\n\t}",
"public function test_insertPrefix()\n\t{\n\t}",
"public function test_updatePrefix()\n\t{\n\t}",
"abstract protected function prefixName($name);",
"abstract protected function prefixName($name);",
"public function prefix($value);",
"abstract public function getPrefix(): string;",
"public function getPrefix(): string\n {\n }",
"public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }",
"public function getPrefix();",
"public function getPrefix();",
"public function prefix() : string\n {\n return config('admin.slug', 'admin');\n }",
"public function setPrefixFromDB(){\n foreach($this->getTables() as $table){\n $prefix = explode('_', $table);\n if(isset($prefix[1])){\n if($this->prefix==$prefix[0]) break;\n else $this->prefix = $prefix[0];\n }\n }\n }",
"protected static function prefix(): string\n {\n return '';\n }",
"function tck_get_prefix($mode) {\n if ( $mode == 0 ) {\n $option = 'tck_random_prefix';\n } else if ( $mode == 1 ) {\n $option = 'tck_custom_prefix';\n }\n\n if ( yourls_get_option($option) !== false ) {\n $prefix = yourls_get_option($option);\n } else {\n if ( $mode == 0 ) {\n $prefix = TCK_DEFAULT_RANDOM_PREFIX;\n } else if ( $mode == 1 ) {\n $prefix = TCK_DEFAULT_CUSTOM_PREFIX;\n }\n \n yourls_add_option($option, $prefix);\n }\n \n return $prefix;\n }",
"public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_prefix = $prefix;\n\t\t} else {\n\t\t\t$args = func_get_args();\n\t\t\t$args = Arrays::castToType($args, 'string');\n\t\t\t$this->id_prefix = implode('.', $args);\n\t\t}\n\n\t\tif (substr($this->id_prefix, -1, 1) != '.') {\n\t\t\t$this->id_prefix .= '.';\n\t\t}\n\t}",
"public static function keyPrefix()\n {\n return Inflector::camel2id(StringHelper::basename(get_called_class()), '_');\n }",
"function get_prefix($course)\n{\n return $course->prefix;\n}",
"public function testPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n\n $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes): void {\n $this->assertSame('admin:', $routes->namePrefix());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n }",
"public function getPrefix()\n\t{\n\t\treturn (strlen($this->prefix) > 0) ? $this->prefix.'_' : '';\n\t}",
"abstract public function getRoutePrefix();",
"public function getPrefix()\n {\n return '';\n }",
"function apply_url_prefix($data, $prefix) {\n foreach (array_keys($data['tar']) as $key) {\n $data['tar'][$key] = $prefix . $data['tar'][$key];\n }\n return $data;\n}",
"public static function snake()\n {\n return self::generate('_');\n }",
"protected function _renumber_cache_prefix() {\n\t $editionId = Hash::get($this->request->getQueryParams(), 'edition', null);\n\t\treturn $this->contextUser()->artistId() . '-' . $editionId;\n\t}",
"protected function getPrefix()\n {\n $prefix = '';\n return $prefix;\n }",
"public function setPrefix( $prefix );",
"Public Function getPrefix() { Return $this->prefix; }",
"function prefix() {\n \n $prefix = \"/\";\n\n if(isset($_COOKIE['FolderName'])) { \n $prefix = $_COOKIE['FolderName'];\n }\n if ($prefix) {\n if (!(substr($prefix, -1) == \"/\" )) {\n $prefix = $prefix . \"/\"; \n }\n }\n return $prefix;\n}",
"public function getTablePrefix();",
"abstract protected function getDefaultPrefix(): string;",
"protected function _getPrefix()\n\t{\n\t\t$ret = '/';\n\n\t\tif(isset($this->_options['namespace'])) {\n\t\t\t$ret .= isset($this->_options['prefix']) ? $this->_options['prefix'] : $this->_options['namespace'];\n\t\t}\n\n\t\treturn $ret;\n\t}",
"protected function createPrefix(): string\n {\n return date('Y-m-d_h-i') . '-' . GeneralUtility::makeInstance(Random::class)->generateRandomHexString(16);\n }",
"public function getPrefix(): string\n {\n return config('linky.db.prefix');\n }",
"public function prefixLocalAnchorsWithScript() {}",
"public function setPrefix($prefix);",
"public function eh_rota_prefixada() {\n $routes = Configure::read('Routing.prefixes');\n if (count($routes)) {\n $a = $this->controller->action;\n foreach ($routes as $route) {\n $strpos = strpos($a, $route . '_');\n if ($strpos === 0) {\n return true;\n }\n }\n }\n return false;\n }",
"public function testUrlGenerationWithAutoPrefixes(): void\n {\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/protected/{controller}/{action}/*', ['prefix' => 'Protected']);\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n $routes->connect('/{controller}/{action}/*');\n\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n 'prefix' => null, 'protected' => false, 'url' => ['url' => 'images/index'],\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add']);\n $expected = '/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add_protected_test', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add_protected_test';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1]);\n $expected = '/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'protectedEdit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/protectedEdit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Others', 'action' => 'edit', 1]);\n $expected = '/Others/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Others', 'action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Others/edit/1';\n $this->assertSame($expected, $result);\n }",
"public function prefixClassName($prefix) {\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_CLASS_SIGNATURE, function($matches) use ($prefix) {\n\t\t\treturn $matches['modifiers'] . $prefix . $matches['className'] . $matches['parents'];\n\t\t}, $this->processedClassCode);\n\t}",
"abstract function get_cache_prefix(): string;",
"public function getCustomerPrefix();",
"function prefix($n = null) {\n\tglobal $ns;\n\tif (is_null($n))\n\t\t$n = array_keys($ns);\n\tif (!is_array($n))\n\t\t$n = array($n);\n\t$ret = \"\";\n\tforeach ($n as $s)\n\t\t$ret .= \"PREFIX $s: <\" . $ns[$s] . \">\\n\";\n\treturn $ret;\n}",
"public function prefixOrderProperty() {\n\t\tif (is_string($this->order)) {\n\t\t\t$this->order = $this->prefixAlias($this->order);\n\t\t}\n\t\tif (is_array($this->order)) {\n\t\t\tforeach ($this->order as $key => $value) {\n\t\t\t\tif (is_numeric($key)) {\n\t\t\t\t\t$this->order[$key] = $this->prefixAlias($value);\n\t\t\t\t} else {\n\t\t\t\t\t$newKey = $this->prefixAlias($key);\n\t\t\t\t\t$this->order[$newKey] = $value;\n\t\t\t\t\tif ($newKey !== $key) {\n\t\t\t\t\t\tunset($this->order[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function testUrlGenerationMultiplePrefixes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $routes->prefix('backoffice', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n });\n $result = Router::url([\n 'prefix' => 'Admin/Backoffice',\n 'controller' => 'Dashboards',\n 'action' => 'home',\n ]);\n $expected = '/admin/backoffice/dashboards/home';\n $this->assertSame($expected, $result);\n }",
"protected function setTablePrefix()\n {\n }",
"public function getMessageIdPrefix(){\n\n if ($this->_p->getVar('server_name'))\n return $this->_p->getVar('tbl_prefix').md5($this->_p->getVar('server_name')).'_';\n elseif ($this->_p->getVar('mail')['default_from_mail'])\n return $this->_p->getVar('tbl_prefix').md5($this->_p->getVar('mail')['default_from_mail']).'_';\n else\n return $this->_p->getVar('tbl_prefix').md5(dirname(__FILE__)).'_';\n\n }",
"function acf_add_array_key_prefix($array, $prefix)\n{\n}",
"static function replaceDbPrefix($sql)\r\n{\r\n\t$app = JFactory::getApplication();\r\n\t$dbprefix = $app->getCfg('dbprefix');\r\n\treturn str_replace('#__',$dbprefix,$sql);\r\n}",
"function AddPrefixToFileName() {\n\t\t\t$this->NewFileName = time().'_'.$this->GetFileName();\n\t\t\t//echo $this->NewFileName; exit();\n\t\t\treturn $this->NewFileName;\n\t\t}",
"public function getPrefix()\n {\n return $this->prefix ?? '';\n }",
"protected function getPrefix(): string\n\t{\n\t\treturn $this->arParams['PREFIX'] !== '' ? $this->arParams['PREFIX'] : $this->getDefaultPrefix();\n\t}",
"public function getUniqueControllerPrefix()\n {\n return self::PREFIX;\n }",
"public static function getTablePrefix()\n {\n return 'prefix_';\n }",
"public function restricoes_possuem_rotas_prefixadas() {\n $routes = Configure::read('Routing.prefixes');\n foreach ($this->restricoes as $restriction) {\n if (in_array($restriction, $routes)) {\n return true;\n }\n }\n return false;\n }",
"public function findNewId($prefix){\n\t\t$em = $this->getEntityManager();\n\t\t$qb = $em->createQueryBuilder();\n\t\n\t\t// Build the query\n\t\t$qb->select('f.num')->from('ArxiuBundle:FonsMitra', 'f');\n\t\n\t\t$qb->where('f.num LIKE :prefix');\n\t\n\t\t$qb->setParameter('prefix', $prefix . '%');\n\t\t$qb->orderBy('f.num', 'DESC');\n\t\t$qb->setMaxResults(1);\n\t\t$q = $qb->getQuery();\n\t\n\t\t$r=$q->getResult();\n\t\tif(empty($r)) {\n\t\t\t$resultat=$prefix.'1';\n\t\t}\n\t\telse{\n\t\t\tforeach ($r as $valor1){\n\t\t\t\tforeach ($valor1 as $valor2){\n\t\t\t\t\t$qr=$valor2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$parts = explode('-', $qr);\n\t\t\t\n\t\t\t$afegit= intval($parts[2])+1;\n\t\t\t$resultat=$parts[0].'-'.$parts[1].'-'.$afegit;\n\t\t}\n\t}",
"function ajan_core_get_table_prefix() {\n\tglobal $wpdb;\n\n\treturn apply_filters( 'ajan_core_get_table_prefix', $wpdb->base_prefix );\n}",
"public function routePrefix(): string\n {\n $locale = $this->routedLocale() ? $this->routedLocale() : $this->defaultLocale();\n\n return $locale->{$this->defaultKey};\n }",
"protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }",
"public function getPrefix()\n\t{\n\t\treturn $this->royalcms['config']['cache.prefix'];\n\t}",
"public function prefix() {\n return $this->db['prefix'];\n }",
"function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"subjects\", \"text\" => \"texts\");\n}",
"function get_prefix($field)\n\t{\n\t\t$str = \"Nuev\";\n\n\t\tif( $field == \"usr_email\" || $field == \"usr_name\" || $field == \"usr_cod_postal\" )\n\t\t\t$str .= \"o\";\n\t\telse\n\t\t\t$str .= \"a\";\n\n\t\treturn $str;\n\t}",
"private function getPrefix()\n\t{\n\t\tif (!empty($this->element->TreeViewElement->Strategy)) {\n\t\t\treturn 'cstruter-tree-'.strtolower($this->element->TreeViewElement->Strategy);\n\t\t}\n\t\treturn 'cstruter-tree';\t\t\n\t}",
"public function testPrefixOverride(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}', ['prefix' => 'Admin']);\n $routes->connect('/protected/{controller}/{action}', ['prefix' => 'Protected']);\n\n $request = new ServerRequest([\n 'url' => '/protected/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Protected',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Admin']);\n $expected = '/admin/Images/add';\n $this->assertSame($expected, $result);\n\n $request = new ServerRequest([\n 'url' => '/admin/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Admin',\n ],\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n }",
"public function get_prefix($sub = '', $language='') {\n if (empty($sub)) {\n $sub = 'main';\n }\n return parent::get_prefix($sub, $language);\n }",
"function prefix_strs($prefix,$strs){\n\t\tforeach ($strs as &$str)\n\t\t\t$str = $prefix.$str;\n\t\t\t\n\t\treturn $strs;\n\t}",
"function _polylang_fix_sitemap_prefix( $prefix = '' ) {\n\t$path = parse_url( \\home_url(), PHP_URL_PATH );\n\treturn \\trailingslashit( \"$prefix$path\" );\n}",
"function rest_get_url_prefix()\n {\n }",
"function _prefix($prefix = 'admin') {\n\t\tif (isset($this->params['prefix']) && $this->params['prefix'] == $prefix) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function getPrefix(): string\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n // TODO: Implement getPrefix() method.\n }",
"public function Get_All_Prefix()\n {\n $this->DB->Change_DB($this->PERSON_DB);\n $sql = \"SELECT `code`,`name` FROM `prefix` ORDER BY `name_full`\";\n $result = $this->DB->Query($sql);\n $this->DB->Change_DB($this->DEFAULT_DB);\n if($result)\n {\n $prefix = array();\n for($i=0;$i<count($result);$i++)\n {\n $temp['id'] = $result[$i]['code'];\n $temp['prefix'] = $result[$i]['name'];\n array_push($prefix,$temp);\n }\n return $prefix;\n }\n else\n {\n return false;\n }\n\n }",
"public function findNewId($prefix){\n\t\t$em = $this->getEntityManager();\n\t\t$qb = $em->createQueryBuilder();\n\t\n\t\t// Build the query\n\t\t$qb->select('f.num')->from('ArxiuBundle:FonsTestaments', 'f');\n\t\n\t\t$qb->where('f.num LIKE :prefix');\n\t\n\t\t$qb->setParameter('prefix', $prefix . '%');\n\t\t$qb->orderBy('f.num', 'DESC');\n\t\t$qb->setMaxResults(1);\n\t\t$q = $qb->getQuery();\n\t\n\t\t$r=$q->getResult();\n\t\tif(empty($r)) {\n\t\t\t$resultat=$prefix.'1';\n\t\t}\n\t\telse{\n\t\t\tforeach ($r as $valor1){\n\t\t\t\tforeach ($valor1 as $valor2){\n\t\t\t\t\t$qr=$valor2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$parts = explode('-', $qr);\n\t\t\t\n\t\t\t$afegit= intval($parts[2])+1;\n\t\t\t$resultat=$parts[0].'-'.$parts[1].'-'.$afegit;\n\t\t}\n\t\treturn $resultat;\n\t}",
"protected function getFieldNamePrefix() {}",
"protected function getFieldNamePrefix() {}",
"public function prefix_table($table)\n\t{\n\t\t// Add the prefix to the table name\n\t\t// before quoting it\n\t\tif ( ! empty($this->table_prefix))\n\t\t{\n\t\t\t// Split indentifier by period, will split into:\n\t\t\t// database.schema.table OR\n\t\t\t// schema.table OR\n\t\t\t// database.table OR\n\t\t\t// table\n\t\t\t$idents = explode('.', $table);\n\t\t\t$segments = count($idents);\n\n\t\t\t// Quote the last item, and add the database prefix\n\t\t\t$idents[$segments - 1] = $this->_prefix(end($idents));\n\n\t\t\t// Rejoin\n\t\t\t$table = implode('.', $idents);\n\t\t}\n\n\t\treturn $table;\n\t}",
"function mini_rest_prefix( $slug )\n{ \n return \"mini\";\n}",
"private function getPrefix($data)\n {\n if($data['type'] == 1)\n { \n return $this->courseRepository->find($data['course_id'])->abbr;\n } \n else if($data['type'] == 2)\n {\n return \"PROF\";\n }\n else\n {\n return \"ADMIN\";\n }\n }",
"protected function getPrefix() {\n\t\t$prefix = (string) $this->viewHelperVariableContainer->get('TYPO3\\\\CMS\\\\Fluid\\\\ViewHelpers\\\\FormViewHelper', 'fieldNamePrefix');\n\n\t\tif (!empty($this->prefix)) {\n\t\t\t$prefix = sprintf('%s[%s]', $prefix, $this->prefix);\n\t\t}\n\t\treturn $prefix;\n\t}",
"protected function routePrefix($delimiter = '')\n\t{\n\t\treturn $this->config('routes.prefix') ? $this->config('routes.prefix') . $delimiter : '';\n\t}",
"private function Prefix($type=NULL) {\n\t\tif (!isset($type)) {\n\t\t\t$parts = preg_split('/\\\\\\/', get_class($this));\n\t\t\t$type = $parts[count($parts)-1];\n\t\t}\n\t\tswitch($type) {\n\t\tcase 'Account':\n\t\t\treturn self::ACCOUNT_META_PREFIX;\n\t\tcase 'CDNContainer':\n\t\t return self::CDNCONTAINER_META_PREFIX;\n\t\tcase 'Container':\n\t\t\treturn self::CONTAINER_META_PREFIX;\n\t\tcase 'DataObject':\n\t\t\treturn self::OBJECT_META_PREFIX;\n\t\tdefault:\n\t\t\tthrow new MetadataPrefixError(sprintf(\n\t\t\t\t_('Unrecognized metadata type [%s]'), $type));\n\t\t}\n\t}",
"public function getPrefix(): string\n {\n if (is_null($this->prefixCache)) {\n $prefix = Config::get('database-encryption.prefix', null);\n $prefix = ! empty($prefix) && is_string($prefix) ? $prefix : self::getPrefixDefault();\n\n $this->prefixCache = $this->isVersioning() ?\n str_replace('%VERSION%', $this->getVersionForPrefix(), $prefix) :\n $prefix;\n }\n\n return $this->prefixCache;\n }",
"public function getRoutePrefix()\n {\n return 'admin_category';\n }",
"public function setPrefix($name)\n\t{\n\t\t$this->royalcms['config']['cache.prefix'] = $name;\n\t}",
"public function getPrefixTitle ();",
"public function getPluginPrefix() {\n return str_replace('-','_',$this->plugin_name);\n }",
"public function getPluginPrefix() {\n return str_replace('-','_',$this->plugin_name);\n }",
"function getPrefixes();",
"function acf_prefix_fields(&$fields, $prefix = 'acf')\n{\n}",
"protected function getIdentifierPrefix() {}",
"protected function getIdentifierPrefix() {}",
"public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}",
"public static function getFilePrefix() {}",
"public function testPrefixOptions(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', ['param' => 'value'], function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin', 'param' => 'value'], $routes->params());\n });\n\n $routes->prefix('CustomPath', ['path' => '/custom-path'], function (RouteBuilder $routes): void {\n $this->assertSame('/custom-path', $routes->path());\n $this->assertEquals(['prefix' => 'CustomPath'], $routes->params());\n });\n }",
"public static function getTablePrefix()\n {\n }",
"public function getRoutePrefix(){\n return $this->routePrefix;\n }",
"public function testAddRouteAndCheckPrefix()\n {\n $this->collection->setPrefix('name-prefix.', '/path-prefix');\n $this->collection->get('name', '/path', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertEquals('name-prefix.name', $routes[0]->getName());\n $this->assertEquals('/path-prefix/path', $routes[0]->getSourceRoute());\n }",
"public function buildPrefix($name = '')\n {\n return $this->field->name . '_' . $name . '_' . $this->page->id;\n }"
] | [
"0.6350855",
"0.627416",
"0.62089014",
"0.61696035",
"0.61504",
"0.6112454",
"0.6112454",
"0.6103464",
"0.60672075",
"0.6065091",
"0.6062989",
"0.60589224",
"0.60589224",
"0.60018784",
"0.597183",
"0.5880728",
"0.5869474",
"0.57809645",
"0.57745206",
"0.57655174",
"0.57380486",
"0.5730553",
"0.5724772",
"0.57129556",
"0.5703944",
"0.5698105",
"0.56897885",
"0.5667488",
"0.5666291",
"0.5656603",
"0.56204396",
"0.5617566",
"0.5608154",
"0.5602682",
"0.5598795",
"0.55906713",
"0.5590097",
"0.5586338",
"0.55726635",
"0.5572437",
"0.5570967",
"0.5569794",
"0.5563568",
"0.55599254",
"0.5542444",
"0.5541169",
"0.55268264",
"0.5524662",
"0.5518601",
"0.54998666",
"0.5499424",
"0.54939926",
"0.5492595",
"0.54883486",
"0.54860634",
"0.5482429",
"0.54768115",
"0.5475281",
"0.5473102",
"0.5465518",
"0.5457924",
"0.54562956",
"0.5452285",
"0.5438162",
"0.5433631",
"0.5425236",
"0.54218274",
"0.5403321",
"0.53936976",
"0.5379291",
"0.53751504",
"0.53748715",
"0.53745514",
"0.53729045",
"0.53573006",
"0.5356234",
"0.5356234",
"0.5352307",
"0.5348877",
"0.5346282",
"0.53239024",
"0.5318201",
"0.53029823",
"0.52999175",
"0.5299865",
"0.5291659",
"0.52855957",
"0.5283487",
"0.5283487",
"0.5275191",
"0.52704424",
"0.526864",
"0.526864",
"0.52638084",
"0.52620745",
"0.52514833",
"0.5248745",
"0.52456707",
"0.52446026",
"0.5240829"
] | 0.6194791 | 3 |
Informa se $page ? a p?gina atual | public function _eh_pagina_atual($page) {
if ($page == "") {
return false;
}
App::import('Core', 'Inflector');
$controller = strtolower(Inflector::underscore($this->controller->name));
$action = strtolower($this->controller->action);
$page = strtolower($page . '/');
$controller_action = $this->_tratar_rotas_prefixadas($controller, $action);
if ($page[0] == '/') {
$controller_action = '/' . $controller_action;
}
//die($controller_action . ' ' . $page);
return strpos($page, $controller_action) === 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function page(int $page) {\n $matches = $this->_model->getPageInfos($page);\n if ($matches) {\n $total = $this->_model->getNbrPictures();\n if ($total === -1) {\n $prevpage = false;\n $nextpage = false;\n $this->render(\"General.Page\", compact('matches', 'nextpage', 'prevpage'));\n } else {\n $prevpage = $page !== 0;\n $nextpage = ($page + 1) * 5 < $total;\n $this->render(\"General.Page\", compact('matches', 'nextpage', 'prevpage', 'page'));\n }\n } else if ($page === 0){\n $this->render(\"General.Void\");\n } else {\n $this->page(0);\n }\n }",
"public function set_page($page);",
"public function page(int $page): string;",
"private function page($page){\n return '&page=' . $page;\n }",
"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}",
"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 }",
"private function define_page()\n {\n isset($_GET['page']) && !empty($_GET['page']) && is_numeric($_GET['page']) ? $page = (int)$_GET['page'] : $page = 1;\n return $page;\n }",
"public function index($page)\r\n\t{\r\n \r\n\t}",
"public static function cPage() {\n return isset($_GET[self::$_page]) ?\n $_GET[self::$_page] : 'index';\n //neu nhu bien page da duoc set thi ten trang chinh la bien page, neu chua duoc set thi la trang chu index\n }",
"public function getPageNumber();",
"public function getPageNumber();",
"function showPage($page,$totalPage,$where=null,$sep=\" \"){\n $where = ($where == null)?null:\"&\".$where;\n $url = $_SERVER['PHP_SELF'];\n // 首页\n $index = ($page == 1)?\"首页\":\"<a href='{$url}?page=1{$where}'>首页</a>\";\n // 尾页\n $last = ($page == $totalPage)?\"尾页\":\"<a href='{$url}?page={$totalPage}{$where}'>尾页</a>\";\n $prev = ($page == 1)?\"上一页\":\"<a href='{$url}?page=\".($page - 1).\"{$where}'>上一页</a>\";\n $next = ($page == $totalPage)?\"下一页\":\"<a href='{$url}?page=\".($page + 1).\"{$where}'>下一页</a>\";\n $str = \"总共{$totalPage}页/当前是第{$page}页\";\n $p = \"\";\n for ($i = 1; $i <= $totalPage; $i++){\n // 当前页无链接\n if ($page == $i){\n $p.=\"[{$i}]\";\n }else{\n // 其他页 输出超链接\n $p.=\"<a href='{$url}?page={$i}'>[{$i}]</a>\";\n }\n }\n return $str.$sep.$index.$sep.$prev.$sep.$p.$sep.$next.$sep.$last;\n}",
"public function get_page();",
"public function setPage(int $page)\n {\n $this->page = $page;\n }",
"public function setCurrentPage( $page );",
"function get_page() {\n\n $page = (isset($_GET['page']) && is_numeric($_GET['page']) ) ? $_GET['page'] : 1;\n return $page;\n\n}",
"function pageGetPageNo() {\n if (get_query_var('paged')) {\n print ' | Page ' . get_query_var('paged');\n }\n}",
"public function setPage(int $page): void\n {\n $this->page = $page;\n }",
"public function setPage($page){\n $this->page=$page;\n }",
"public function contenuAutrePage(){\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['AUTRE'])) {\n\t\t\t$this->ajouterErreur(\"Les autres pages ne sont pas définie !\");\n\t\t\treturn;\n\t\t}\n\t\treturn $this->dataInfos['XMLPM']['PAGES']['AUTRE'];\n\t}",
"public function setPage($page)\n\t{\n\t\tif((int) $page == 0)\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\t\t$this->page = $page;\n\t\t// (re-)calculate start rec\n\t\t//$this->calculateStart();\n\t}",
"function index($page, $nombre_article) {\n $index = (($page - 1) * $nombre_article);\n return $index;\n}",
"private function setPage($page)\n {\n $this->page = (int)$page;\n $this->offset = ($page - 1) * $this->limit;\n }",
"public function is_page($page = '')\n {\n }",
"static public function page($contenu, $title=\"\") {\n\t\t$resultat = '';\n\t\t$resultat .= static::page_avant($title);\n\t\t$resultat .= $contenu;\n\t\t$resultat .= static::page_apres();\n\t\treturn $resultat;\n\t}",
"function DrawPages( $link=\"\" )\r\n\t\t{\r\n\t\t\tif( $link == \"\" )\r\n\t\t\t{\r\n\t\t\t\t$link = $_SERVER[\"PHP_SELF\"] . \"?\" . $_SERVER[\"QUERY_STRING\"];\r\n\t\t\t\t\r\n\t\t\t\tif( $pos_PAGE = strpos( $link, \"&page=\" ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$link = substr( $link, 0, $pos_PAGE );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// usando el array remove_words\r\n\t\t\t// ejecuta la eliminación de posibles parametros\r\n\t\t\tfor( $ij=0; $ij<count($this->remove_words); $ij++ )\r\n\t\t\t{\r\n\t\t\t\t$link = str_replace( $this->remove_words[$ij], \"\", $link );\r\n\t\t\t}\r\n\r\n\t\t\techo \"<br>\";\r\n\r\n\t\t\t$str_page = \"Páginas\";\r\n\t\t\t\r\n\t\t\tif( $this->lang != 1 )\r\n\t\t\t{\r\n\t\t\t\tif( $this->lang == 2 )\r\n\t\t\t\t\t$str_page = \"Pages\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<div style='float:left; width:74%;'>\";\r\n\t\t\techo \"<table align='center' border='0'>\";\r\n\t\t\techo \"<tr><td align='center' class='columna'>\" . (($this->TotalPages==0) ? \"\" : \"$str_page\") . \" \";\r\n\r\n\t\t\tif( $this->page > 1 )\r\n\t\t\t echo \" <a href='$link&page=\" . ($this->page-1) . \"'><img src='../images/back_btn.gif' alt='Anterior'></a>\";\t\t\r\n\r\n\t\t\t$since = 1;\r\n\t\t\t$to = $this->TotalPages;\r\n\r\n\t\t\tif( $this->TotalPages > 20 )\r\n\t\t\t{\r\n\t\t\t\t$since = $this->page;\r\n\t\t\t\t$to = $since + 20;\r\n\r\n\t\t\t\tif( $to > $this->TotalPages )\r\n\t\t\t\t{\r\n\t\t\t\t\t$to = $this->TotalPages;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif( $this->TotalPages > 20 and $this->style==\"N\")\r\n\t\t\t{\r\n\t\t\t\techo \" <a href=''>...</a>\";\t\r\n\t\t\t}\r\n\r\n\t\t\t$index_page = $this->page;\r\n\r\n\t\t\tif( $this->style == \"A\" )\r\n\t\t\t{\r\n\t\t\t\t$since = 1;\r\n\t\t\t\t$to = 26;\r\n\r\n\t\t\t\tif( substr($this->page,0,1) == \"!\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->page = substr($this->page, 1, strlen($this->page));\r\n\t\t\t\t\t$this->page = 26 + $this->page;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$index_page = $this->page;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// convertir la página Alfabetica a un INDICE\r\n\t\t\t\t\t$index_page = (ord($this->page) - 64);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor($i=$since; $i<=$to; $i++ )\r\n\t\t\t{\r\n\t\t\t\tif( $i == $index_page )\r\n\t\t\t\t{\r\n\t\t\t\t\techo \"<b><font size=+1>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( $this->style == \"A\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$str = chr(64+$i);\r\n\t\t\t\t\t\techo $str;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\techo $i;\t\t\t\t\t\r\n\r\n\t\t\t\t\techo \"</font></b> \";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif( $this->style == \"A\" )\r\n\t\t\t\t\t\t$str = chr(64+$i);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$str = $i;\r\n\r\n\t\t\t\t\techo \"<a href='\" . $link . \"&page=$str'>\";\r\n\t\t\t\t\techo (($i==$this->page-1 or $i==$this->page+1) ? \"<font size=+0>\" : \"\");\r\n\r\n\t\t\t\t\techo $str;\r\n\r\n\t\t\t\t\techo (($i==$this->page-1 or $i==$this->page+1) ? \"</font>\" : \"\");\r\n\t\t\t\t\techo \"</a> \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif( $this->style == \"A\" )\r\n\t\t\t{\r\n\t\t\t\tfor($i=0; $i<=9; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( 26+$i == $index_page )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo \"<strong><font size=+1>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$str = chr(48+$i);\r\n\t\t\t\t\t\techo $str;\r\n\t\r\n\t\t\t\t\t\techo \"</font></strong> \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$str = chr(48+$i);\r\n\t\r\n\t\t\t\t\t\techo \"<a href='\" . $link . \"&page=!$str'>\";\r\n\t\t\t\t\t\techo ((26+$i==$this->page-1 or 26+$i==$this->page+1) ? \"<font size=+0>\" : \"\");\r\n\t\r\n\t\t\t\t\t\techo $str;\r\n\t\r\n\t\t\t\t\t\techo ((26+$i==$this->page-1 or 26+$i==$this->page+1) ? \"</font>\" : \"\");\r\n\t\t\t\t\t\techo \"</a> \";\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\r\n\t\t\tif( $this->TotalPages > 20 and $this->style==\"N\" )\r\n\t\t\t{\r\n\t\t\t\techo \" <a href=''>...</a>\";\t\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->page<($this->TotalPages-1))\r\n\t\t\t echo \" <a href='$link&page=\" . ($this->page+1) . \"'><img src='../images/forward_btn.gif' alt='Siguiente'></a>\";\t\r\n\r\n\t\t\techo \"</td></tr>\";\r\n\t\t\techo \"</table>\";\r\n\t\t\techo \"</div>\";\r\n\t\t\t\r\n\t\t\tglobal $pr;\r\n\t\t\t\r\n\t\t\tif( isset($pr) )\r\n\t\t\t{\r\n\t\t\t\tglobal $LBL_RECS_X_PAGE;\r\n\t\t\t\techo \"<div style='float:right; width:25%; text-align:right;' class='x-pageRanges'>$LBL_RECS_X_PAGE \";\r\n\t\t\t\techo \"\t<span \" . (($pr==10) ? \"class='current' \" : \"\") . \"><a href='\" . $_SERVER[\"PHP_SELF\"] . \"?pr=10'>10</a></span> \";\r\n\t\t\t\techo \"\t<span \" . (($pr==15) ? \"class='current' \" : \"\") . \"><a href='\" . $_SERVER[\"PHP_SELF\"] . \"?pr=15'>15</a></span> \";\r\n\t\t\t\techo\"\t<span \" . (($pr==20) ? \"class='current' \" : \"\") . \"><a href='\" . $_SERVER[\"PHP_SELF\"] . \"?pr=20'>20</a></span> \";\r\n\t\t\t\techo \" </div>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<br style='clear:both'>\";\r\n\t\t}",
"function pagAtual($url){\n \t$url = $url;\n \t\n \tif ($url[0] == 'inicio'):\n\t\t\techo \"Home\";\n\n\t\telseif ($url[0] == 'portfolio'):\n\t\t\techo \"Portfólio\";\n\t\telseif ($url[0] == 'sobreNos'):\n\t\t\techo \"Sobre Nós\";\n\t\telseif ($url[0] == 'contato'):\n\t\t\techo \"Contato\";\n\t\telseif ($url[0] == 'blog'):\n\t\t\techo \"Blog\";\n\t\telseif ($url[0] == ''):\n\t\t\techo \"Home\";\n\t\telse:\n\t\t\techo \"404 - Página não encontrada! \";\n\t\tendif;\n }",
"public function setPage($page){\n $this->page = $page;\n }",
"function location($page) {\r\n\r\n\t}",
"public function setStartPage($page);",
"public function getPageNumberByPageObject(\\SetaPDF_Core_Document_Page $page) {}",
"function get_one_page(){\n\t\t$this->m_n_current_page_number = gf_get_value_n('v_current_page_number');\n\t}",
"function pagina_actual() {\n return isset($_GET['p']) ? (int)$_GET['p'] : 1;\n}",
"public function setPage($page)\n {\n $this->page = intval($page);\n \n if ($this->page == 0) {\n $this->page = 1;\n }\n }",
"public function getPageNumber() {}",
"public function getPageNumber() {}",
"public function current(int $page): string;",
"public function get_page_info()\n {\n }",
"public function getPage($pageNumber = 0);",
"public function getPageNr(){\n\t\tif(isset($_GET['p'])){\n\t\t\treturn $_GET['p'];\n\t\t}else{\n\t\t\treturn 1;\n\t\t}\n\t}",
"function pager($page, $total, $pnumber, $page_link, $parameters)\n {\n $number = (int)($total/$pnumber);\n if((float)($total/$pnumber) - $number != 0) $number++;\n // Check on left links\n if($page - $page_link > 1)\n {\n echo \"<a href=$_SERVER[PHP_SELF]?page=1{$parameters}> <nobr>[1-$pnumber]</nobr></a> <em class=currentpage><nobr> ... </nobr> </em> \";\n // Have one\n for($i = $page - $page_link; $i<$page; $i++)\n {\n echo \" <a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a> \";\n }\n }\n else\n {\n // Have no\n for($i = 1; $i<$page; $i++)\n {\n echo \" <a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a> \";\n }\n }\n // Check on right links\n if($page + $page_link < $number)\n {\n // Have one\n for($i = $page; $i<=$page + $page_link; $i++)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr> [\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"] </nobr> </em>\";\n else\n echo \" <a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a> \";\n }\n echo \"<em class=currentpage><nobr> ... </nobr> </em> <a href=$_SERVER[PHP_SELF]?page=$number{$parameters}> <nobr>[\".(($number - 1)*$pnumber + 1).\"-$total]</nobr></a> \";\n }\n else\n {\n // Have no\n for($i = $page; $i<=$number; $i++)\n {\n if($number == $i)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr> [\".(($i - 1)*$pnumber + 1).\"-$total] </nobr></em>\";\n else\n echo \" <a href=$_SERVER[PHP_SELF]?page=$i{$parameters}>[\".(($i - 1)*$pnumber + 1).\"-$total]</a> \";\n }\n else\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr> [\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"] </nobr> </em>\";\n else\n echo \" <a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a> \";\n }\n }\n }\n //echo \"<br><br>\";\n }",
"public function setPage($page) {\n\t\t$this->page =$page;\n\t}",
"public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}",
"public function getCurrentPage(): int;",
"public function getCurrentPage(): int;",
"public function display($page){ \n switch($page){\n case 'cities':\n $this->get_big_four_cities();\n break;\n case 'women':\n $this->get_wfashion();\n break;\n case 'men':\n $this->get_mfashion();\n break;\n case 'lifestyle':\n $this->get_lifestyle();\n break;\n case 'culture':\n $this->get_culture();\n break;\n default:\n $this->get_big_four_cities();\n \n } \n }",
"public function page() { return $this->paginating ? $this->page : 1; }",
"function inferieur($tableau){\n\n$elementsParPage=100; \n \n$total=count($tableau);\n \n//determinons le nbre des pages\n$nombreDePages=ceil($total/$elementsParPage);\n \nif(isset($_GET['page']))\n{\n $pageActuelle=intval($_GET['page']);\n \n if($pageActuelle>$nombreDePages) \n {\n $pageActuelle=$nombreDePages;\n }\n}\nelse \n{\n $pageActuelle=1; \n}\n\n$nombreDePages=ceil($total/$elementsParPage);\n \n$premiereEntree=($pageActuelle-1)*$elementsParPage; // On calcule la première entrée à lire\n \n$cpt=0;\n\necho \"<table class='TablePremier' style='margin-top:20px;'><tr>\";\n for ($i=$premiereEntree; $i < ($premiereEntree+$elementsParPage); $i++) \n { \n if($i==count($tableau))\n {\n break;\n }\n $cpt++; \n echo '<td>'.$tableau[$i].'</td>';\n\n if($cpt==10)\n {\n echo '</tr>';\n $cpt=0;\n } \n }\necho '</table>';\n\necho '<p>Page : '; \n for($i=1; $i<=$nombreDePages; $i++)\n {\n if($i==$pageActuelle)\n {\n echo ' [ '.$i.' ] '; \n } \n else \n {\n echo '<a href=\"index.php?pageCourant=exo1&page='.$i.'\"> '.$i.' </a>';\n }\n }\necho '</p>';\n}",
"function goto($page)\n\t\t{\n\t\t\tif(!$this->hasPage($page))\n\t\t\t\tthrow new Exception(\"Page out of bounds\");\n\t\t\t\t\t\t\t\n\t\t\t$this->currentPage = $page;\n\t\t}",
"public function set_page($page) {\n $this->list_page = (int) $page;\n }",
"protected function set_page($page){\n self::$page_name = $page;\n }",
"private function page_view($page){\n\t\tif($this->session->userdata('userlogin')==\"\"){\n\t\t\tredirect(site_url().'/login');\n\t\t}\n\t\t\n\t\t$data['page'] = $page;\n\t\t$data['menuaktif'] = \"dokumen\";\n\t\treturn $data;\n\t\n\t}",
"public function setFoundPage($value) { $this->_foundpage = $value; }",
"public function setPage($page) {\n $this->page = $page;\n }",
"public function indexAction($page)\n {\n $em = $this->getDoctrine()->getEntityManager();\n $qb = $em->createQueryBuilder(); \n $total = $em->getRepository('GestionPassBundle:Fluidite')->findAll();\n /* total of résultat */\n $total_anomalies = count($total);\n $anomalies_per_page = $this->container->getParameter('max_articles_on_listepage');\n $last_page = ceil($total_anomalies / $anomalies_per_page);\n $previous_page = $page > 1 ? $page - 1 : 1;\n $next_page = $page < $last_page ? $page + 1 : $last_page; \n /* résultat à afficher*/ \n $entities = $qb ->select('a') \n ->from('GestionPassBundle:Fluidite', 'a')\n ->orderBy('a.dateReglement', 'ASC')\n ->setFirstResult(($page * $anomalies_per_page) - $anomalies_per_page)\n ->setMaxResults($this->container->getParameter('max_articles_on_listepage'))\n ->getQuery()->getResult(); \n return $this->render('GestionPassBundle:Fluidite:index.html.twig', array(\n 'entities' => $entities,\n 'last_page' => $last_page,\n 'previous_page' => $previous_page,\n 'current_page' => $page,\n 'next_page' => $next_page,\n 'total_anomalies' => $total_anomalies,\n ));\n }",
"function get_page_number() {\n if ( get_query_var('paged') ) {\n print ' | ' . __( 'Page ' , 'full-foto') . get_query_var('paged');\n }\n}",
"public function show(Page $page)\n {\n\n }",
"function get_page_number() {\n\t if ( get_query_var('paged') ) {\n\t print ' | ' . __( 'Page ' , 'deinegeestblog-theme') . get_query_var('paged');\n\t }\n\t}",
"function on_page($num_items, $per_page, $start)\n{\n\tglobal $template, $user;\n\n\t// Make sure $per_page is a valid value\n\t$per_page = ($per_page <= 0) ? 1 : $per_page;\n\n\t$on_page = floor($start / $per_page) + 1;\n\n\t$template->assign_vars(array(\n\t\t'ON_PAGE'\t\t=> $on_page)\n\t);\n\n\treturn sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1));\n}",
"public function show(Page $page)\n {\n //\n }",
"public function show(Page $page)\n {\n //\n }",
"public function show(Page $page)\n {\n //\n }",
"function quanlythanhvien($page=1,$sucess=\"\"){\n \n //--- Neu chua dang nhap thi bat dang nhap\n if($this->session->userdata('permission')!=1){\n redirect(base_url());\n exit();\n }\n //phan trang hien thi\n $bien_phanbiet='userid';\n $noibang=\"\";\n $dieukien=\"\";\n $this->default_model->updateDuLieu('thanhvien',array('viewed'=>1),array('viewed'=>0));\n $url_phantrang=base_url().'thanhvien/quanlythanhvien/';\n $bien_sapxep_hienthi='userid desc';\n $user['template']='admin/quanlythanhvien';\n $user['title']='Quản lý thành viên';\n include(APPPATH . 'includes/phantrang_admin.php');\n }",
"function current_page(){\n return isset($_GET['p']) ? (int)$_GET['p'] : 1;\n}",
"public static function setPage($page)\n {\n if(isset($page) && !empty($page)){\n self::$page = $page;\n }\n }",
"function page_func(){\n\t\t?>\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t\t<div class=\"tablenav\">\n\t\t\t\t\t\t<div class=\"tablenav-pages\">\n\t\t\t\t\t\t\t<span class=\"displaying-num\">\n\t\t\t\t\t\t\t\tDisplaying 1-20 of 69\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"page-number-current\">1</span>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">2</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">3</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">4</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">5</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">6</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t<?php \n\t\t\t}",
"function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}",
"public function Page($page){\r\n $fullpath=ucwords($page).EXT;\r\n $this->Load($fullpath);\r\n }",
"public function tvehiculos($page = 1) {\n if (Auth::is_valid()) {\n $this->page = Load::model('tvehiculos')->find();\n } else {\n Redirect::to(\"/\");\n }\n }",
"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 index($page)\n {\n // 有効なトークンでない場合はログイン画面へ\n if(!$this->isValidToken()){\n return redirect('eims/login');\n }\n\n // 要求ページ(文字列)を数値に変換\n $maxRecordByPage = 5;\n $numPage = intval($page);\n\n // アイテムの総数を取得\n $user = $this->getTokenUser();\n $recordCount = DB::table('item')\n ->where('item.owner', $user->id)\n ->where('item.deleted', 0)\n ->count();\n\n // 最大ページ数の計算\n // ・要求ページが最大ページを超えていたら、最大ページとする\n // ・要求ページがマイナス値であれば、0ページとする\n $maxPage = floor($recordCount / $maxRecordByPage);\n if( $maxPage < $numPage )\n {\n $numPage = $maxPage;\n }\n else if( $numPage < 0 )\n {\n $numPage = 0;\n }\n\n // ページングの情報を設定\n // ・現在のページ数\n // ・ページ表示のリスト\n // 表示例:\" [←][1][2][3][→] \"\n $param['currentPage'] = $numPage;\n $pageList = [];\n if($maxPage < 3)\n {\n for($i=0; $i<=$maxPage; $i++)\n {\n array_push($pageList, $i);\n }\n }\n else if($maxPage == $numPage)\n {\n $pageList = [$numPage-2, $numPage-1, $numPage];\n }\n else if(0 == $numPage)\n {\n $pageList = [$numPage, $numPage+1, $numPage+2];\n }\n else\n {\n $pageList = [$numPage-1, $numPage, $numPage+1];\n }\n $param['pageList'] = $pageList;\n \n // アイテム一覧の取得\n //$param['items'] = DB::table('item')\n $items = DB::table('item')\n ->leftJoin('category_master as category', 'item.category_id', '=', 'category.category_id')\n //->leftJoin('category_master as category', 'item.category_id', '=', 'category.category_id')\n ->where('item.owner', $user->id)\n ->where('item.deleted', 0)\n ->skip($numPage * $maxRecordByPage)\n ->take($maxRecordByPage)\n ->orderBy('item.create_datetime', 'desc')\n ->select('item.id', 'item.name', 'category.category_name', 'item.purchase_date', 'item.limit_date', 'item.deleted','item.quantity', 'category.inspect_cycle_month')\n ->get();\n\n // 警告の設定\n $param['items'] = [];\n foreach($items as $item){\n\n // 警告初期値\n $warning = '-';\n $warningType = '';\n\n // 点検チェック\n // 点検周期が設定されている、かつ、購入日から点検周期の月数が経過していること。\n if($item->inspect_cycle_month != 0 &&\n Carbon::now('Asia/Tokyo')->subMonth($item->inspect_cycle_month)->gt(new Carbon($item->purchase_date))){\n\n $inspectCt = DB::table('maintenance_history')\n ->where('id', $item->id)\n ->where('deleted', 0)\n ->where('inspect_date', '>', Carbon::now('Asia/Tokyo')->subMonth($item->inspect_cycle_month))\n ->count();\n\n if($inspectCt == 0){\n $warning = '要点検';\n $warningType = 'worning'; // bootstrap yerrow\n }\n }\n\n \\Debugbar::info(Carbon::now('Asia/Tokyo')->subMonth($item->inspect_cycle_month).' '.$item->id);\n // 期限切れチェック\n if(Carbon::now('Asia/Tokyo')->gt(new Carbon($item->limit_date))){\n $warning = '期限切れ';\n $warningType = 'error'; // bootstrap red\n }\n\n // 一覧データの設定\n $param['items'][] = [\n 'id' => $item->id,\n 'name' => $item->name,\n 'category_name' => $item->category_name,\n 'purchase_date' => $item->purchase_date,\n 'limit_date' => $item->limit_date,\n 'deleted' => $item->deleted,\n 'quantity' => $item->quantity,\n 'inspect_cycle_month' => $item->inspect_cycle_month,\n 'warning' => $warning,\n 'warningType' => $warningType\n ];\n \n\n }\n\n \\Debugbar::info($param);\n\n // レスポンス\n return response()\n ->view('list', $param)\n ->cookie('sign',$this->updateToken()->signtext,24*60);\n\n }",
"public function getCurrentPageNumber(): int;",
"function SetPage($page) {\r\n\t\t\t\r\n\t\t\tglobal $REMOTE_ADDR;\r\n\t\t\t\r\n\t\t\t$counter_start_date = $this->_Config->Get('counter_start_date');\r\n\t\t\t$counter_all = $this->_Config->Get('counter_all');\r\n\t\t\t\r\n\t\t\t// is the counter counting the first time ever?\r\n\t\t\tif($counter_start_date == '') {\r\n\t\t\t\t$counter_start_date = mktime();\r\n\t\t\t\t$this->_Config->Save('counter_start_date', $counter_start_date);\r\n\t\t\t}\r\n\t\t\tif($counter_all == '') {\r\n\t\t\t\t$counter_all = 0;\r\n\t\t\t\t$this->_Config->Save('counter_all', 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// check if the user is new on the page\r\n\t\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM \" . DB_PREFIX . \"online\r\n\t\t\t\tWHERE online_id='$this->OnlineID'\r\n\t\t\t\tLIMIT 0,1\";\r\n\t\t\t$result_new = $this->_SqlConnection->SqlQuery($sql);\r\n\t\t\tif($row3 = mysql_fetch_object($result_new)) {\r\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"online\r\n\t\t\t\t\tSET online_lastaction='\" . mktime() . \"', online_userid=$this->ID, online_lang='{$this->_Translation->OutputLanguage}', online_page='$page', online_loggedon = '\" . (($this->IsLoggedIn) ? 'yes' : 'no' ) . \"'\r\n\t\t\t\t\tWHERE online_id='$this->OnlineID'\";\r\n\t\t\t\t$this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// get the ip of the user\r\n\t\t\t\t$ip = getenv ('REMOTE_ADDR');\r\n\t\t\t\t// add the online-record for the user\r\n\t\t\t\t$sql = \"INSERT INTO \" . DB_PREFIX . \"online (online_id, online_ip, online_lastaction, online_page, online_userid, online_lang, online_host, online_loggedon)\r\n\t\t\t\tVALUES ('$this->OnlineID', '$ip', '\" . mktime() . \"', '$page', $this->ID, '{$this->_Translation->OutputLanguage}', '\" . gethostbyaddr($ip) . \"', '\" . (($this->IsLoggedIn) ? 'yes' : 'no' ) . \"')\";\r\n\t\t\t\t$this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t\t$counter_all++;\r\n\t\t\t}\r\n\r\n\t\t\t// set the new counterstatus with the count of all users who visted the site since countig\r\n\t\t\tif($counter_all != 1 && $counter_all != $this->_Config->Get('counter_all'))\r\n\t\t\t\t$this->_Config->Save('counter_all', $counter_all);\r\n\t\t\t\r\n\t\t\t// delete all enries with a last action which is more than 20 minutes passed\r\n\t\t\t$sql = \"DELETE FROM \" . DB_PREFIX . \"online\r\n\t\t\t\tWHERE online_lastaction < '\" . (mktime() - 1200) . \"'\";\r\n\t\t\t$this->_SqlConnection->SqlQuery($sql);\r\n\t\t\t\r\n\t\t}",
"function setCurrentPage($page) {\n $this->current_page = $page;\n }",
"public static function pageInfoType()\n {\n }",
"protected function page(): int\n {\n return $this->page;\n }",
"public function affichePiedPage()\r\n\t\t{\r\n\t\t//appel de la vue du pied de page\r\n\t\trequire 'Vues/piedPage.php';\r\n\t\t}",
"public function indexAction($page) {\n\n if ($page < 1) {\n throw new NotFoundHttpException('Page \"' . $page . '\" inexistante.');\n }\n\n //je fixe je nombre d'annoce par page\n $nbrAttPage = 5;\n $em = $this->getDoctrine()->getManager();\n\n $indicateurs = $em->getRepository('DciBundle:Indicateur')->allIndicateur($page, $nbrAttPage);\n\n // On calcule le nombre total de pages grâce au count($attestations) qui retourne\n // le nombre total d'annonces\n $nbrTotalPages = ceil(count($indicateurs) / $nbrAttPage);\n\n // Si la page n'existe pas, on retourne une 404\n if ($page > $nbrTotalPages) {\n throw $this->createNotFoundException(\"La page\" . $page . \" n'existe pas.\");\n }\n\n return $this->render('form_dci/indicateur/index.html.twig', array(\n 'indicateurs' => $indicateurs,\n 'page' => $page,\n 'nbrTotalPages' => $nbrTotalPages,\n ));\n }",
"function pager_find_page($element = 0) {\n $page = isset($_GET['page']) ? $_GET['page'] : '';\n $page_array = explode(',', $page);\n if (!isset($page_array[$element])) {\n $page_array[$element] = 0;\n }\n return (int) $page_array[$element];\n}",
"abstract protected function getPage() ;",
"function GetCurrentPage()\n\t{\n\t\t// when list is used from Site and not from CMS\n\t\tif ($this->m_externalParmas && is_array ( $this->m_externalParmas ))\n\t\t{\n\t\t\t// looking for page param\n\t\t\tforeach ( $this->m_externalParmas as $parma )\n\t\t\t{\n\t\t\t\t// if param start with 'page'\n\t\t\t\tif (substr ( $parma, 0, 4 ) == 'page')\n\t\t\t\t{\n\t\t\t\t\t// if afther 'page' is number\n\t\t\t\t\t$pageIndex = intval ( substr ( $parma, 4 ) );\n\t\t\t\t\tif ($pageIndex)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $pageIndex;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//From CMS\n\t\t$res = DB::REQUEST ( \"page{$this->m_linkIDName}\" );\n\t\t\n\t\tif (! $res)\n\t\t{\n\t\t\t$res = 1;\n\t\t}\n\t\treturn $res;\n\t}",
"public function is_page();",
"function index($page = '1'){\n\t//set($v);\n\trender();\n}",
"public function getPage();",
"function url($page='') {\n return $this->base_url . $page;\n }",
"function get_url($page){\r\n\t\tif(strpos($this->url,'#NUM_PAGE#')!==false){\r\n\t\t\treturn str_replace('#NUM_PAGE#',$page,$this->url);\r\n\t\t}else{\r\n\t\t\treturn $this->url.(strpos($this->url,'?')!==false ? '&' : '?').'page='.$page;\r\n\t\t}\r\n\t}",
"public function getPage(\\SetaPDF_Core_Document $document) {}",
"function get_page_number() {\n\t if ( get_query_var('paged') ) {\n\t print ' | ' . __( 'Page ' , 'hbd-theme') . get_query_var('paged');\n\t }\n\t}",
"protected function prikaz($page, $data) {\n $data['controller'] = 'Igrac';\n $data['korisnik'] = $this->session->get('igrac'); // ko je korisnik\n echo view(\"stranice/$page\", $data);\n }",
"private function setHistorique($page)\n {\n if(file_exists(ROOT . Prefix_View . $page.'.php')){\n $histo = Session::getAttributArray(\"historique\");\n if(!Session::existeAttribut('historique')) Session::setAttributArray(\"historique\",[\"prev\"=>$this->url, \"current\"=>$this->url]);\n elseif($histo[\"current\"] !== $this->url){\n $histo = Session::getAttributArray(\"historique\");\n $histo[\"prev\"] = $histo[\"current\"];\n $histo[\"current\"] = $this->url;\n Session::setAttributArray(\"historique\",$histo);\n }\n $this->historique = Session::getAttributArray('historique');\n }\n }",
"function get_page_number() {\n if ( get_query_var('paged') ) {\n print ' | ' . __( 'Page ' , 'tif-wordpress') . get_query_var('paged');\n }\n}",
"private function retrieve_page() {\n\t\t$replacement = null;\n\n\t\t$max = $this->determine_pagenumbering( 'max' );\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\t$sep = $this->retrieve_sep();\n\n\t\tif ( $max > 1 && $nr > 1 ) {\n\t\t\t/* translators: 1: current page number, 2: total number of pages. */\n\t\t\t$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'wordpress-seo' ), $nr, $max );\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getPage() {\n if (isset($_REQUEST['page'])) {\n return $_REQUEST['page'];\n } else\n return 0;\n }",
"public function translate_page($page){\n\n\t\t// check if page does not exist\n\t\tif(!file_exists($this->env_get('preset:path_pages').'/'.$page.'.php')){\n\n\t\t\t// else log error\n\t\t\te::logtrigger('Page '.h::encode_php($page).' does not exist. ('.h::encode_php($this->env_get('preset:path_pages').'/'.$page.'.php').')');\n\n\t\t\t// and set error page\n\t\t\t$page = 'error/500';\n\t\t\t}\n\n\t\t// return page\n\t\treturn $page;\n\t\t}",
"public function contenuPremierePage(){\n\t\tif(!isset($this->dataInfos['XMLPM']['PAGES']['PREMIERE'])) {\n\t\t\t$this->ajouterErreur(\"La première page n'est pas définie !\");\n\t\t\treturn;\n\t\t}\n\t\treturn $this->dataInfos['XMLPM']['PAGES']['PREMIERE'];\n\t}",
"function setOnPage($value){\n\t\t$this->on_page = $value;\n\t}",
"public function getPage() {\n if ($this->getParameter('page')) {\n return $this->getParameter('page');\n }\n\n return 1;\n }",
"function get_page_uri($page = 0)\n {\n }",
"public function display($pageName);",
"public function currentPage(){\n return $this->page;\n }"
] | [
"0.74521303",
"0.7036258",
"0.7021914",
"0.6851767",
"0.6776831",
"0.6775344",
"0.6749771",
"0.6741889",
"0.6513543",
"0.65113264",
"0.65113264",
"0.6486096",
"0.6456228",
"0.643402",
"0.6428776",
"0.6426694",
"0.64214206",
"0.6414553",
"0.63872814",
"0.6385145",
"0.6384978",
"0.63688314",
"0.63600177",
"0.63230544",
"0.6317394",
"0.6308337",
"0.6287644",
"0.62627226",
"0.62582964",
"0.62542135",
"0.6233352",
"0.62312",
"0.62253594",
"0.6211927",
"0.62111235",
"0.62111235",
"0.6198251",
"0.61885446",
"0.61744136",
"0.6173008",
"0.6158038",
"0.6149229",
"0.614705",
"0.61466354",
"0.61466354",
"0.6134476",
"0.61333793",
"0.6133111",
"0.61140436",
"0.6103327",
"0.6100375",
"0.60986453",
"0.6075744",
"0.60747355",
"0.60708505",
"0.6070267",
"0.6068334",
"0.60657597",
"0.60643655",
"0.60640895",
"0.60640895",
"0.60640895",
"0.60587835",
"0.6056952",
"0.6037552",
"0.6029164",
"0.60273486",
"0.6026735",
"0.6015722",
"0.6001854",
"0.60018486",
"0.5998552",
"0.59942883",
"0.5990383",
"0.5985622",
"0.5983508",
"0.59728354",
"0.59721893",
"0.5969863",
"0.59666175",
"0.5960715",
"0.59506536",
"0.59489584",
"0.59465533",
"0.59463316",
"0.5938154",
"0.593745",
"0.593446",
"0.5933599",
"0.5919999",
"0.5918218",
"0.59081256",
"0.59076744",
"0.5906638",
"0.5894799",
"0.5880783",
"0.5875813",
"0.5869635",
"0.585868",
"0.58555096"
] | 0.60244346 | 68 |
Informa se as restri??es definidas possuem alguma dos prefixos | public function restricoes_possuem_rotas_prefixadas() {
$routes = Configure::read('Routing.prefixes');
foreach ($this->restricoes as $restriction) {
if (in_array($restriction, $routes)) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPrefixes();",
"public function getPrefix() {}",
"abstract public function getPrefix(): string;",
"public function getPrefix();",
"public function getPrefix();",
"function rest_get_url_prefix()\n {\n }",
"function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"subjects\", \"text\" => \"texts\");\n}",
"function _prefix($prefix = 'admin') {\n\t\tif (isset($this->params['prefix']) && $this->params['prefix'] == $prefix) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function getPrefixes();",
"public function getPrefix(): string\n {\n }",
"public function getWildcardPrefixes() {}",
"abstract public function getRoutePrefix();",
"public function prefixDecl(){\n try {\n // Sparql11query.g:36:3: ( PREFIX PNAME_NS iriRef ) \n // Sparql11query.g:37:3: PREFIX PNAME_NS iriRef \n {\n $this->match($this->input,$this->getToken('PREFIX'),self::$FOLLOW_PREFIX_in_prefixDecl120); \n $this->match($this->input,$this->getToken('PNAME_NS'),self::$FOLLOW_PNAME_NS_in_prefixDecl122); \n $this->pushFollow(self::$FOLLOW_iriRef_in_prefixDecl124);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"abstract protected function getDefaultPrefix(): string;",
"function mPREFIX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$PREFIX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:101:3: ( 'prefix' ) \n // Tokenizer11.g:102:3: 'prefix' \n {\n $this->matchString(\"prefix\"); \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 eh_rota_prefixada() {\n $routes = Configure::read('Routing.prefixes');\n if (count($routes)) {\n $a = $this->controller->action;\n foreach ($routes as $route) {\n $strpos = strpos($a, $route . '_');\n if ($strpos === 0) {\n return true;\n }\n }\n }\n return false;\n }",
"public function setPrefix( $prefix );",
"public function setPrefix() {\n\t}",
"public function Get_All_Prefix()\n {\n $this->DB->Change_DB($this->PERSON_DB);\n $sql = \"SELECT `code`,`name` FROM `prefix` ORDER BY `name_full`\";\n $result = $this->DB->Query($sql);\n $this->DB->Change_DB($this->DEFAULT_DB);\n if($result)\n {\n $prefix = array();\n for($i=0;$i<count($result);$i++)\n {\n $temp['id'] = $result[$i]['code'];\n $temp['prefix'] = $result[$i]['name'];\n array_push($prefix,$temp);\n }\n return $prefix;\n }\n else\n {\n return false;\n }\n\n }",
"function startsWith($prefix) {\n $node = $this->find($prefix);\n return $node != null; // 前缀存在即可\n }",
"public function setPrefix($prefix);",
"public function test_updatePrefix()\n\t{\n\t}",
"public function getSourcePrefixes();",
"public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }",
"Public Function getPrefix() { Return $this->prefix; }",
"public function test_insertPrefix()\n\t{\n\t}",
"public function prefixKey($prefix);",
"public function testPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n\n $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes): void {\n $this->assertSame('admin:', $routes->namePrefix());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n }",
"protected function getPrefix(): string\n\t{\n\t\treturn $this->arParams['PREFIX'] !== '' ? $this->arParams['PREFIX'] : $this->getDefaultPrefix();\n\t}",
"public function listAll($prefix = '');",
"public function startsWith($prefix);",
"public function hasPrefix()\n\t{\n\t\treturn $this->prefix !== null;\n\t}",
"public static /*internal*/ function registerPrefixes()\n\t{\n\t\tif(count(self::$namespaces))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tself::$namespaces = array();\n\t\tself::$namespaces[self::xml] = 'xml';\n\t\tself::$namespaces[self::xmlns] = 'xmlms';\n\t\tself::$namespaces[self::rdf] = 'rdf';\n\t\tself::$namespaces[self::rdfs] = 'rdfs';\n\t\tself::$namespaces[self::owl] = 'owl';\n\t\tself::$namespaces[self::foaf] = 'foaf';\n\t\tself::$namespaces[self::skos] = 'skos';\n\t\tself::$namespaces[self::time] = 'time';\n\t\tself::$namespaces[self::dc] = 'dc';\n\t\tself::$namespaces[self::dcterms] = 'dct';\n\t\tself::$namespaces[self::rdfg] = 'rdfg';\n\t\tself::$namespaces[self::geo] = 'geo';\n\t\tself::$namespaces[self::frbr] = 'frbr';\n\t\tself::$namespaces[self::xhtml] = 'xhtml';\n\t\tself::$namespaces[self::xhv] = 'xhv';\n\t\tself::$namespaces[self::dcmit] = 'dcmit';\n\t\tself::$namespaces[self::xsd] = 'xsd';\n\t\tself::$namespaces[self::gn] = 'gn';\n\t\tself::$namespaces[self::exif] = 'exif';\n\t\tself::$namespaces[self::void] = 'void';\n\t\tself::$namespaces[self::olo] = 'olo';\t\t\n\t}",
"function startsWith($prefix)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }",
"function startsWith($prefix) {\n $cur = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $c = substr($prefix, $i, 1);\n if (!isset($cur->next[$c])) {\n return false;\n }\n $cur = $cur->next[$c];\n }\n return true;\n }",
"public function getCustomerPrefix();",
"public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}",
"public function getPrefix()\n {\n return '';\n }",
"public function getPrefixTitle ();",
"public function setPrefix($prefix = \"\") {\n $this->_prefix = !empty($prefix) ? $prefix : '';\n }",
"function prefix($n = null) {\n\tglobal $ns;\n\tif (is_null($n))\n\t\t$n = array_keys($ns);\n\tif (!is_array($n))\n\t\t$n = array($n);\n\t$ret = \"\";\n\tforeach ($n as $s)\n\t\t$ret .= \"PREFIX $s: <\" . $ns[$s] . \">\\n\";\n\treturn $ret;\n}",
"public function getPrefix()\n\t{\n\t\treturn (strlen($this->prefix) > 0) ? $this->prefix.'_' : '';\n\t}",
"public function getPrefix()\n {\n // TODO: Implement getPrefix() method.\n }",
"function has_prefix($string, $prefix) {\n return substr($string, 0, strlen($prefix)) == $prefix;\n }",
"protected function getPrefix()\n {\n $prefix = '';\n return $prefix;\n }",
"public function getElementPrefix();",
"protected function getIdentifierPrefix() {}",
"protected function getIdentifierPrefix() {}",
"public function testGetPrefix(): void\n {\n $alias = $this->registry->getPrefix('system');\n $this->assertEquals('asys', $alias);\n }",
"abstract protected function prefixName($name);",
"abstract protected function prefixName($name);",
"public function getAvailablePrefixes();",
"function startsWith($prefix)\n {\n $node = $this;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }",
"function get_attribute_names_with_prefix($prefix)\n {\n }",
"public static function getFilePrefix() {}",
"function pnAddressBook_admin_updateprefixes() {\r\n\r\n\t$output = new pnHTML();\r\n\r\n // Security check\r\n if (!pnSecAuthAction(0, 'pnAddressBook::', '::', ACCESS_ADMIN)) {\r\n $output->Text(pnVarPrepHTMLDisplay(_PNADDRESSBOOK_NOAUTH));\r\n $output->Text(pnAddressBook_themetable('end'));\r\n\t\treturn $output->GetOutput();\r\n }\r\n\r\n\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$pre_table = $pntable[pnaddressbook_prefixes];\r\n\t$pre_column = $pntable['pnaddressbook_prefixes_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $pre_table\r\n SET $pre_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $pre_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updatePrefixes',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $pre_table WHERE $pre_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deletePrefixes',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addPrefixes',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'prefixes',$args));\r\n\treturn true;\r\n}",
"public function testPrefixOptions(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', ['param' => 'value'], function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin', 'param' => 'value'], $routes->params());\n });\n\n $routes->prefix('CustomPath', ['path' => '/custom-path'], function (RouteBuilder $routes): void {\n $this->assertSame('/custom-path', $routes->path());\n $this->assertEquals(['prefix' => 'CustomPath'], $routes->params());\n });\n }",
"function has_prefix($string, $prefix)\n {\n return substr($string, 0, strlen($prefix)) == $prefix;\n }",
"function http_prefix($str)\n\t{\n\t\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\t*/\n\t\treturn TRUE;\n\t}",
"public function getPrefix()\n {\n return $this->prefix ?? '';\n }",
"public function testPrefixedExtraction()\n {\n $queryData = ['prefix_a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'prefix_b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'prefix_c' => 6, 'prefix_d' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals(\n ['a' => 1, 'b' => 4, 'c' => 6, 'd' => 9],\n $this->extractParameters($request, 'prefix_')\n );\n }",
"protected function _getPrefix()\n\t{\n\t\t$ret = '/';\n\n\t\tif(isset($this->_options['namespace'])) {\n\t\t\t$ret .= isset($this->_options['prefix']) ? $this->_options['prefix'] : $this->_options['namespace'];\n\t\t}\n\n\t\treturn $ret;\n\t}",
"function rest_get_url_prefix() {\n\t/**\n\t * Filter the REST URL prefix.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $prefix URL prefix. Default 'wp-json'.\n\t */\n\treturn apply_filters( 'rest_url_prefix', 'wp-json' );\n}",
"public function testPrefixOverride(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}', ['prefix' => 'Admin']);\n $routes->connect('/protected/{controller}/{action}', ['prefix' => 'Protected']);\n\n $request = new ServerRequest([\n 'url' => '/protected/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Protected',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Admin']);\n $expected = '/admin/Images/add';\n $this->assertSame($expected, $result);\n\n $request = new ServerRequest([\n 'url' => '/admin/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Admin',\n ],\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n }",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t}",
"public function testAddRouteAndCheckPrefix()\n {\n $this->collection->setPrefix('name-prefix.', '/path-prefix');\n $this->collection->get('name', '/path', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertEquals('name-prefix.name', $routes[0]->getName());\n $this->assertEquals('/path-prefix/path', $routes[0]->getSourceRoute());\n }",
"public function getPrefixes()\n\t{\n\t\treturn $this->prefixes;\n\t}",
"function startsWith($prefix)\n {\n if (empty($prefix)) {\n return false;\n }\n $endNode = $this->searchEndNode($prefix);\n return $endNode != null;\n }",
"public function getTablePrefix();",
"function mPN_PREFIX(){\n try {\n // Tokenizer11.g:568:3: ( PN_CHARS_BASE ( ( PN_CHARS | DOT )* PN_CHARS )? ) \n // Tokenizer11.g:569:3: PN_CHARS_BASE ( ( PN_CHARS | DOT )* PN_CHARS )? \n {\n $this->mPN_CHARS_BASE(); \n // Tokenizer11.g:570:3: ( ( PN_CHARS | DOT )* PN_CHARS )? \n $alt31=2;\n $LA31_0 = $this->input->LA(1);\n\n if ( (($LA31_0>=$this->getToken('45') && $LA31_0<=$this->getToken('46'))||($LA31_0>=$this->getToken('48') && $LA31_0<=$this->getToken('57'))||$LA31_0==$this->getToken('95')||($LA31_0>=$this->getToken('97') && $LA31_0<=$this->getToken('122'))||$LA31_0==$this->getToken('183')||($LA31_0>=$this->getToken('192') && $LA31_0<=$this->getToken('214'))||($LA31_0>=$this->getToken('216') && $LA31_0<=$this->getToken('246'))||($LA31_0>=$this->getToken('248') && $LA31_0<=$this->getToken('893'))||($LA31_0>=$this->getToken('895') && $LA31_0<=$this->getToken('8191'))||($LA31_0>=$this->getToken('8204') && $LA31_0<=$this->getToken('8205'))||($LA31_0>=$this->getToken('8255') && $LA31_0<=$this->getToken('8256'))||($LA31_0>=$this->getToken('8304') && $LA31_0<=$this->getToken('8591'))||($LA31_0>=$this->getToken('11264') && $LA31_0<=$this->getToken('12271'))||($LA31_0>=$this->getToken('12289') && $LA31_0<=$this->getToken('55295'))||($LA31_0>=$this->getToken('63744') && $LA31_0<=$this->getToken('64975'))||($LA31_0>=$this->getToken('65008') && $LA31_0<=$this->getToken('65533'))) ) {\n $alt31=1;\n }\n switch ($alt31) {\n case 1 :\n // Tokenizer11.g:571:5: ( PN_CHARS | DOT )* PN_CHARS \n {\n // Tokenizer11.g:571:5: ( PN_CHARS | DOT )* \n //loop30:\n do {\n $alt30=3;\n $alt30 = $this->dfa30->predict($this->input);\n switch ($alt30) {\n \tcase 1 :\n \t // Tokenizer11.g:572:7: PN_CHARS \n \t {\n \t $this->mPN_CHARS(); \n\n \t }\n \t break;\n \tcase 2 :\n \t // Tokenizer11.g:573:9: DOT \n \t {\n \t $this->mDOT(); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop30;\n }\n } while (true);\n\n $this->mPN_CHARS(); \n\n }\n break;\n\n }\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function _polylang_fix_sitemap_prefix( $prefix = '' ) {\n\t$path = parse_url( \\home_url(), PHP_URL_PATH );\n\treturn \\trailingslashit( \"$prefix$path\" );\n}",
"public static function startsWith($str, $prefix) {\n\t\treturn $prefix === '' || strpos($str, $prefix) === 0;\n\t}",
"public function getPrefix(): string\n {\n return $this->prefix;\n }",
"function isPrefix($prefix, $string){\n\t\tif(strlen($prefix) > strlen($string)){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn (substr($string, 0, strlen($prefix)) == $prefix);\n\t\t}\n\t}",
"public function getPrefixes()\n\t{\n\t\treturn $this->prefixDirs;\n\t}",
"function sql_prefix() {\n\treturn var_get('sql/prefix');\n}",
"public function setPrefix($p)\t{\n\t\t$this->prefix = $p;\n\t}",
"public function setPrefixFromDB(){\n foreach($this->getTables() as $table){\n $prefix = explode('_', $table);\n if(isset($prefix[1])){\n if($this->prefix==$prefix[0]) break;\n else $this->prefix = $prefix[0];\n }\n }\n }",
"abstract function get_cache_prefix(): string;",
"function setPrefix($str)\r\n\t{\r\n\t\t$this->url_prefix = $str;\r\n\t}",
"function prefix() {\n \n $prefix = \"/\";\n\n if(isset($_COOKIE['FolderName'])) { \n $prefix = $_COOKIE['FolderName'];\n }\n if ($prefix) {\n if (!(substr($prefix, -1) == \"/\" )) {\n $prefix = $prefix . \"/\"; \n }\n }\n return $prefix;\n}",
"public function testUrlGenerationMultiplePrefixes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $routes->prefix('backoffice', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n });\n $result = Router::url([\n 'prefix' => 'Admin/Backoffice',\n 'controller' => 'Dashboards',\n 'action' => 'home',\n ]);\n $expected = '/admin/backoffice/dashboards/home';\n $this->assertSame($expected, $result);\n }",
"public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_prefix = $prefix;\n\t\t} else {\n\t\t\t$args = func_get_args();\n\t\t\t$args = Arrays::castToType($args, 'string');\n\t\t\t$this->id_prefix = implode('.', $args);\n\t\t}\n\n\t\tif (substr($this->id_prefix, -1, 1) != '.') {\n\t\t\t$this->id_prefix .= '.';\n\t\t}\n\t}",
"public function getFormPrefix() {}",
"protected static function prefix(): string\n {\n return '';\n }",
"function get_prefix($field)\n\t{\n\t\t$str = \"Nuev\";\n\n\t\tif( $field == \"usr_email\" || $field == \"usr_name\" || $field == \"usr_cod_postal\" )\n\t\t\t$str .= \"o\";\n\t\telse\n\t\t\t$str .= \"a\";\n\n\t\treturn $str;\n\t}",
"public function prefixClassName($prefix) {\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_CLASS_SIGNATURE, function($matches) use ($prefix) {\n\t\t\treturn $matches['modifiers'] . $prefix . $matches['className'] . $matches['parents'];\n\t\t}, $this->processedClassCode);\n\t}",
"public function prefix($value);",
"function searchPrincipals($prefixPath, array $searchProperties)\n {\n return false;\n }",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n return $this->_prefix = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function setAbsRefPrefix() {}",
"protected function getFieldNamePrefix() {}",
"protected function getFieldNamePrefix() {}",
"abstract function tables_present($prefix);",
"protected function node_prefix() {\n return null;\n }",
"protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }",
"public function getRoutePrefix(){\n return $this->routePrefix;\n }",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n\n if (is_string($prefix)) {\n $prefix = $prefix;\n }\n\n return $this->_prefix = $prefix;\n }"
] | [
"0.70628846",
"0.7056692",
"0.69820374",
"0.69389015",
"0.69389015",
"0.69381607",
"0.6771489",
"0.67323786",
"0.67189294",
"0.66852945",
"0.664125",
"0.65949154",
"0.65881336",
"0.6540308",
"0.65234166",
"0.6521488",
"0.6470314",
"0.64640635",
"0.6428032",
"0.64152956",
"0.6335758",
"0.6306298",
"0.6241235",
"0.6220953",
"0.6209349",
"0.618987",
"0.61509037",
"0.6147616",
"0.61474717",
"0.6110114",
"0.60973036",
"0.60225767",
"0.60079676",
"0.6003151",
"0.5992036",
"0.59703046",
"0.5959493",
"0.5955307",
"0.5949627",
"0.5942841",
"0.59423035",
"0.5927378",
"0.5926764",
"0.5919988",
"0.59174204",
"0.59149337",
"0.59125954",
"0.59125954",
"0.59064573",
"0.5893032",
"0.5893032",
"0.5891935",
"0.5885154",
"0.58695877",
"0.5850113",
"0.584722",
"0.5846124",
"0.5834565",
"0.5825495",
"0.5814472",
"0.5789151",
"0.57872814",
"0.5777781",
"0.5774679",
"0.57620966",
"0.5749073",
"0.5747421",
"0.57468325",
"0.57407737",
"0.5730977",
"0.5718452",
"0.5715443",
"0.5709744",
"0.5704839",
"0.5700453",
"0.56980395",
"0.56935096",
"0.5690478",
"0.56850964",
"0.5680478",
"0.5679098",
"0.56621575",
"0.5660264",
"0.56568",
"0.56518316",
"0.56493604",
"0.56415904",
"0.56411976",
"0.56264025",
"0.56227255",
"0.56183815",
"0.56183815",
"0.56098557",
"0.5608061",
"0.5608061",
"0.5591247",
"0.55853987",
"0.5582352",
"0.55804825",
"0.55793774"
] | 0.7110509 | 0 |
Verifica se a a??o atual possui alguns dos prefixos configurados | public function eh_rota_prefixada() {
$routes = Configure::read('Routing.prefixes');
if (count($routes)) {
$a = $this->controller->action;
foreach ($routes as $route) {
$strpos = strpos($a, $route . '_');
if ($strpos === 0) {
return true;
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _prefix($prefix = 'admin') {\n\t\tif (isset($this->params['prefix']) && $this->params['prefix'] == $prefix) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function hasPrefix()\n\t{\n\t\treturn $this->prefix !== null;\n\t}",
"public function testGetPrefix(): void\n {\n $alias = $this->registry->getPrefix('system');\n $this->assertEquals('asys', $alias);\n }",
"public function is_index_name_prefix_in_config() {\n\t\treturn defined( 'ALGOLIA_INDEX_NAME_PREFIX' );\n\t}",
"public function restricoes_possuem_rotas_prefixadas() {\n $routes = Configure::read('Routing.prefixes');\n foreach ($this->restricoes as $restriction) {\n if (in_array($restriction, $routes)) {\n return true;\n }\n }\n return false;\n }",
"public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }",
"public function test_updatePrefix()\n\t{\n\t}",
"protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }",
"public function testPrefixOptions(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', ['param' => 'value'], function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin', 'param' => 'value'], $routes->params());\n });\n\n $routes->prefix('CustomPath', ['path' => '/custom-path'], function (RouteBuilder $routes): void {\n $this->assertSame('/custom-path', $routes->path());\n $this->assertEquals(['prefix' => 'CustomPath'], $routes->params());\n });\n }",
"public function setPrefix() {\n\t}",
"abstract protected function getDefaultPrefix(): string;",
"public static function hasSettings($prefix)\n {\n if (defined('HHVM_VERSION') && in_array($prefix, array(self::PDO_PGSQL, self::MYSQLI))) {\n return false;\n }\n\n $settings = static::retrieveSettings($prefix);\n\n return !empty($settings);\n }",
"private function checkRoutingPrefixIsNotAlreadyRegistered()\n {\n // the route collection. The following code relies on possible modifications of\n // the RouteCollection class in the Routing component. To be uncommented if those\n // changes are accepted.\n /*\n $registeredPrefixes = $this->router->getRouteCollection()->getPrefixes();\n $pluginPrefix = $this->plugin->getRoutingPrefix();\n\n if (in_array($pluginPrefix, $registeredPrefixes)) {\n $resources = (array) $this->yamlParser->parse(file_get_contents($this->mainPluginRoutingFile));\n $isConflictingWithPluginPrefix = false;\n\n foreach ($resources as $bundleKey => $resource) {\n if ('/' . $resource['prefix'] === $pluginPrefix) {\n $isConflictingWithPluginPrefix = true;\n\n if (0 !== strpos($bundleKey, $this->plugin->getName())) {\n $this->errors[] = new ValidationError(\n \"{$this->pluginFqcn} : routing prefix '{$pluginPrefix}' \"\n . \"is already registered by another plugin.\",\n self::ALREADY_REGISTERED_PREFIX\n );\n break;\n }\n }\n }\n\n if (!$isConflictingWithPluginPrefix) {\n $this->errors[] = new ValidationError(\n \"{$this->pluginFqcn} : routing prefix '{$pluginPrefix}' is already \"\n . \"registered by the core routing.\",\n self::ALREADY_REGISTERED_PREFIX\n );\n }\n }\n */\n }",
"public function testPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n\n $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes): void {\n $this->assertSame('admin:', $routes->namePrefix());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n }",
"public function getPrefix() {}",
"function startsWith($prefix) {\n $node = $this->find($prefix);\n return $node != null; // 前缀存在即可\n }",
"public function tablePrefix() {\n\t\t$prefix = $this->in('What table prefix would you like to use?');\n\n\t\tif (!$prefix) {\n\t\t\t$this->out('Please provide a table prefix, I recommend \"forum\".');\n\n\t\t\treturn $this->tablePrefix();\n\n\t\t} else {\n\t\t\t$prefix = trim($prefix, '_') . '_';\n\t\t\t$this->out(sprintf('You have chosen the prefix: %s', $prefix));\n\t\t}\n\n\t\t$answer = strtoupper($this->in('Is this correct?', array('Y', 'N')));\n\n\t\tif ($answer === 'Y') {\n\t\t\t$this->install['prefix'] = $prefix;\n\t\t} else {\n\t\t\treturn $this->tablePrefix();\n\t\t}\n\n\t\treturn true;\n\t}",
"abstract function getPluginSettingsPrefix();",
"public function setPrefix( $prefix );",
"public function valid_db_prefix($db_prefix)\n\t{\n\t\t// DB Prefix has some character restrictions\n\t\tif ( ! preg_match(\"/^[0-9a-zA-Z\\$_]*$/\", $db_prefix))\n\t\t{\n\t\t\tee()->form_validation->set_message(\n\t\t\t\t'valid_db_prefix',\n\t\t\t\tlang('database_prefix_invalid_characters')\n\t\t\t);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// The DB Prefix should not include \"exp_\"\n\t\tif ( strpos($db_prefix, 'exp_') !== FALSE)\n\t\t{\n\t\t\tee()->form_validation->set_message(\n\t\t\t\t'valid_db_prefix',\n\t\t\t\tlang('database_prefix_contains_exp_')\n\t\t\t);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"function tck_get_prefix($mode) {\n if ( $mode == 0 ) {\n $option = 'tck_random_prefix';\n } else if ( $mode == 1 ) {\n $option = 'tck_custom_prefix';\n }\n\n if ( yourls_get_option($option) !== false ) {\n $prefix = yourls_get_option($option);\n } else {\n if ( $mode == 0 ) {\n $prefix = TCK_DEFAULT_RANDOM_PREFIX;\n } else if ( $mode == 1 ) {\n $prefix = TCK_DEFAULT_CUSTOM_PREFIX;\n }\n \n yourls_add_option($option, $prefix);\n }\n \n return $prefix;\n }",
"public function hasMap($prefix)\n\t{\n\t\treturn isset($this->prefixDirs[$prefix]);\n\t}",
"public function test_insertPrefix()\n\t{\n\t}",
"public function testPrefixOverride(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}', ['prefix' => 'Admin']);\n $routes->connect('/protected/{controller}/{action}', ['prefix' => 'Protected']);\n\n $request = new ServerRequest([\n 'url' => '/protected/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Protected',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Admin']);\n $expected = '/admin/Images/add';\n $this->assertSame($expected, $result);\n\n $request = new ServerRequest([\n 'url' => '/admin/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Admin',\n ],\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n }",
"private function setStagingPrefix()\n {\n // Get & find a new prefix that does not already exist in database.\n // Loop through up to 1000 different possible prefixes should be enough here;)\n for ($i = 0; $i <= 10000; $i++) {\n $this->options->prefix = isset($this->options->existingClones) ?\n 'wpstg' . (count($this->options->existingClones) + $i) . '_' :\n 'wpstg' . $i . '_';\n\n $sql = \"SHOW TABLE STATUS LIKE '{$this->options->prefix}%'\";\n $tables = $this->db->get_results($sql);\n\n // Prefix does not exist. We can use it\n if (!$tables) {\n return $this->options->prefix;\n }\n }\n $this->returnException(\"Fatal Error: Can not create staging prefix. '{$this->options->prefix}' already exists! Stopping for security reasons. Contact [email protected]\");\n wp_die(\"Fatal Error: Can not create staging prefix. Prefix '{$this->options->prefix}' already exists! Stopping for security reasons. Contact [email protected]\");\n }",
"public function setPrefix($prefix);",
"public function setPrefix($prefix = \"\") {\n $this->_prefix = !empty($prefix) ? $prefix : '';\n }",
"public function testUrlGenerationMultiplePrefixes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $routes->prefix('backoffice', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n });\n $result = Router::url([\n 'prefix' => 'Admin/Backoffice',\n 'controller' => 'Dashboards',\n 'action' => 'home',\n ]);\n $expected = '/admin/backoffice/dashboards/home';\n $this->assertSame($expected, $result);\n }",
"function rest_get_url_prefix()\n {\n }",
"function getPrefixes();",
"public function getPrefix();",
"public function getPrefix();",
"function has_prefix($string, $prefix)\n {\n return substr($string, 0, strlen($prefix)) == $prefix;\n }",
"protected function getPrefix(): string\n\t{\n\t\treturn $this->arParams['PREFIX'] !== '' ? $this->arParams['PREFIX'] : $this->getDefaultPrefix();\n\t}",
"public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}",
"abstract public function getPrefix(): string;",
"public function getPrefix(): string\n {\n }",
"abstract function tables_present($prefix);",
"function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"subjects\", \"text\" => \"texts\");\n}",
"function has_prefix($string, $prefix) {\n return substr($string, 0, strlen($prefix)) == $prefix;\n }",
"function isPrefix($prefix, $string){\n\t\tif(strlen($prefix) > strlen($string)){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn (substr($string, 0, strlen($prefix)) == $prefix);\n\t\t}\n\t}",
"public function setPrefixFromDB(){\n foreach($this->getTables() as $table){\n $prefix = explode('_', $table);\n if(isset($prefix[1])){\n if($this->prefix==$prefix[0]) break;\n else $this->prefix = $prefix[0];\n }\n }\n }",
"function mPREFIX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$PREFIX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:101:3: ( 'prefix' ) \n // Tokenizer11.g:102:3: 'prefix' \n {\n $this->matchString(\"prefix\"); \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 static /*internal*/ function registerPrefixes()\n\t{\n\t\tif(count(self::$namespaces))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tself::$namespaces = array();\n\t\tself::$namespaces[self::xml] = 'xml';\n\t\tself::$namespaces[self::xmlns] = 'xmlms';\n\t\tself::$namespaces[self::rdf] = 'rdf';\n\t\tself::$namespaces[self::rdfs] = 'rdfs';\n\t\tself::$namespaces[self::owl] = 'owl';\n\t\tself::$namespaces[self::foaf] = 'foaf';\n\t\tself::$namespaces[self::skos] = 'skos';\n\t\tself::$namespaces[self::time] = 'time';\n\t\tself::$namespaces[self::dc] = 'dc';\n\t\tself::$namespaces[self::dcterms] = 'dct';\n\t\tself::$namespaces[self::rdfg] = 'rdfg';\n\t\tself::$namespaces[self::geo] = 'geo';\n\t\tself::$namespaces[self::frbr] = 'frbr';\n\t\tself::$namespaces[self::xhtml] = 'xhtml';\n\t\tself::$namespaces[self::xhv] = 'xhv';\n\t\tself::$namespaces[self::dcmit] = 'dcmit';\n\t\tself::$namespaces[self::xsd] = 'xsd';\n\t\tself::$namespaces[self::gn] = 'gn';\n\t\tself::$namespaces[self::exif] = 'exif';\n\t\tself::$namespaces[self::void] = 'void';\n\t\tself::$namespaces[self::olo] = 'olo';\t\t\n\t}",
"public function prefixKey($prefix);",
"public function getAvailablePrefixes();",
"function domain_is(string $prefix): bool\n {\n $domain = get_domain();\n\n return starts_with($prefix.'.', $domain);\n }",
"public function Get_All_Prefix()\n {\n $this->DB->Change_DB($this->PERSON_DB);\n $sql = \"SELECT `code`,`name` FROM `prefix` ORDER BY `name_full`\";\n $result = $this->DB->Query($sql);\n $this->DB->Change_DB($this->DEFAULT_DB);\n if($result)\n {\n $prefix = array();\n for($i=0;$i<count($result);$i++)\n {\n $temp['id'] = $result[$i]['code'];\n $temp['prefix'] = $result[$i]['name'];\n array_push($prefix,$temp);\n }\n return $prefix;\n }\n else\n {\n return false;\n }\n\n }",
"private function _ignoreRoleAccess($prefix){\n if($prefix){\n $commonApis = [\n 'api' => [\n 'Users' => ['addPhone'],\n 'UserDeviceTokens' => ['add','edit'],\n 'SpecializationServices' => ['index'],\n 'ExpertSpecializationServices' => ['view']\n ],\n 'api/user' => [\n 'AppointmentBookings' => ['index','view'],\n 'AppointmentReviews' => ['add'],\n 'Users' => ['addCard','deleteCard','listCards','viewCard']\n ]\n ];\n return !$this->_checkUnAuthorized($commonApis[$prefix]);\n }\n }",
"public static function prefixExist(string $fieldName): bool\n\t{\n\t\treturn !empty(array_filter(array_column(static::getValues($fieldName), 'prefix')));\n\t}",
"protected function _getPrefix()\n\t{\n\t\t$ret = '/';\n\n\t\tif(isset($this->_options['namespace'])) {\n\t\t\t$ret .= isset($this->_options['prefix']) ? $this->_options['prefix'] : $this->_options['namespace'];\n\t\t}\n\n\t\treturn $ret;\n\t}",
"function startsWith($prefix)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }",
"protected function initCtrlHasAbsNamespace () {\n\t\tif (mb_strpos($this->controller, '//') === 0)\n\t\t\t$this->flags |= static::FLAG_CONTROLLER_ABSOLUTE_NAMESPACE;\n\t}",
"protected function getDefaultPrefix($suffix = NULL) {\n $ret = NULL;\n\n if ($test_prefix = drupal_valid_test_ua()) {\n $ret = $test_prefix;\n }\n else {\n $prefixes = Settings::get('cache_prefix', '');\n\n if (is_string($prefixes)) {\n // Variable can be a string which then considered as a default\n // behavior.\n $ret = $prefixes;\n }\n else if (NULL !== $suffix && isset($prefixes[$suffix])) {\n if (FALSE !== $prefixes[$suffix]) {\n // If entry is set and not false an explicit prefix is set\n // for the bin.\n $ret = $prefixes[$suffix];\n }\n else {\n // If we have an explicit false it means no prefix whatever\n // is the default configuration.\n $ret = '';\n }\n }\n else {\n // Key is not set, we can safely rely on default behavior.\n if (isset($prefixes['default']) && FALSE !== $prefixes['default']) {\n $ret = $prefixes['default'];\n }\n else {\n // When default is not set or an explicit false this means\n // no prefix.\n $ret = '';\n }\n }\n }\n\n if (empty($ret)) {\n // If no prefix is given, use the same logic as core for APCu caching.\n $ret = Settings::getApcuPrefix('redis', DRUPAL_ROOT);\n }\n\n return $ret;\n }",
"public function checkDatabaseTablePrefix($prefix)\n {\n //The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_);\n // the first character should be a letter.\n if ($prefix !== '' && !preg_match('/^([a-zA-Z])([[:alnum:]_]+)$/', $prefix)) {\n throw new \\InvalidArgumentException(\n 'Please correct the table prefix format, should contain only numbers, letters or underscores.'\n .' The first character should be a letter.'\n );\n }\n\n if (strlen($prefix) > self::DB_PREFIX_LENGTH) {\n throw new \\InvalidArgumentException(\n 'Table prefix length can\\'t be more than ' . self::DB_PREFIX_LENGTH . ' characters.'\n );\n }\n\n return true;\n }",
"function prefix() {\n \n $prefix = \"/\";\n\n if(isset($_COOKIE['FolderName'])) { \n $prefix = $_COOKIE['FolderName'];\n }\n if ($prefix) {\n if (!(substr($prefix, -1) == \"/\" )) {\n $prefix = $prefix . \"/\"; \n }\n }\n return $prefix;\n}",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t}",
"Public Function getPrefix() { Return $this->prefix; }",
"public function hasOption($name, $prefix = '')\n\t{\n\t\treturn array_key_exists($prefix . $name, $this->_options);\n\t}",
"public function getPrefixes();",
"public function setPrefix($prefix)\n {\n $this->prefix = !empty($prefix) ? $prefix . ':' : '';\n }",
"function validate2(){\n\t\tif(strlen($this->code) != $this->BARCODE_LENGTH)\n\t\t{\n\t\t\t//echo 'Strlen('.strlen($this->code).')';\n\t\t\t$this->error = 'Barcode <strong>'.$this->code.'</strong> must be of length: '.$this->BARCODE_LENGTH;\n\t\t\treturn false;\n\t\t}\n\t\t$pos = strpos($this->code, $this->PREFIX);\n\t\t\n\t\tif ($pos === false) {\n\t\t $this->error = 'The prefix <strong>'.$this->PREFIX.'</strong> was not found in the barcode <strong>'.$this->code.'</strong>';\n\t\t return false;\n\t\t} \n\t\t\n\t\tif ($pos !== 0) {\n\t\t $this->error = 'The prefix of <strong>'.$this->code.'</strong> is not valid';\n\t\t return false;\n\t\t}\n\t\treturn true;\n\t}",
"function startsWith($prefix) {\n $cur = $this->root;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $c = substr($prefix, $i, 1);\n if (!isset($cur->next[$c])) {\n return false;\n }\n $cur = $cur->next[$c];\n }\n return true;\n }",
"function startsWith($prefix)\n {\n if (empty($prefix)) {\n return false;\n }\n $endNode = $this->searchEndNode($prefix);\n return $endNode != null;\n }",
"public function getShouldPrefixNameToFile()\n {\n if (array_key_exists(\"shouldPrefixNameToFile\", $this->_propDict)) {\n return $this->_propDict[\"shouldPrefixNameToFile\"];\n } else {\n return null;\n }\n }",
"abstract public function getRoutePrefix();",
"protected function isPrefix($word): bool\n {\n return (array_key_exists($this->getKey($word), $this->prefixes));\n }",
"public function testAddRouteAndCheckPrefix()\n {\n $this->collection->setPrefix('name-prefix.', '/path-prefix');\n $this->collection->get('name', '/path', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertEquals('name-prefix.name', $routes[0]->getName());\n $this->assertEquals('/path-prefix/path', $routes[0]->getSourceRoute());\n }",
"public function getPrefix(): string\n {\n return config('linky.db.prefix');\n }",
"public static function startsWith($str, $prefix) {\n\t\treturn $prefix === '' || strpos($str, $prefix) === 0;\n\t}",
"public function getPrefix()\n\t{\n\t\treturn $this->royalcms['config']['cache.prefix'];\n\t}",
"public function testPrefixIfNotExists()\n {\n $str = new Str($this->testString);\n $str2 = $str->prefix('the ', true);\n $this->assertTrue($str2->value === 'the ' . $this->testString);\n }",
"private function tag_matches_prefix($v)\n {\n return preg_match(\"/{$this->instance['prefix']}/\", $v->name)\n ? true\n : false\n ;\n }",
"public function set_dbprefix($prefix = '')\n\t{\n\t\treturn $this->dbprefix = $prefix;\n\t}",
"public function testUrlGenerationWithAutoPrefixes(): void\n {\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/protected/{controller}/{action}/*', ['prefix' => 'Protected']);\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n $routes->connect('/{controller}/{action}/*');\n\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n 'prefix' => null, 'protected' => false, 'url' => ['url' => 'images/index'],\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add']);\n $expected = '/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add_protected_test', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add_protected_test';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1]);\n $expected = '/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'protectedEdit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/protectedEdit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Images/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Others', 'action' => 'edit', 1]);\n $expected = '/Others/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Others', 'action' => 'edit', 1, 'prefix' => 'Protected']);\n $expected = '/protected/Others/edit/1';\n $this->assertSame($expected, $result);\n }",
"public function testUrlWritingWithPrefixes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/company/{controller}/{action}/*', ['prefix' => 'Company']);\n $routes->connect('/{action}', ['controller' => 'Users']);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login', 'prefix' => 'Company']);\n $expected = '/company/Users/login';\n $this->assertSame($expected, $result);\n\n $request = new ServerRequest([\n 'url' => '/',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Users',\n 'action' => 'login',\n 'prefix' => 'Company',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login', 'prefix' => false]);\n $expected = '/login';\n $this->assertSame($expected, $result);\n }",
"public function testPrefixRoutePersistence(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/protected/{controller}/{action}', ['prefix' => 'Protected']);\n $routes->connect('/{controller}/{action}');\n\n $request = new ServerRequest([\n 'url' => '/protected/images/index',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Images',\n 'action' => 'index',\n 'prefix' => 'Protected',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['prefix' => 'Protected', 'controller' => 'Images', 'action' => 'add']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => false]);\n $expected = '/Images/add';\n $this->assertSame($expected, $result);\n }",
"public function testUrlGenerationWithPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);\n $routes->connect('/reset/*', ['admin' => true, 'controller' => 'Users', 'action' => 'reset']);\n $routes->connect('/tests', ['controller' => 'Tests', 'action' => 'index']);\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n Router::extensions('rss', false);\n\n $request = new ServerRequest([\n 'params' => [\n 'controller' => 'Registrations',\n 'action' => 'index',\n 'plugin' => null,\n 'prefix' => 'Admin',\n '_ext' => 'html',\n ],\n 'url' => '/admin/registrations/index',\n ]);\n Router::setRequest($request);\n\n $result = Router::url([]);\n $expected = '/admin/registrations/index';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/subscriptions/{action}/*', ['controller' => 'Subscribe', 'prefix' => 'Admin']);\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n\n $request = new ServerRequest([\n 'params' => [\n 'action' => 'index',\n 'plugin' => null,\n 'controller' => 'Subscribe',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/magazine/',\n 'base' => '/magazine',\n 'url' => '/admin/subscriptions/edit/1',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['action' => 'edit', 1]);\n $expected = '/magazine/admin/subscriptions/edit/1';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['prefix' => 'Admin', 'controller' => 'Users', 'action' => 'login']);\n $expected = '/magazine/admin/Users/login';\n $this->assertSame($expected, $result);\n\n Router::reload();\n\n $request = new ServerRequest([\n 'params' => [\n 'prefix' => 'Admin',\n 'action' => 'index',\n 'plugin' => null,\n 'controller' => 'Users',\n ],\n 'webroot' => '/',\n 'url' => '/admin/users/index',\n ]);\n Router::setRequest($request);\n\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/page/*', ['controller' => 'Pages', 'action' => 'view', 'prefix' => 'Admin']);\n\n $result = Router::url(['prefix' => 'Admin', 'controller' => 'Pages', 'action' => 'view', 'my-page']);\n $expected = '/page/my-page';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Pages',\n 'action' => 'add',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/',\n 'url' => '/admin/pages/add',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['plugin' => null, 'controller' => 'Pages', 'action' => 'add', 'id' => false]);\n $expected = '/admin/Pages/add';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Pages',\n 'action' => 'add',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/',\n 'url' => '/admin/pages/add',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['plugin' => null, 'controller' => 'Pages', 'action' => 'add', 'id' => false]);\n $expected = '/admin/Pages/add';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}/{id}', ['prefix' => 'Admin'], ['id' => '[0-9]+']);\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Pages',\n 'action' => 'edit',\n 'pass' => ['284'],\n 'prefix' => 'Admin',\n ],\n 'url' => '/admin/pages/edit/284',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['plugin' => null, 'controller' => 'Pages', 'action' => 'edit', 'id' => '284']);\n $expected = '/admin/Pages/edit/284';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null, 'controller' => 'Pages', 'action' => 'add', 'prefix' => 'Admin',\n ],\n 'url' => '/admin/pages/add',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['plugin' => null, 'controller' => 'Pages', 'action' => 'add', 'id' => false]);\n $expected = '/admin/Pages/add';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}/*', ['prefix' => 'Admin']);\n\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null, 'controller' => 'Pages', 'action' => 'edit', 'prefix' => 'Admin',\n ],\n 'url' => '/admin/pages/edit/284',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['plugin' => null, 'controller' => 'Pages', 'action' => 'edit', 284]);\n $expected = '/admin/Pages/edit/284';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/posts/*', ['controller' => 'Posts', 'action' => 'index', 'prefix' => 'Admin']);\n $request = new ServerRequest([\n 'params' => [\n 'plugin' => null, 'controller' => 'Posts', 'action' => 'index', 'prefix' => 'Admin',\n 'pass' => ['284'],\n ],\n 'url' => '/admin/pages/edit/284',\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['all']);\n $expected = '/admin/posts/all';\n $this->assertSame($expected, $result);\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function hasBip9Prefix(): bool;",
"public function getPrefixes()\n\t{\n\t\treturn $this->prefixDirs;\n\t}",
"public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }",
"public function configuration_validation($data, $files, array $errors) {\n if (empty($errors['prefix'])) {\n $factory = cache_factory::instance();\n $config = $factory->create_config_instance();\n foreach ($config->get_all_stores() as $store) {\n if ($store['plugin'] === 'apcu') {\n if (isset($store['configuration']['prefix'])) {\n if ($data['prefix'] === $store['configuration']['prefix']) {\n // The new store has the same prefix as an existing store, thats a problem.\n $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');\n break;\n }\n } else if (empty($data['prefix'])) {\n // The existing store hasn't got a prefix and neither does the new store, that's a problem.\n $errors['prefix'] = get_string('prefixnotunique', 'cachestore_apcu');\n break;\n }\n }\n }\n }\n return $errors;\n }",
"function prefixSign()\r\n {\r\n if ( $this->PrefixSign == 1 )\r\n return true;\r\n else\r\n return false;\r\n }",
"function setPrefix($str)\r\n\t{\r\n\t\t$this->url_prefix = $str;\r\n\t}",
"public static function getTablePrefix()\n {\n }",
"function startsWith($prefix)\n {\n $node = $this;\n for ($i = 0; $i < strlen($prefix); $i++) {\n $index = ord($prefix[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return true;\n }",
"function isOurs($fn) {\n\tglobal $baecodes;\n\tif (is_numeric($fn[2])) {\n\t\t$prefix = substr($fn,0,2);\n\t} else {\n\t\t$prefix = substr($fn,0,3);\n\t}\n\treturn array_key_exists($prefix, $baecodes);\n}",
"public function getPrefixFallbacks()\n\t{\n\t\treturn $this->prefixFallbacks;\n\t}",
"public function GetPrefix() {\n\n return $this->\n config['prefix'];\n }",
"public function getPrefixNeedsEncoding()\n\t{\n\t\treturn $this->prefixNeedsEncoding;\n\t}",
"public function setPrefix($p)\t{\n\t\t$this->prefix = $p;\n\t}",
"function searchPrincipals($prefixPath, array $searchProperties)\n {\n return false;\n }",
"function getPluginSettingsPrefix() {\n\t\treturn 'doaj';\n\t}",
"private function fix_namespace_settings($user)\n {\n $prefix = $this->storage->get_namespace('prefix');\n $prefix_len = strlen($prefix);\n\n if (!$prefix_len)\n return;\n\n $prefs = $this->config->all();\n if (!empty($prefs['namespace_fixed']))\n return;\n\n // Build namespace prefix regexp\n $ns = $this->storage->get_namespace();\n $regexp = array();\n\n foreach ($ns as $entry) {\n if (!empty($entry)) {\n foreach ($entry as $item) {\n if (strlen($item[0])) {\n $regexp[] = preg_quote($item[0], '/');\n }\n }\n }\n }\n $regexp = '/^('. implode('|', $regexp).')/';\n\n // Fix preferences\n $opts = array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox', 'archive_mbox');\n foreach ($opts as $opt) {\n if ($value = $prefs[$opt]) {\n if ($value != 'INBOX' && !preg_match($regexp, $value)) {\n $prefs[$opt] = $prefix.$value;\n }\n }\n }\n\n if (!empty($prefs['default_folders'])) {\n foreach ($prefs['default_folders'] as $idx => $name) {\n if ($name != 'INBOX' && !preg_match($regexp, $name)) {\n $prefs['default_folders'][$idx] = $prefix.$name;\n }\n }\n }\n\n if (!empty($prefs['search_mods'])) {\n $folders = array();\n foreach ($prefs['search_mods'] as $idx => $value) {\n if ($idx != 'INBOX' && $idx != '*' && !preg_match($regexp, $idx)) {\n $idx = $prefix.$idx;\n }\n $folders[$idx] = $value;\n }\n $prefs['search_mods'] = $folders;\n }\n\n if (!empty($prefs['message_threading'])) {\n $folders = array();\n foreach ($prefs['message_threading'] as $idx => $value) {\n if ($idx != 'INBOX' && !preg_match($regexp, $idx)) {\n $idx = $prefix.$idx;\n }\n $folders[$prefix.$idx] = $value;\n }\n $prefs['message_threading'] = $folders;\n }\n\n if (!empty($prefs['collapsed_folders'])) {\n $folders = explode('&&', $prefs['collapsed_folders']);\n $count = count($folders);\n $folders_str = '';\n\n if ($count) {\n $folders[0] = substr($folders[0], 1);\n $folders[$count-1] = substr($folders[$count-1], 0, -1);\n }\n\n foreach ($folders as $value) {\n if ($value != 'INBOX' && !preg_match($regexp, $value)) {\n $value = $prefix.$value;\n }\n $folders_str .= '&'.$value.'&';\n }\n $prefs['collapsed_folders'] = $folders_str;\n }\n\n $prefs['namespace_fixed'] = true;\n\n // save updated preferences and reset imap settings (default folders)\n $user->save_prefs($prefs);\n $this->set_storage_prop();\n }",
"public function clearByPrefix(string $prefix): bool;",
"function sql_prefix() {\n\treturn var_get('sql/prefix');\n}",
"function ajan_core_get_table_prefix() {\n\tglobal $wpdb;\n\n\treturn apply_filters( 'ajan_core_get_table_prefix', $wpdb->base_prefix );\n}"
] | [
"0.7624216",
"0.68902284",
"0.6775881",
"0.657002",
"0.6561076",
"0.6547678",
"0.6493175",
"0.6419347",
"0.635548",
"0.63531095",
"0.63486814",
"0.6325512",
"0.62164026",
"0.62093496",
"0.6204222",
"0.6151084",
"0.6125214",
"0.6122928",
"0.6119998",
"0.60728985",
"0.60599166",
"0.60570806",
"0.60383207",
"0.60372454",
"0.6030318",
"0.5994444",
"0.59465",
"0.59444666",
"0.59410584",
"0.59097546",
"0.587745",
"0.587745",
"0.583822",
"0.5837279",
"0.583512",
"0.58327717",
"0.58148295",
"0.58044267",
"0.58029914",
"0.57847095",
"0.5784084",
"0.57366717",
"0.5736179",
"0.57093656",
"0.57062644",
"0.56998825",
"0.56894857",
"0.5676652",
"0.56406623",
"0.56332964",
"0.56267387",
"0.5620315",
"0.5609051",
"0.5597004",
"0.55938184",
"0.5591652",
"0.5586744",
"0.5584611",
"0.55776393",
"0.5572136",
"0.5561521",
"0.5552919",
"0.5550922",
"0.5550185",
"0.55384487",
"0.55268925",
"0.552367",
"0.550828",
"0.5492422",
"0.5491006",
"0.54832214",
"0.54754496",
"0.54722106",
"0.5460588",
"0.54589933",
"0.5458256",
"0.54561186",
"0.54479796",
"0.5447948",
"0.5447948",
"0.5439231",
"0.54371184",
"0.5435151",
"0.5435151",
"0.54169834",
"0.5410395",
"0.5404871",
"0.5398077",
"0.5391415",
"0.5389381",
"0.53865975",
"0.53859705",
"0.5384127",
"0.5378983",
"0.53782916",
"0.53643167",
"0.5364218",
"0.5359455",
"0.5348815",
"0.53478116"
] | 0.6863991 | 2 |
Create or retrieve a service instance based on requested type | public static function getServiceLayer($type, $mode = '')
{
$type = $type . $mode;
if (!isset(self::$services[$type])) {
throw new ServiceNotFoundException('Service of type "' . $type . '" not found');
} elseif (is_callable(self::$services[$type])) {
$service = self::$services[$type];
self::$services[$type] = $service();
}
return self::$services[$type];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function getServiceInstance()\n {\n $s = self::getServiceType();\n switch ($s) {\n case 0:\n http_response_code(404);\n exit();\n case 1:\n return new RCFaxClient();\n break;\n case 2:\n return new TwilioFaxClient();\n }\n }",
"public function createService($serviceClass);",
"final public function getService($type)\n\t{\n\t\treturn $this->getServiceLocator()->getService($type);\n\t}",
"public function getService(string $type, string $name = ''): ?Service\n {\n $services = $this->services[$type] ?? [];\n\n if (empty($services)) {\n return null;\n }\n\n if ($name !== '') {\n return $services[$name] ?? null;\n }\n\n return reset($services);\n }",
"public function make($type)\n {\n if ($instance = array_get($this->resolved, $type)) {\n return $instance;\n }\n\n return $this->build($type);\n }",
"public function make($type);",
"private function instantiate_service( $class ) {\n\t\tif ( ! class_exists( $class ) ) {\n\t\t\tthrow Exception\\InvalidService::from_service( $class );\n\t\t}\n\n\t\t$service = new $class();\n\n\t\tif ( ! $service instanceof Service ) {\n\t\t\tthrow Exception\\InvalidService::from_service( $service );\n\t\t}\n\n\t\tif ( $service instanceof AssetsAware ) {\n\t\t\t$service->with_assets_handler( $this->assets_handler );\n\t\t}\n\n\t\treturn $service;\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 instantiate_service( $class_name ): Service {\n\t\t/*\n\t\t * If the service is not registerable, we default to lazily instantiated\n\t\t * services here for some basic optimization.\n\t\t *\n\t\t * The services will be properly instantiated once they are retrieved\n\t\t * from the service container.\n\t\t */\n\t\tif ( ! is_a( $class_name, Registerable::class, true ) ) {\n\t\t\treturn new LazilyInstantiatedService(\n\t\t\t\tfn() => $this->injector->make( $class_name )\n\t\t\t);\n\t\t}\n\n\t\t// The service needs to be registered, so instantiate right away.\n\t\t$service = $this->injector->make( $class_name );\n\n\t\tif ( ! $service instanceof Service ) {\n\t\t\tthrow InvalidService::from_service( $service ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}\n\n\t\treturn $service;\n\t}",
"public static function getOrCreate(string $name)\n {\n $service = static::$services[$name];\n\n if (null === $service) {\n static::$services[$name] = new $name();\n return static::$services[$name];\n }\n\n return $service;\n }",
"public function &getService(string $name, bool $create = true): Service {\n\n # Is there a Service for that name?\n if (!isset($this->services[$name])) {\n throw new \\Exception('Service Not Found');\n }\n\n # A string will be treated as classname: an service object will be created and stored.\n if (is_string($this->services[$name])) {\n if ($create) {\n $classname = $this->services[$name];\n if (!class_exists($classname)) {\n throw new \\Exception('service \"' . $classname . '\" not found');\n }\n # maybe not needed to store the object ...\n $this->services[$name] = new $classname($this, $this->getRequest());\n } else {\n throw new \\Exception('Service Not Found');\n }\n }\n\n $service = $this->services[$name];\n return $service;\n }",
"protected function typeFactory($type) {\n switch ($type) {\n case \"Customers\":\n echo \"calling Propel on Customers!\";\n break;\n case \"Products\":\n echo \"calling propel on products!\";\n break;\n case \"Orders\":\n echo \"calling propel on orders!\";\n break;\n default:\n echo \"error: no valid type provided\";\n }\n }",
"abstract public function createLoginService($type='');",
"static function make($type)\n {\n $scraper = null;\n\n switch ($type) {\n case 'ElAderezo':\n $scraper = new ScraperElAderezo;\n break; \n case 'GastronomiaYCia':\n $scraper = new ScraperGastronomiaYCia;\n break;\n case 'UtensiliosDeCocina':\n $scraper = new ScraperUtensiliosDeCocina;\n break;\n } \n return $scraper;\n }",
"public static function build($type) {\n $product = $type;\n if (class_exists($product)) {\n return new $product();\n }\n else {\n throw new Exception(\"Invalid product type given.\");\n }\n }",
"public function make($service)\n {\n if (! isset($this->services[$service])) {\n throw new \\BadMethodCallException(\"{$method} is not a supported Plaid service.\");\n }\n\n // If we already have an instance, then just return it\n if ( isset($this->instances[$service]) ) {\n return $this->instances[$service];\n }\n\n // Otherwise, create it, save it, & return it\n return $this->instances[$service] = new $this->services[$service]($this->request);\n }",
"public function get(string $type): mixed\n {\n if (array_key_exists($type, $this->store)) {\n return $this->store[$type];\n }\n\n return $this->getBinding($type)\n ->getInstance();\n }",
"function __construct($service) {\n // return new $class;\n }",
"public function create($type)\n {\n //\n }",
"public static function create($type)\n\t{\n\t\tif (empty($type) || 0 === strpos($type, 'text/html')) {\n\t\t\treturn new HttpGetRequest;\n\t\t}\n\n\t\tif (0 === strpos($type, 'application/json')) {\n\t\t\treturn new HttpJsonRequest;\n\t\t}\n\n\t\treturn new HttpPostRequest;\n\t}",
"private function createServiceProvider($type=\"neweb\", $activity='') {\n return $this->cashFlow->createProvider($type, $activity);\n }",
"public function serviceType(ServiceType $serviceType): StationDetailsBuilder;",
"public function getServiceGenerator($type, $name);",
"abstract protected function getService($id);",
"public function __invoke($type, $service, $version)\n {\n switch ($type) {\n case 'api':\n return $this->getService($service, $version);\n case 'paginator':\n return $this->getServicePaginatorConfig($service, $version);\n case 'waiter':\n return $this->getServiceWaiterConfig($service, $version);\n default:\n throw new \\InvalidArgumentException('Unknown type: ' . $type);\n }\n }",
"public function getServiceListingDAO($type) {\r\n \r\n // use case statement here\r\n if ($type == 'mysql') {\r\n return new ServiceListingDAOImpl();\r\n } else {\r\n return new ServiceListingDAOImpl();\r\n }\r\n }",
"protected function instantiateServices( $class ) {\n\t\tif ( ! class_exists( $class ) ) {\n\t\t\tthrow new InvalidArgumentException( sprintf(\n\t\t\t\t'The service \"%s\" is not recognized and cannot be registered.',\n\t\t\t\tis_object( $class ) ? get_class( $class ) : (string) $class\n\t\t\t) );\n\t\t}\n\n\t\t$service = new $class();\n\n\t\tif ( ! $service instanceof Service ) {\n\t\t\tthrow new InvalidArgumentException( sprintf(\n\t\t\t\t'The service \"%s\" is not recognized and cannot be registered.',\n\t\t\t\tis_object( $service ) ? get_class( $service ) : (string) $service\n\t\t\t) );\n\t\t}\n\n\t\treturn $service;\n\t}",
"public function find(string $id): ServiceHolder;",
"protected function service()\n {\n return new Service();\n }",
"protected function getFactoryByType( $type ) {\n\t\tif ( !$this->factories->hasKey( $type ) ) {\n\t\t\t$creator = new FactoryCreator();\n\t\t\t$factory = $creator->createFactoryByFileExtension( $type );\n\n\t\t\t$this->factories->set( $type, $factory );\n\t\t\treturn $factory;\n\t\t}\n\n\t\treturn $this->factories->get( $type );\n\t}",
"public function getDefinitionInstanceByType($a_type)\r\n\t{\r\n\t\t$class = $this->initTypeClass($a_type, \"Definition\");\t\t\r\n\t\treturn new $class();\t\t\r\n\t}",
"public function getSingleton(string $serviceId): mixed;",
"final protected function getObject($type){\n\t\t\treturn $this->getFactory()->getObject( $this->getRes(), $type );\n\t\t}",
"public function get(string $service)\n {\n\n // cache available?\n if (array_key_exists($service, $this->cachedInstances)) {\n return $this->cachedInstances[$service];\n }\n\n\n // instantiate on the fly, and cache for the next time\n if (array_key_exists($service, $this->sicBlocks)) {\n try {\n $instance = $this->getService($this->sicBlocks[$service]);\n $this->cachedInstances[$service] = $instance;\n return $instance;\n } catch (\\Exception $e) {\n throw new OctopusServiceErrorException($e->getMessage(), 0, $e);\n }\n } else {\n throw new OctopusServiceErrorException(\"Service not found: $service\");\n }\n }",
"public static function createFromType($type)\n\t{\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase self::POINT: $obj = new SpatialPoint(); break;\n\t\t\tcase self::LINE_STRING: $obj = new SpatialLineString(); break;\n\t\t\tcase self::POLYGON: $obj = new SpatialPolygon(); break;\n\t\t\tcase self::MULTI_POINT: $obj = new SpatialMultiPoint(); break;\n\t\t\tcase self::MULTI_LINE_STRING: $obj = new SpatialMultiLineString(); break;\n\t\t\tcase self::MULTI_POLYGON: $obj = new SpatialMultiPolygon(); break;\n\t\t\tcase self::GEOMETRY_COLLECTION: $obj = new SpatialGeometryCollection(); break;\n\t\t\tdefault: throw new Exception(\"Spatial type {$type} was not found\");\n\t\t}\n\n\t\treturn $obj;\n\t}",
"public function getInstance(stubBaseReflectionClass $type, stubBaseReflectionClass $impl, stubInjectionProvider $provider);",
"abstract function get_crud_service();",
"abstract protected function getService();",
"public function getService( $serviceType )\n {\n if ( $serviceType === 'IDataServiceMetadataProvider' )\n {\n if ( is_null( $this->_Metadata ) )\n {\n $this->_Metadata = ezpMetadata::create();\n }\n \n return $this->_Metadata;\n }\n else \n if ( $serviceType === 'IDataServiceQueryProvider2' )\n {\n if ( is_null( $this->_QueryProvider ) )\n {\n $this->_QueryProvider = new ezpQueryProvider();\n }\n \n return $this->_QueryProvider;\n }\n else \n if ( $serviceType === 'IDataServiceStreamProvider' )\n {\n return new ezpStreamProvider();\n }\n \n return null;\n }",
"private function instantiateService($id, Container\\Container $container)\n {\n /** @var object $_service_data */\n $_service_data = $this->_service_list[$id];\n /** @var \\ReflectionClass $_reflector */\n $_reflector = new \\ReflectionClass($_service_data->class);\n return $_reflector->newInstanceArgs($this->getArgs($_service_data, $container));\n }",
"public function create($serviceName, $context='default', $fallBackToDefaultContext=false)\n {\n $service = null;\n $serviceLocation = $this->hasService($serviceName, $context);\n\n switch($serviceLocation) {\n case self::SERVICE_NOT_FOUND:\n // If we don't have a service for the specified service and we do not\n // allow falling back to the default context, freak out.\n $this->logger->log(\"No service $serviceName for that context. Checking if I should look in default: \" . strcasecmp($context, 'default'));\n if (strcasecmp($context, 'default') != 0 && $fallBackToDefaultContext) {\n // Try to get the job done with the default context\n $service = $this->create($serviceName, 'default');\n }\n\n // We have no clue how to build this thing, let's just try it\n // and hope we don't light the atmosphere on fire.\n if (is_null($service)) {\n $this->logger->log(\"Could not build it using default context, trying to instantiate it\");\n $service = $this->getBuilder()->getUsingSimpleInstantiation($serviceName, 'default');\n }\n\n break;\n\n case self::SERVICE_IN_BUILDER:\n $this->logger->log(\"Service $serviceName found in builder\");\n $service = $this->getBuilder()->get($serviceName, $context);\n break;\n }\n\n return $service;\n }",
"public function create(string $type, InputBag $input = null): Interactor;",
"function &factory($type)\n {\n $classfile = \"format/{$type}.class.php\";\n if (include_once $classfile) {\n $class = \"{$type}_format\";\n if (class_exists($class)) {\n $object = & new $class($options);\n return $object;\n } else {\n COM_errorLog(\"report.class - Unable to instantiate class $class from $classfile\");\n }\n } else {\n COM_errorLog(\"report.class - Unable to include file: $classfile\");\n }\n\n }",
"function &loadService( $name, $bundleId = '', $options = array() ) {\n\t\tif ( !isset( $this->services[$name] ) ) {\n\t\t\tif ( isset( $this->captures[$name] ) ) {\n\t\t\t\tif ( is_array( $this->captures[$name] ) ) {\n\t\t\t\t\tlist( $bundleId, $options ) = $this->captures[$name];\n\t\t\t\t} else {\n\t\t\t\t\t$bundleId = $this->captures[$name];\n\t\t\t\t}\n\t\t\t} elseif ( empty( $bundleId ) ) {\n\t\t\t\t$bundleId = $name;\n\t\t\t}\n\t\t\t$this->services[$name] =& XOS::create( $bundleId, $options );\n\t\t}\n\t\treturn $this->services[$name];\n\t}",
"public static function getInstance(string $type)\n\t{\n\t\t$instance = new static();\n\t\t$instance->type = $type;\n\t\t$instance->loadConfig();\n\t\treturn $instance;\n\t}",
"protected function resourceService(){\n return new $this->resourceService;\n }",
"public function get($type);",
"protected abstract function resolveService();",
"public function getInstance(/* ... */)\n {\n $reflection = new ReflectionClass($this->getClass());\n return $reflection->newInstanceArgs(func_get_args());\n }",
"public function create($requestedType, array $arguments = []);",
"public static function factory(): ServiceInterface\n {\n return new static();\n }",
"abstract public function service();",
"public function factory($type)\n {\n switch ($type) {\n case 'topics' :\n include_once 'Services/Yahoo/JP/News/' . $type . '.php';\n $classname = 'Services_Yahoo_JP_News_' . ucfirst($type);\n return new $classname;\n default :\n throw new Services_Yahoo_Exception('Unknown news type ' . $type);\n break;\n }\n }",
"public function load($type, $profile = null)\n {\n $key = $type . '-' . ( $profile ? $profile : 'default' );\n \n if( !Engine_Registry::isRegistered($key) ) {\n $object = $this->factory($type, $profile);\n \n if( !$object ) {\n throw new Engine_ServiceLocator_Exception(sprintf('Unknown configuration format for class %s for %s', $class, $key));\n }\n\n Engine_Registry::set($key, $object);\n }\n \n return Engine_Registry::get($key);\n }",
"public static function create($type = NULL) {\n if ($type) {\n $cname = \"BMAttack\" . ucfirst(strtolower($type));\n if (class_exists($cname)) {\n return $cname::create();\n } else {\n return NULL;\n }\n }\n\n $class = get_called_class();\n return new $class;\n }",
"public static function factory($type)\n {\n if (include_once 'Drivers/' . $type . '.php') {\n $classname = 'Driver_' . $type;\n return new $classname;\n } else {\n throw new Exception('Driver not found');\n }\n }",
"private function factoryService($className, EngineBlock_Corto_ProxyServer $server)\n {\n $diContainer = EngineBlock_ApplicationSingleton::getInstance()->getDiContainer();\n\n switch($className) {\n case EngineBlock_Corto_Module_Service_ProvideConsent::class :\n return new EngineBlock_Corto_Module_Service_ProvideConsent(\n $server,\n $diContainer->getXmlConverter(),\n $diContainer->getConsentFactory(),\n $diContainer->getConsentService(),\n $diContainer->getAuthenticationStateHelper(),\n $diContainer->getTwigEnvironment(),\n $diContainer->getProcessingStateHelper()\n );\n case EngineBlock_Corto_Module_Service_ProcessConsent::class :\n return new EngineBlock_Corto_Module_Service_ProcessConsent(\n $server,\n $diContainer->getXmlConverter(),\n $diContainer->getConsentFactory(),\n $diContainer->getAuthenticationStateHelper(),\n $diContainer->getProcessingStateHelper()\n );\n case EngineBlock_Corto_Module_Service_AssertionConsumer::class :\n return new EngineBlock_Corto_Module_Service_AssertionConsumer(\n $server,\n $diContainer->getXmlConverter(),\n $diContainer->getSession(),\n $diContainer->getProcessingStateHelper(),\n $diContainer->getStepupGatewayCallOutHelper(),\n $diContainer->getServiceProviderFactory()\n );\n case EngineBlock_Corto_Module_Service_ProcessedAssertionConsumer::class :\n return new EngineBlock_Corto_Module_Service_ProcessedAssertionConsumer(\n $server,\n $diContainer->getProcessingStateHelper()\n );\n case EngineBlock_Corto_Module_Service_StepupAssertionConsumer::class :\n return new EngineBlock_Corto_Module_Service_StepupAssertionConsumer(\n $server,\n $diContainer->getSession(),\n $diContainer->getProcessingStateHelper(),\n $diContainer->getStepupGatewayCallOutHelper(),\n $diContainer->getLoaRepository()\n );\n case EngineBlock_Corto_Module_Service_SingleSignOn::class :\n return new EngineBlock_Corto_Module_Service_SingleSignOn(\n $server,\n $diContainer->getXmlConverter(),\n $diContainer->getTwigEnvironment(),\n $diContainer->getServiceProviderFactory()\n );\n case EngineBlock_Corto_Module_Service_ContinueToIdp::class :\n return new EngineBlock_Corto_Module_Service_ContinueToIdp(\n $server,\n $diContainer->getXmlConverter(),\n $diContainer->getTwigEnvironment(),\n $diContainer->getServiceProviderFactory()\n );\n default :\n return new $className($server, $diContainer->getXmlConverter(), $diContainer->getTwigEnvironment());\n }\n }",
"public static function forge($type)\n\t{\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\treturn static::getContainer()->get('response.'.$type, $args);\n\t}",
"private function createService(array $service)\n {\n if (isset($service['constructor'])) {\n $instance = $service['constructor']();\n return $instance;\n }\n\n if (!isset($service['class'])) {\n throw new ContainerException('Service hasn\\'t field class');\n }\n\n if (!class_exists($service['class'])) {\n throw new ContainerException(\"Class {$service['class']} doesn't exists\");\n }\n\n $class = $service['class'];\n if (isset($service['arguments'])) {\n $newService = new $class(...$service['arguments']);\n } else {\n $newService = new $class();\n }\n\n if (isset($service['calls'])) {\n foreach ($service['calls'] as $call) {\n if (!method_exists($newService, $call['method'])) {\n throw new ContainerException(\"Method {$call['method']} from {$service['class']} class not found\");\n }\n\n $arguments = $call['arguments'] ?? [];\n\n call_user_func_array([$newService, $call['method']], $arguments);\n }\n }\n\n return $newService;\n }",
"public function getInstance($name, $usePeeringServiceManagers = true)\n {\n // inlined code from ServiceManager::canonicalizeName for performance\n if (isset($this->canonicalNames[$name])) {\n $cName = $this->canonicalNames[$name];\n } else {\n $cName = $this->canonicalizeName($name);\n }\n\n $isAlias = false;\n\n if ($this->hasAlias($cName)) {\n $isAlias = true;\n $cName = $this->resolveAlias($cName);\n }\n\n $instance = null;\n\n if ($usePeeringServiceManagers && $this->retrieveFromPeeringManagerFirst) {\n $instance = $this->retrieveFromPeeringManager($name);\n\n if (null !== $instance) {\n return $instance;\n }\n }\n\n if (isset($this->instances[$cName])) {\n return $this->instances[$cName];\n }\n\n if (!$instance) {\n $this->checkNestedContextStart($cName);\n if (\n isset($this->invokableClasses[$cName])\n || isset($this->factories[$cName])\n || isset($this->aliases[$cName])\n || $this->canCreateFromAbstractFactory($cName, $name)\n ) {\n $instance = $this->create(array($cName, $name));\n } elseif ($isAlias && $this->canCreateFromAbstractFactory($name, $cName)) {\n /*\n * case of an alias leading to an abstract factory :\n * 'my-alias' => 'my-abstract-defined-service'\n * $name = 'my-alias'\n * $cName = 'my-abstract-defined-service'\n */\n $instance = $this->create(array($name, $cName));\n } elseif ($usePeeringServiceManagers && !$this->retrieveFromPeeringManagerFirst) {\n $instance = $this->retrieveFromPeeringManager($name);\n }\n $this->checkNestedContextStop();\n }\n\n // Still no instance? raise an exception\n if ($instance === null) {\n $this->checkNestedContextStop(true);\n if ($isAlias) {\n throw new Exception\\ServiceNotFoundException(sprintf(\n 'An alias \"%s\" was requested but no service could be found.',\n $name\n ));\n }\n\n throw new Exception\\ServiceNotFoundException(sprintf(\n '%s was unable to fetch or create an instance for %s',\n get_class($this) . '::' . __FUNCTION__,\n $name\n ));\n }\n\n if (\n ($this->shareByDefault && !isset($this->shared[$cName]))\n || (isset($this->shared[$cName]) && $this->shared[$cName] === true)\n ) {\n $this->instances[$cName] = $instance;\n }\n\n return $instance;\n }",
"public function getArticleTypeService() {\n\t\treturn $this->get('sly-service-articletype');\n\t}",
"public function create(string $class);",
"public static function factory($value, ServiceOptionsInterface $service_options = null) : ServiceInterface\n {\n $urldata = parse_url($value);\n\n $host = isset($urldata['host']) ? $urldata['host'] : '';\n $scheme = isset($urldata['scheme']) ? $urldata['scheme'] : 'http';\n\n $options = new Client\\Options();\n $options->referer = $scheme . '://' . $host;\n\n $client = Client::factory($options);\n\n if (! $service_options instanceof ServiceOptionsInterface) {\n $service_options = new DefaultOptions();\n }\n\n switch ($host) {\n case 'www.youtube.com':\n case 'youtube.com':\n $service = new Youtube($client, $service_options);\n break;\n case 'www.vimeo.com':\n case 'vimeo.com':\n $service = new Vimeo($client, $service_options);\n break;\n default:\n throw new Exception('Service not found', Exception::SERVICE_NOT_FOUND);\n }\n\n $service->setId($value);\n return $service;\n }",
"public function resource(string $type): ResourceInterface\n {\n return $this->api->getResource($type);\n }",
"public function make(string $service): mixed\n {\n $service = 'Google\\\\Service\\\\'.ucfirst($service);\n\n if (class_exists($service)) {\n $class = new \\ReflectionClass($service);\n\n return $class->newInstance($this->client);\n }\n\n throw new UnknownServiceException($service);\n }",
"public static function get_type($type = \"Posts\") {\r\n\t\t$_type = \"\\\\ESWP\\\\MyTypes\\\\\".\"$type\";\r\n\t\treturn new $_type();\r\n\t}",
"public static function getService($name)\n {\n global $container;\n $service = $container->getByType($name, false);\n if (!$service) {\n $service = $container->getService($name);\n }\n return $service;\n }",
"public static function getInstance($name = 'default') {\r\n if (!array_key_exists($name, self::$instances)) {\r\n self::$instances[$name] = new MOC_Api_Service();\r\n }\r\n return self::$instances[$name];\r\n }",
"public static function factory( $post_id, $type = 'post' ) {\n\t\t$type = papi_get_meta_type( $type );\n\t\t$class_suffix = '_' . ucfirst( $type ) . '_Store';\n\t\t$class_name = 'Papi' . $class_suffix;\n\n\t\tif ( ! class_exists( $class_name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post_id = papi_get_post_id( $post_id );\n\t\t$page = new $class_name( $post_id );\n\n\t\tif ( ! $page->valid() ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $page;\n\t}",
"static function create(string $class): ?object\n {\n //$container->get($class);\n\n try {\n return create($class);\n } catch (DependencyException $e) {\n return null;\n } catch (NotFoundException $e) {\n return null;\n }\n }",
"public static function getService($id = 0) {\n $service = ORM::forTable('service')->findOne($id);\n\n if ($service === 0) {\n $service = Admin::createService();\n return $service;\n }\n\n if (!$service) {\n throw new Exception('Unable to find Service record for id = ' . $id);\n }\n\n return $service;\n }",
"public function createAction()\n {\n $type = $this->params('type');\n $instance = $this->getInstanceManager()->getInstanceFromRequest();\n $query = $this->params()->fromQuery();\n $entity = $this->getEntityManager()->createEntity(\n $type,\n $query,\n $instance\n );\n $this->getEntityManager()->flush();\n\n $data = ['entity' => $entity, 'data' => $query];\n $response = $this->getEventManager()->trigger('create.postFlush', $this, $data);\n return $this->checkResponse($response);\n }",
"protected function _getApiTypeInstance($code)\n {\n $typeConfig = $this->_getApiTypeConfig($code);\n $instance = Mage::getSingleton($typeConfig->getClass());\n\n if (!$instance) {\n throw new Klarna_Kco_Model_Api_Exception(\n sprintf('API class \"%s\" does not exist!', $typeConfig->getClass())\n );\n }\n\n return $instance;\n }",
"public function get_service($index = FALSE, $settings = FALSE)\n\t{\t\t\n\t\treturn parent::get_object($index, $settings);\n\t}",
"protected function createInterface()\n {\n $classNameService = $this->argument('name');\n\n\n $this->call('make:service_interface', [\n 'name' => \"{$classNameService}Interface\",\n ]);\n }",
"abstract public function getServiceName();",
"public static function createModel($type)\n {\n $className = 'app'.d_S.'models'.d_S.ucfirst($type).\"Model\";\n if($className!=NULL)\n {\n return new $className($type);\n }\n else\n {\n echo \"$className Not Found!\";\n }\n }",
"public function create($service, $entity);",
"private function createShipmentObject()\n {\n switch ($this->getServiceMethod()) {\n case 'addShip':\n return new AddShip();\n case 'addShipment':\n return new AddShipment();\n }\n }",
"final protected function get_service( $identifier ) {\n\t\tif ( null === $this->google_services ) {\n\t\t\t$services = $this->setup_services( $this->get_client() );\n\t\t\tif ( ! is_array( $services ) ) {\n\t\t\t\tthrow new Exception( __( 'Google services not set up correctly.', 'google-site-kit' ) );\n\t\t\t}\n\t\t\tforeach ( $services as $service ) {\n\t\t\t\tif ( ! $service instanceof Google_Service ) {\n\t\t\t\t\tthrow new Exception( __( 'Google services not set up correctly.', 'google-site-kit' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->google_services = $services;\n\t\t}\n\n\t\tif ( ! isset( $this->google_services[ $identifier ] ) ) {\n\t\t\t/* translators: %s: service identifier */\n\t\t\tthrow new Exception( sprintf( __( 'Google service identified by %s does not exist.', 'google-site-kit' ), $identifier ) );\n\t\t}\n\n\t\treturn $this->google_services[ $identifier ];\n\t}",
"public function find(string $class): Instantiator;",
"abstract public function get_instance();",
"public function getInstanceOf($className) {\n\t\tif (func_num_args() > 1) {\n\t\t\t$constructorArguments = func_get_args();\n\t\t\tarray_shift($constructorArguments);\n\n\t\t\t$reflectedClass = new \\ReflectionClass($className);\n\t\t\t$instance = $reflectedClass->newInstanceArgs($constructorArguments);\n\t\t} else {\n\t\t\t$instance = GeneralUtility::makeInstance($className);\n\t\t}\n\t\treturn $instance;\n\t}",
"public static function service($name)\n {\n return Container::getInstance()->make($name);\n }",
"public function get($name)\n {\n $canonicalName = $this->getCanonicalName($name);\n\n if (isset($this->instances[$canonicalName])) {\n return $this->instances[$canonicalName];\n }\n\n if (isset($this->invokableClasses[$canonicalName])) {\n $instance = $this->createFromInvokable($canonicalName);\n $this->instances[$canonicalName] = $instance;\n return $instance;\n }\n\n $object = $this->serviceLocator->get($name);\n if ($object !== null) {\n return $object;\n }\n\n return null;\n }",
"public function getAdapterFactory($type)\n {\n $adapterFactory = $this->config->getAdapterFactory();\n if($adapterFactory instanceof GenericInstanceFactory)\n {\n return $adapterFactory;\n }\n\n // if they have used the namespaces option in the config load up the namespace chain\n $namespaces = $this->getConfig()->getNamespaces();\n if(is_array($namespaces) && !empty($namespaces)) {\n $adapterFactory = MultiInstanceFactory::createFromNamespaceList($namespaces, array());\n } else {\n\n $namespace = Introspection::getNamespaceBase(get_class($this));\n\n $type = ucwords($type);\n $modelClass = $namespace . \"\\\\Storage\\\\Adapter\\\\{$type}\";\n $adapterFactory = new MultiInstanceFactory($modelClass);\n }\n\n return $adapterFactory;\n }",
"function get_instance($class)\n {\n }",
"private function reflection(string $key)\n {\n if ($this->has($key)) {\n return $this->registry[$key];\n }\n\n if (!$this->autowiring) {\n throw new NotFoundException(\"Key service not found\");\n }\n\n $reflected_class = new \\ReflectionClass($key);\n if (!$reflected_class->isInstantiable()) {\n throw new ContainerException(\"Key is not instantiable\");\n }\n \n if ($constructor = $reflected_class->getConstructor()) {\n \n $parameters = $constructor->getParameters();\n $constructor_parameters = [];\n foreach ($parameters as $parameter) {\n \n if (!is_null($parameter->getClass())) {\n $constructor_parameters[] = $this->reflection($parameter->getClass()->getName());\n } else {\n $constructor_parameters[] = $parameter;\n } \n \n }\n $this->registry[$key] = $reflected_class->newInstanceArgs($constructor_parameters);\n \n } else {\n $this->registry[$key] = $reflected_class->newInstance(); \n }\n return $this->registry[$key];\n }",
"public function store()\n {\n $data = request()->only(\"name\");\n\n try {\n $type = ObjectType::create($data);\n return $type;\n } catch (\\Exception $exception) {\n throw $exception;\n }\n }",
"static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }",
"abstract public function getServiceTypeName();",
"private function getInstanceOf($classname)\n {\n if ((bool) $this->getContainer() && $this->getContainer()->has($classname)) {\n return $this->getContainer()->get($classname);\n } else {\n return new $classname;\n }\n }",
"public static function loadService($service) {\n\t\t$class = ucfirst($service).'Service';\n\t\trequire(SITE_ROOT.'/services/'.$service.'/'.$class.'.php');\n\t\t$serviceObj = new $class();\n\t\treturn $serviceObj;\n\t}",
"public function create()\n {\n if (Gate::denies('service.create')) {\n session()->flash('warning', 'You do not have permission to create a service');\n return redirect()->back();\n }\n return view('pages.settings.services-type.create');\n }",
"protected function inject($service, $single=false)\n\t{\n\t\t$mirror = new \\ReflectionClass($service);\n\t\t$constructor = $mirror->getConstructor();\n\n\t\t$params = null;\n\n\t\tif (empty($constructor))\n\t\t{\n\t\t\treturn new $service();\n\t\t}\n\n\t\t$params = $this->getParams($constructor, $single);\n\n\t\t// No params means we simply create a new\n\t\t// instance of the class and return it...\n\t\tif (is_null($params))\n\t\t{\n\t\t\treturn new $service();\n\t\t}\n\n\t\t// Still here - then return an instance\n\t\t// with those params as arguments\n\t\treturn $mirror->newInstanceArgs($params);\n\t}",
"private function getInstanceType()\n\t{\n\t\t// Get current instances info\n\t\t$this->getInstances(array('InstanceId' => $this->instanceId));\n\n\t\t// Select all of the tags from the server response\n\t\t$tags = $this->response->body->reservationSet->item->instancesSet->item->tagSet->item;\n\n\t\t// Loop through tags\n\t\tforeach($tags as $tag)\n\t\t{\n\t\t\t// If current tag is the type tag\n\t\t\tif($tag->key == 'type')\n\t\t\t{\n\t\t\t\t// Set current instance type\n\t\t\t\t$this->instanceType = $tag->value;\n\t\t\t}\n\t\t\t// If current tag is the name tag\n\t\t\telseif($tag->key == 'Name')\n\t\t\t{\t\n\t\t\t\t// Set current instance name\n\t\t\t\t$this->instanceName = $tag->value;\t\t\t\t\n\t\t\t}\t\n\n\t\t\t// Check if this is a development server\n\t\t\tif($tag->key == 'dev')\n\t\t\t{\n\t\t\t\t// Set as a dev server\n\t\t\t\t$this->instanceDev = TRUE;\n\t\t\t}\n\n\t\t\t// Check if this is a development server\n\t\t\tif($tag->key == 'highCPU')\n\t\t\t{\n\t\t\t\t// Set as a dev server\n\t\t\t\t$this->highCPU = TRUE;\n\t\t\t}\t\t\t\n\t\t}\t\n\n\t\t// If tags are missing\n\t\tif(!$this->instanceType || !$this->instanceName)\n\t\t{\n\t\t\t// Don't continue, just kill yourself\n\t\t\texit(\"no instance type or name tag found. I give up...\\n\");\n\t\t}\n\t}",
"public function resolveExtractionByTypeNameOrClassName($typeOrClass) {\n\t\t$className = $nativeClassName = sprintf('Dkd\\\\CmisService\\\\Extraction\\\\%sExtraction', $typeOrClass);\n\t\tif (FALSE === class_exists($nativeClassName)) {\n\t\t\t$className = $typeOrClass;\n\t\t}\n\t\tif (FALSE === class_exists($className)) {\n\t\t\tthrow new \\RuntimeException('Invalid Extraction type: \"' . $typeOrClass . '\". Class not found.', 1413286569);\n\t\t}\n\t\tif (FALSE === is_a($className, 'Dkd\\\\CmisService\\\\Extraction\\\\ExtractionInterface', TRUE)) {\n\t\t\tthrow new \\RuntimeException('Invalid Extraction type: \"' . $typeOrClass . '\". Not an implementation of ' .\n\t\t\t\t'Dkd\\\\CmisService\\\\Extraction\\\\ExtractionInterface', 1410960261);\n\t\t}\n\t\treturn new $className();\n\t}",
"public function store(StoreServiceRequest $request)\n {\n $service = Service::create($request->only(['name']));\n\n return new ServiceResource($service);\n\n }",
"public function forgetInstance(string $type): Binding\n {\n $binding = $this->getBinding($type);\n $binding->forgetInstance();\n return $binding;\n }",
"public function getService($serviceName = null, $context = null) {\r\n\t\tif($serviceName === null) {\r\n\t\t\t$serviceName = Nomenclature::toServiceName($this->getAnnotation('entity'));\r\n\t\t}\r\n\r\n\t\tif($context === null) {\r\n\t\t $context = $this->getContext();\r\n\t\t}\r\n\t\t\r\n\t\treturn new $serviceName($context);\r\n\t}"
] | [
"0.6992154",
"0.664597",
"0.60909927",
"0.60727274",
"0.6068896",
"0.60342455",
"0.6007003",
"0.6006743",
"0.6004208",
"0.59864926",
"0.5977827",
"0.5974282",
"0.5972596",
"0.59707654",
"0.58591837",
"0.5832644",
"0.571881",
"0.5714859",
"0.5704318",
"0.5673764",
"0.5660704",
"0.563643",
"0.563585",
"0.5573554",
"0.55686843",
"0.55583733",
"0.5553774",
"0.5532388",
"0.5528655",
"0.55261546",
"0.55258906",
"0.55063957",
"0.549791",
"0.5491998",
"0.54916364",
"0.54897654",
"0.5473998",
"0.5468487",
"0.54681027",
"0.5463901",
"0.54543495",
"0.5454144",
"0.5447227",
"0.5445927",
"0.54375404",
"0.54344773",
"0.542797",
"0.5427441",
"0.5417013",
"0.5415863",
"0.5415337",
"0.54069614",
"0.5399324",
"0.53949666",
"0.5385852",
"0.5383409",
"0.5374228",
"0.5373765",
"0.53715867",
"0.5352462",
"0.5333654",
"0.53319687",
"0.53163433",
"0.5306882",
"0.5303714",
"0.5300087",
"0.52973604",
"0.5279803",
"0.5273116",
"0.5269459",
"0.52661234",
"0.52508515",
"0.52499634",
"0.52425736",
"0.52418786",
"0.52402174",
"0.52285165",
"0.5228095",
"0.52247405",
"0.5223706",
"0.5220609",
"0.5211459",
"0.5209671",
"0.5209615",
"0.5197662",
"0.5193391",
"0.51922214",
"0.51878875",
"0.5185373",
"0.51852745",
"0.517903",
"0.51745814",
"0.5166892",
"0.51668084",
"0.516678",
"0.51652884",
"0.51648927",
"0.5157962",
"0.5156308",
"0.5155327"
] | 0.5858806 | 15 |
Set the service layer instance for the given type | public static function setServiceLayer($type, $service, $mode = '')
{
$type = $type . $mode;
self::$services[$type] = $service;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 }",
"public function setClass($class)\n {\n $this->service = new $class();\n }",
"public function set($typeId, $class);",
"public function set(string $serviceId, $instance): void\n {\n $this->services[$serviceId] = $instance;\n }",
"public function set(string $serviceName, $object);",
"public static function setInstance( IContainer $container );",
"public function set(string $type)\n\t{\n\t\ttry {\n\t\t\tif (!in_array($type, $this->AllowsShapesTypes, true)) {\n\t\t\t\tthrow new \\Exception(\"Don't exist shape (\" . $type . ')');\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\t$type = 'default';\n\t\t\tResponseHandler::fail($e->getMessage());\n\t\t} finally {\n\t\t\t$this->type = $type;\n\t\t}\n\t}",
"public static function set(string $name, $instance): void\n {\n static::$services[$name] = $instance;\n }",
"public function set_type($type) {\n $this->update([\n 'type' => $type\n ]);\n\n $this->type = $type;\n\n // finish configuring this OrderExchange\n $this->sync();\n }",
"public function __set($name, $value) {\n $this->services[$name] = $value;\n }",
"public function setType($type) :ISEntity\n {\n array_walk($this->types, function($name, $index) use ($type) {\n if($type === $name){\n $this->type = $index;\n }\n });\n if(is_null($this->type)) {\n if(isset($this->types[$type])) {\n $this->type = $type;\n }\n }\n return $this;\n }",
"function setType($type) {\n $this->type = $type;\n }",
"public function setService($service) {\r\n\t\t$this->service = $service;\r\n\t}",
"public function setControllerFactory($type, $callable)\n {\n $this->controllerFactories[$type] = $callable;\n }",
"public function setType($type){ }",
"public static function setInstance($container){\n //Method inherited from \\Illuminate\\Container\\Container \n \\Illuminate\\Foundation\\Application::setInstance($container);\n }",
"public function setService($instance)\n {\n parent::setService($instance);\n foreach ($this->_entry as $entry) {\n $entry->setService($instance);\n }\n return $this;\n }",
"function setType($type) {\n\t\t$this->_type = $type;\n\t}",
"function setType($type) {\n\t\t$this->_type = $type;\n\t}",
"public function setServiceType(array $serviceType)\n {\n $this->serviceType = $serviceType;\n return $this;\n }",
"public function setType($type) {}",
"public function register(string $type, string $classPath)\n {\n $this->classPool[$type] = $classPath;\n }",
"abstract public function setDAO($type);",
"function set_ms_layer_type(&$ms_layer, $db_layer){\n\t\tswitch ($db_layer->geom_type){\n\t\t\t// point\n\t\t\tcase \"point\":\n\t\t\tcase \"multipoint\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POINT);\n\t\t\t\tbreak;\n\t\t\t// line\t\n\t\t\tcase \"line\":\n\t\t\tcase \"linestring\":\n\t\t\tcase \"multilinestring\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_LINE);\n\t\t\t\tbreak;\n\t\t\t// polygon\n\t\t\tcase \"polygon\":\n\t\t\tcase \"multipolygon\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POLYGON);\n\t\t\t\tbreak;\n\t\t\t// default\n\t\t\tdefault:\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POLYGON);\n\t\t}\n\t}",
"public function setType(?string $type): void\n {\n }",
"public function setObject($obj)\n {\n $this->service = $obj;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType(?string $type): void;",
"public function createService($serviceClass);",
"public function __construct(OrderTypeService $orderTypeService)\n {\n\n //$this->middleware('api');\n $this->orderTypeService = $orderTypeService;\n }",
"public function setType($type)\r\n {\r\n $this->type = $type;\r\n }",
"public function setService($service)\n\t{\n\t\t$this->service = ucfirst($service);\n\t}",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType($type) {\n $this->type = $type;\n }",
"public function setType( $type )\n {\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n }",
"public function __construct($type, ReflectionService $reflectionService)\n {\n $this->type = $type;\n $this->classSchema = $reflectionService->getClassSchema($type);\n }",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"public function setType($type);",
"abstract public function createLoginService($type='');",
"public function setClass($class);",
"private function setupServerTypes()\n {\n $serverTypes = [\n ['name' => 'DB'],\n ['name' => 'API'],\n ['name' => 'WebServer']\n ];\n\n $container = $this->setupData($serverTypes, ServerType::class);\n\n $this->serverTypes = $container;\n }",
"public function setService(BaseService $service)\n {\n $this->_service = $service;\n }",
"public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}",
"final public function getService($type)\n\t{\n\t\treturn $this->getServiceLocator()->getService($type);\n\t}",
"public function setType($type)\n{\n$this->type = $type;\n\nreturn $this;\n}",
"public function &setType($type) {\n\t\t$this->type=$type;\n\t\treturn $this;\n\t}",
"public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}",
"public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}",
"public function setPoolType($type)\n\t{\n\t\tif ((CPoolLister::POOL_TYPE_CD == $type) || (CPoolLister::POOL_TYPE_DOWNLOAD == $type) || (CPoolLister::POOL_TYPE_USECLIENTDEBS == $type))\n\t\t\treturn($this->setProperty('type', $type));\n\t\telse\n\t\t\tdie('ERROR: Invalid pool type: '.$type);\n\t}",
"public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}",
"public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}",
"public function __set($key, $value)\n {\n $this->service[$key] = $value;\n }",
"public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}",
"public function setType($type)\n\t{\n\t\t$this->type = ky_assure_constant($type, $this, 'TYPE');\n\t\treturn $this;\n\t}",
"public function giveService($key, $Service);",
"public function setService($value)\n {\n return $this->set('Service', $value);\n }",
"public function setService ($service)\n {\n if (is_string($service)) {\n $service = new $service();\n }\n if (! $service instanceof Application_Rest_Client) {\n throw new Exception('Invalid data gateway provided');\n }\n $this->_service = $service;\n return $this;\n }",
"public function setHandler($type) {\n\t\n\t\tswitch ($type) {\n\t\t\tcase \"development\":\n\t\t\t\t$this->createDevelopmentHandler();\n\t\t\t\tbreak;\n\t\t\tcase \"production\":\n\t\t\t\t$this->createProductionHandler();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->createProductionHandler();\n\t\t}\n\t\n\t\t$this->init = true;\n\t\t$this->logBufferedMsgs();\n\t}",
"public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}",
"public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}",
"public function setType(string $type);",
"public function setServiceTypeId($serviceTypeId) {\n $this->_serviceTypeId = $serviceTypeId;\n }",
"public function setServiceTypeId($serviceTypeId) {\n $this->_serviceTypeId = $serviceTypeId;\n }",
"public function setType(?string $type): void\n {\n $this->type = $type;\n }",
"public function setType(?string $type): void\n {\n $this->type = $type;\n }",
"public function set_type($type)\n {\n $this->set_default_property(self::PROPERTY_TYPE, $type);\n }",
"public static function set($name, ckXsdType $type = null)\r\n {\r\n self::$typeRegistry[$name] = $type;\r\n\r\n return $type;\r\n }",
"public function setType(string $type): self;",
"public function setType(string $type): self;",
"public function set($type, $name, $value)\n {\n $type = strtolower($type);\n\n if (property_exists($this, $type)) {\n if (!is_array($this->$type)) {\n $this->$type = array();\n }\n $arr = &$this->$type;\n $arr[$name] = $value;\n\n //sessions are special\n if ($type == 'session') {\n $_SESSION[$name] = $value;\n }\n }\n return $this;\n }",
"public function set_service($service_url)\n\t{\n\t\t$this->api_service = $service_url;\n\t}",
"public function set($name, $service, $context='default')\n {\n $this->getServices()->set($name, $service, $context);\n }",
"public function setType($type)\n {\n $this['type'] = $type;\n }",
"public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"public function __construct($type) {\n $this->type = $type;\n }",
"private function setType(TypeInterface $type)\n {\n $this->type = $type;\n return $this;\n }",
"public function __construct()\n {\n $this->demoService = new DemoService();\n }",
"public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"public function make($type);",
"public static function setServicePoint($servicePoint)\n {\n self::$servicePoint = $servicePoint;\n }",
"public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}",
"public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }",
"private function initService() {\n\t\t/** check if config->service exists */\n\t\t$config = $this->_config->get('config');\n\t\tif (!property_exists($config, 'service')) {\n\t\t\tthrow new Exception('Configuration file requires \"service\" filed');\n\t\t}\n\n $services = $config->service->toArray();\n\n /** inject service into Di container */\n foreach ($services as $name => $options) {\n \t$bootstarp = $this;\n \t$shared = $options['shared'] ? : FALSE;\n\n \t$this->_di->set($name, function() use ($bootstarp, $options) {\n \t\tif (!class_exists($options['lib'])) {\n \t\t\tthrow new Exception('Class \"' . $options['lib'] .'\" is not found');\n \t\t}\n\n \t\t/** check if there is a specify config file */\n \t\t$config = NULL;\n \t\tif (!empty($options['config'])) {\n\t\t\t\t\t/** get config */\n\t\t\t\t\t$config = $bootstarp->_config->get($options['config'])->toArray();\n \t\t}\n\n \t\t/** check if the class implements with the interface iService */\n \t\t$instance = new $options['lib']();\n \t\tif (!$instance instanceof iService) {\n \t\t\tthrow new Exception('class ' . $options['lib'] . ' not implements with interface iService');\n \t\t}\n\n \t\t/** init service */\n \t\treturn $instance->init($config);\n \t}, $shared);\n }\n\t}"
] | [
"0.6481874",
"0.6216244",
"0.6152679",
"0.57389146",
"0.56784296",
"0.56774443",
"0.56186455",
"0.56133044",
"0.5586003",
"0.55498165",
"0.5509799",
"0.5507854",
"0.550776",
"0.54718435",
"0.54533345",
"0.5452731",
"0.5450716",
"0.5442827",
"0.5442827",
"0.5437661",
"0.54244",
"0.5405654",
"0.540455",
"0.5401247",
"0.5396193",
"0.53950584",
"0.53938115",
"0.53938115",
"0.53938115",
"0.5376925",
"0.537309",
"0.5365019",
"0.53624386",
"0.53548574",
"0.5327923",
"0.5327923",
"0.5325562",
"0.5319806",
"0.5319806",
"0.5319806",
"0.5319806",
"0.5319806",
"0.5319806",
"0.5319806",
"0.5319806",
"0.5319806",
"0.53169477",
"0.5311376",
"0.5311376",
"0.5311376",
"0.5311376",
"0.5311376",
"0.5311376",
"0.5311376",
"0.5311376",
"0.53097284",
"0.5309684",
"0.53021073",
"0.5290778",
"0.5267895",
"0.52451",
"0.52441925",
"0.5241528",
"0.52379054",
"0.52379054",
"0.52095485",
"0.5204454",
"0.5204297",
"0.5195878",
"0.5195348",
"0.5186253",
"0.51811206",
"0.51788914",
"0.5174061",
"0.51667684",
"0.5166454",
"0.5166454",
"0.51600564",
"0.51550496",
"0.51550496",
"0.51470333",
"0.51470333",
"0.5145587",
"0.51449895",
"0.5143425",
"0.5143425",
"0.5127293",
"0.511705",
"0.51150024",
"0.51129633",
"0.51114434",
"0.51058924",
"0.5079344",
"0.5075795",
"0.5056289",
"0.5055624",
"0.50551504",
"0.5052217",
"0.5044931",
"0.5042983"
] | 0.68155515 | 0 |
Create an new DAO model based on requested model type | public static function getDao($model, $options = [])
{
if (!isset(self::$instances[$model])) {
$dao = substr_replace($model, '\\Dao\\', strrpos($model, '\\'), 1);
$instance = new $dao($options);
$instance->setModelName($model);
self::$instances[$model] = $instance;
}
return self::$instances[$model];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function createModel($type)\n {\n $className = 'app'.d_S.'models'.d_S.ucfirst($type).\"Model\";\n if($className!=NULL)\n {\n return new $className($type);\n }\n else\n {\n echo \"$className Not Found!\";\n }\n }",
"public function make($modelClass);",
"abstract protected function modelFactory();",
"public function init(string $model_type): Repository;",
"abstract protected function newModel(): Model;",
"public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}",
"public function get_model( $id, $type )\n {\n global $wpdb;\n\n switch( $type ){\n case 'form':\n return new NF_Database_Models_Form( $wpdb, $id );\n break;\n case 'field':\n return new NF_Database_Models_Field( $wpdb, $id );\n break;\n case 'action':\n return new NF_Database_Models_Action( $wpdb, $id );\n break;\n case 'object':\n return new NF_Database_Models_Object( $wpdb, $id );\n break;\n default:\n return FALSE;\n }\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"protected function makeModel()\n {\n return factory(Employee::class)->create();\n }",
"protected static function getModel()\n {\n $modelName = get_called_class();\n $model = new $modelName();\n $model->setFetchMode(\\Phalcon\\Db::FETCH_OBJ);\n return $model;\n }",
"protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }",
"private function _makeModel($controller_name, $storage_type)\n\t{\n\t\t$model\t\t= $controller_name . 'Model';\n\t\t\t\t\n\t\t$storage\t= $this->_makeTemplateStorage($storage_type);\n\t\t$log\t\t= $this->makeLogger();\n\t\t$db\t\t\t= $this->_makeDatabase();\n\t\t\n\t\treturn new $model($storage, $storage_type, $log, $db);\n\t}",
"protected function newModelInstance()\n {\n return resolve(Arr::get(self::DOCUMENT_TYPES, $this->type));\n }",
"function loadModel($modelName,$negocio){\r\n\tif($modelName=='database'){\r\n\t\t$modelPath = '../Config/'.$negocio.'_'.$modelName.'.php';\r\n\t\tif(is_file($modelPath)){\r\n\t\t\tif (!class_exists($modelName)) {\r\n\t\t\t\trequire_once($modelPath);\r\n\t\t\t}\t\t\r\n\t\t}else{\r\n\t\t\techo 'No existe la conexion'.$modelPath;\r\n\t\t\texit();\r\n\t\t}\r\n\t\t$model = new $modelName();\r\n\t\treturn $model;\t\r\n\t}else{\r\n\t\t$modelPath = '../Model/'.$modelName.'.php';\r\n\t\tif(is_file($modelPath)){\r\n\t\t\tif (!class_exists($modelName)) {\r\n\t\t\t\trequire_once($modelPath);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\techo 'No existe este modelo '.$modelPath;\r\n\t\t\texit();\r\n\t\t}\r\n\t\t$model = new $modelName();\r\n\t\tif($negocio != 'null'){\r\n\t\t\t$model->negocio = $negocio;\r\n\t\t}\t\t\r\n\t\treturn $model;\r\n\t}\r\n}",
"public static function initModel($modelType){\n $m=new $modelType();\n unset($m);\n }",
"public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }",
"public function create(): Model;",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"public function model($model) {\r\n require_once \"../app/models/$model.php\";\r\n return new $model; //return class\r\n }",
"protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }",
"public function __construct($modelType, Storage $storage);",
"protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }",
"abstract protected function getModelClass();",
"private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }",
"protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }",
"public function getServiceListingDAO($type) {\r\n \r\n // use case statement here\r\n if ($type == 'mysql') {\r\n return new ServiceListingDAOImpl();\r\n } else {\r\n return new ServiceListingDAOImpl();\r\n }\r\n }",
"public function _instanciar_model() {\n $Model = ClassRegistry::init('Autenticacao.' . $this->config['model_usuario']);\n return $Model;\n }",
"protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }",
"public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}",
"public static function model() {\n //here __CLASS__ or self does not work because these will return coreModel class name but this is an abstract class so php will generate an error.\n //get_called_class() will return the class name where model is called.It may be the child.\n $class = get_called_class();\n return new $class;\n }",
"protected function newModel($data)\n{\n\t$className = Model::className($this->query['from']);\n\t$model = new $className($this->query['from']);\n\n\tif (!$this->cachedTemplate) {\n\t\t$this->cachedTemplate = $model->getTemplate();\n\t}\n\n\t$model->setTemplate($this->cachedTemplate);\n\n\tif ($data) {\n\t\t$model->setValues($data);\n\t\t$model->isInDb(true);\n\t}\n\n\treturn $model;\n}",
"public function getModel()\n {\n $model = new $this->versionable_type();\n $model->unguard();\n $model->fill(unserialize($this->model_data));\n $model->exists = true;\n $model->reguard();\n return $model;\n }",
"protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}",
"public function model_type_to_class($model_type) {\n $classname = $this->model_type_to_classname($this->convert_to_something($model_type));\n if ($classname && class_exists($classname)) return new $classname();\n throw new ModelNotFoundException(\"Could not convert {$model_type} to Model class because {$classname} does not exist\");\n }",
"static public function getModel($model_name) {\n return new $model_name();\n }",
"public function create()\n {\n return $this->modelManager->instance($this->model);\n }",
"public function model($name){\n\t\treturn new $name();\n\t}",
"abstract public function setDAO($type);",
"public static function newModel()\n {\n return resolve(Manager::class);\n }",
"public function createModel()\n {\n }",
"function M($model)\n{\n\n $modelFile = APP.'/Model/'.$model.'Model.class.php';\n $modelClass = '\\\\'.MODULE.'\\Model\\\\'.$model.'Model';\n if (is_file($modelFile)) {\n \t$model = new $modelClass();\n \treturn $model;\n } else {\n \tthrow new \\Exception('找不到模型', $modelClass);\n }\n}",
"function createModel($name, array $conf);",
"public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}",
"function objCreateType($dbh, $name, $title, $appid = null)\r\n{\r\n\t$otid = 0;\r\n\r\n\t// Prepend with 'co' (custom object) to prevent system object name collision\r\n\t$obj_name = \"co_\".$name;\r\n\r\n\t// Test to make sure object name does not already exist\r\n\tif ($dbh->GetNumberRows($dbh->Query(\"select id from app_object_types where name='$obj_name'\")))\r\n\t\treturn $otid; // fail\r\n\r\n\t$def = new \\Netric\\EntityDefinition($obj_name);\r\n\t$def->title = $title;\r\n\t$def->applicationId = $appid;\r\n\t$def->system = false;\r\n\r\n\t// Save the new object type\r\n $sl = ServiceLocatorLoader::getInstance($dbh)->getServiceLocator();\r\n\t$dm = $sl->get(\"EntityDefinition_DataMapper\");\r\n\t$dm->save($def);\r\n\r\n\t/*\r\n\t// Create new object table and insert into app_object_types\r\n\t$dbh->Query(\"CREATE TABLE objtbl_\".$obj_name.\" (id serial, CONSTRAINT objtbl_\".$obj_name.\"s_pkey PRIMARY KEY (id));\");\r\n\t$results = $dbh->Query(\"insert into app_object_types(name, title, object_table, application_id) \r\n\t\t\t\t\t\t\t values('\".$obj_name.\"', '$title', 'objtbl_\".$obj_name.\"', \".$dbh->EscapeNumber($appid).\");\r\n\t\t\t\t\t\t\t select currval('app_object_types_id_seq') as id;\");\r\n\tif ($dbh->GetNumberRows($results))\r\n\t{\r\n\t\t$otid = $dbh->GetValue($results, 0, \"id\");\r\n\r\n\t\tif ($otid)\r\n\t\t{\r\n\t\t\t// Make sure default feilds are in place\r\n\t\t\t$odef = new CAntObject($dbh, $obj_name);\r\n\t\t\t$odef->fields->verifyDefaultFields();\r\n\r\n\t\t\t// Associate object with application\r\n\t\t\tif ($appid)\r\n\t\t\t\tobjAssocTypeWithApp($dbh, $otid, $appid);\r\n\r\n\t\t\t// Create associations partition\r\n\t\t\t$tblName = \"object_assoc_$otid\";\r\n\t\t}\r\n\t}\r\n\t*/\r\n\r\n\treturn $otid;\r\n}",
"public function model($model) {\n // Require model file\n require_once \"../app/models/{$model}.php\";\n\n // Instantiate model\n return new $model();\n }",
"public function getModelType() {}",
"public function getModelType();",
"public function manager($model) {\n $namespaceModel = 'App\\Model\\\\' . $model;\n return new $namespaceModel(); \n }",
"public function getModel()\n {\n $modelData = is_resource($this->model_data)\n ? stream_get_contents($this->model_data,-1,0)\n : $this->model_data;\n\n $className = self::getActualClassNameForMorph($this->versionable_type);\n $model = new $className();\n $model->unguard();\n $model->fill(unserialize($modelData));\n $model->exists = true;\n $model->reguard();\n return $model;\n }",
"abstract public function instanceFactory($model): EloquentStorage;",
"public function create_model($map) {\n\n $billing_payment_extranet_model = new Billing_Payment_Extranet_Model();\n $billing_payment_extranet_model->populate($map);\n return $billing_payment_extranet_model;\n }",
"public function createModelObject($modelName){\n //$this->modelObject = new SignupModel;\n\n }",
"public function loadModel($modelName)\n {\n require 'application/models/' . strtolower($modelName) . '.php';\n // return new model (and pass the database connection to the model)\n return new $modelName($this->db);\n }",
"public static function factory($model, $id = NULL)\n\t{\t\n\t\t$class = Jelly_Meta::class_name($model);\n\t\t\n\t\treturn new $class($id);\n\t}",
"protected function model($model)\r\n {\r\n if (file_exists(ROOT_DIR . '/app/models/' . $model . '.php'))\r\n {\r\n require_once ROOT_DIR . '/app/models/' . $model . '.php';\r\n return new $model(self::$db);\r\n }\r\n return NULL;\r\n }",
"private function loadModel() {\n // name as requested resource.\n $name = $this->name.'Model';\n $path = str_replace(kPlaceholder, $this->version, kModelsFolder);\n $path = $path . $name . \".php\";\n // If it does not exist, go with\n // the default Model class.\n if (!file_exists($path)) {\n return new Model();\n } else {\n if (!class_exists($name)) {\n include $path;\n }\n\n return new $name();\n }\n }",
"public function create($data=null) {\n\t\t\treturn $this->_create_model_instance(parent::create($data));\n\t}",
"public function model($model){\n\n if(file_exists('../src/models/' . $model . '.php')){\n require_once '../src/models/' . $model . '.php';\n return new $model();\n } else {\n die('<strong>Fatal Error:</strong> Model <em>' . $model .'</em> does not exist');\n }\n }",
"protected function getModelInstance()\n {\n return new $this->model();\n }",
"public static function getModel($modelName){\n\t\t//$modelName::model() does not work on php 5.2! That's why we use this function.\n\t\t\n\t\t//backwards compat\n\t\t//$modelName = str_replace('_','\\\\', $modelName);\n\t\t\n\t\tif(!class_exists($modelName)){\t\t\t\n\n\t\t\t$entityType = \\go\\core\\orm\\EntityType::findByName($modelName);\n\t\t\t\n\t\t\tif(!$entityType) {\t\t\n\t\t\t\tthrow new \\Exception(\"Model class '$modelName' not found in \\GO::getModel()\");\n\t\t\t}\n\t\t\t\n\t\t\t$modelName = $entityType->getClassName();\n\t\t\t//return $modelName;\n\t\t} \n\t\t\n\n\t\t\n\t\tif(!method_exists($modelName, 'model')) {\n\t\t\treturn new $modelName(false);\n\t\t}\n\t\treturn call_user_func(array($modelName, 'model'));\n\t}",
"public function make($type);",
"protected function _newModel($class)\n {\n // instantiate\n $model = new $class($this);\n \n // done!\n return $model;\n }",
"public function create($type)\n {\n //\n }",
"public static function factory($model = FALSE, $id = FALSE)\n\t{\n\t\t$model = empty($model) ? __CLASS__ : ucfirst($model).'_Model';\n\t\treturn new $model($id);\n\t}",
"public static function getModel($classIdentifier = false){\n if($classIdentifier){\n $className = 'Model_' . str_replace(' ', '_', ucwords(str_replace('_', ' ', $classIdentifier)));\n //echo $className. \" blah\";\n return new $className();\n }\n return false;\n }",
"abstract protected function model();",
"abstract protected function model();",
"public function create($modelData);",
"public function loadModel ($name) { \n $modelName = $name . 'Model';\n if (class_exists($modelName, FALSE)) {\n return new $modelName($this->db);\n } else {\n $path = MODEL_PATH . strtolower($name) . '_model.php';\n // Check for model: Does such a model exist?\n if (file_exists($path)) {\n require MODEL_PATH . strtolower($name) . '_model.php'; \n // Return new model and pass the database connection to the model\n return new $modelName($this->db);\n } else {\n return null;\n }\n }\n }",
"public function model($model)\n\t{\n\t\trequire_once '../app/models/'.$model.'.php';\n\t\treturn new $model();\n\t}",
"private function makeModel()\n {\n\n $this->model = $this->app->make($this->model());\n\n if (!$this->model instanceof Model)\n throw new Exception(\"Class \".$this->model.\" must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n\n return $this->model;\n }",
"public function model($model)\n\t{\n\t\tif(file_exists(\"app/model/\".$model.\".php\"))\n\t\t{\n\t\t\trequire_once(\"app/model/\".$model.\".php\");\n\t\t\t$actual=explode(\"/\", $model);\n\t\t\t$main=end($actual);\n\t\t\treturn new $main;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(\"Model \".$model.\" not found\");\n\t\t}\n\t}",
"public static function factory( $modelClassName )\n\t{\n\t\t$factory = self::$factory;\n\t\treturn ( $factory ) ? $factory( $modelClassName ) : new $modelClassName();\n\t}",
"public function getModel()\n {\n return new $this->model;\n }",
"public function create(Model $model);",
"abstract public function getModel($name);",
"protected function model() {\n\t\t$model = Config::get('auth.model');\n\n\t\treturn new $model;\n\t}",
"public abstract function model();",
"private function newModel(){\n\t\t$this->assign('title', 'New Model');\n\t\t$this->assign('types', $this->getModelTypes());\n\t\t$this->display('model/new.tpl');\n\t}",
"abstract public function model();",
"abstract public function model();",
"abstract public function model();",
"abstract public function model();",
"abstract function model();",
"abstract function model();",
"abstract function model();",
"abstract function model();",
"public function __construct(){\n\n\t\t$this->types_model = new Types();\n\t}",
"public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }",
"protected function typeFactory($type) {\n switch ($type) {\n case \"Customers\":\n echo \"calling Propel on Customers!\";\n break;\n case \"Products\":\n echo \"calling propel on products!\";\n break;\n case \"Orders\":\n echo \"calling propel on orders!\";\n break;\n default:\n echo \"error: no valid type provided\";\n }\n }",
"public function model($model)\n\t{\n\t\trequire_once INC_ROOT .'/app/models/'. $model .'.php';\n\t\treturn new $model();\n\t}",
"function getModel($model)\n{\n $models = [];\n /* $models['Address'] = new Address;\n $models['Agency'] = new Agency;\n $models['AgencyBranch'] = new AgencyBranch;\n $models['AgencySolicitorPartnership'] = new AgencySolicitorPartnership;\n $models['Cache'] = new Cache;\n $models['ConveyancingCase'] = new ConveyancingCase;\n $models['User'] = new User;\n $models['UserAddress'] = new UserAddress;\n $models['UserPermission'] = new UserPermission;\n $models['UserRole'] = new UserRole;*/\n $models['TargetsAgencyBranch'] = new TargetsAgencyBranch;\n return $models[$model];\n}",
"public function newModel($name)\n {\n $class = $this->getClass($name);\n return $this->_newModel($class);\n }",
"function getModel($model, $params = array()) {\n $model = \"app\\\\models\\\\\" . $model . \"Model\";\n return new $model($params);\n }",
"public static function dynamicInstanceModel(string $model)\n {\n $model = '\\\\App\\\\' . str_replace('_', '', ucwords(str_replace('_id', '', $model), '_'));\n return new $model;\n }",
"public function setupModel() {\n\t\tswitch ($this->dbType()) {\n\t\tcase self::DB_TYPE_MYSQL: default:\n\t\t\ttry {\n\t\t\t\t$theSql = $this->getTableDefSql(self::TABLE_Permissions);\n\t\t\t\t$this->execDML($theSql);\n\t\t\t\t$this->debugLog($this->getRes('install/msg_create_table_x_success/'.$this->tnPermissions));\n\t\t\t} catch (PDOException $pdoe){\n\t\t\t\tthrow new DbException($pdoe,$theSql);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}",
"public function create(Request $request): Model;",
"public function createModel()\n {\n return \\Model::factory(Group::class)->create();\n }",
"public function getModelClass();",
"public function getModelClass();"
] | [
"0.70645475",
"0.6865346",
"0.6845526",
"0.6450564",
"0.6404483",
"0.6363523",
"0.6342498",
"0.62740594",
"0.62740594",
"0.62611127",
"0.6224647",
"0.6217143",
"0.6192727",
"0.6181056",
"0.6127018",
"0.61152554",
"0.60786146",
"0.6075744",
"0.6073326",
"0.6042072",
"0.6028411",
"0.6019817",
"0.60100436",
"0.60063714",
"0.6002158",
"0.59956396",
"0.5981966",
"0.59767973",
"0.5951936",
"0.59377074",
"0.5914059",
"0.590515",
"0.5888796",
"0.5857541",
"0.5836647",
"0.58186907",
"0.581422",
"0.5811727",
"0.5810957",
"0.5809256",
"0.580226",
"0.5786663",
"0.57827145",
"0.578151",
"0.57744706",
"0.5773677",
"0.57677525",
"0.57356155",
"0.5715651",
"0.5715607",
"0.5700051",
"0.5688634",
"0.56860656",
"0.56737924",
"0.56697464",
"0.565806",
"0.5653722",
"0.5644317",
"0.5636694",
"0.5633032",
"0.56284976",
"0.5625627",
"0.56106067",
"0.56093925",
"0.5601928",
"0.5600167",
"0.55930555",
"0.55930555",
"0.5588209",
"0.5585366",
"0.55837643",
"0.55736935",
"0.55664814",
"0.556291",
"0.55573815",
"0.55480057",
"0.5538521",
"0.5534981",
"0.55342895",
"0.55309564",
"0.55307066",
"0.55307066",
"0.55307066",
"0.55307066",
"0.5528879",
"0.5528879",
"0.5528879",
"0.5528879",
"0.5521301",
"0.55198956",
"0.55185074",
"0.55073076",
"0.5505129",
"0.5504723",
"0.5501627",
"0.5500572",
"0.5496004",
"0.5491022",
"0.5482008",
"0.5479635",
"0.5479635"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
//
} | {
"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()
{
//
} | {
"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 é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)
{
//
} | {
"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(StatusOrder $statusOrder)
{
//
} | {
"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(StatusOrder $statusOrder)
{
//
} | {
"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, StatusOrder $statusOrder)
{
DB::beginTransaction();
try {
$statusOrder->order_id = $request->order_id;
$statusOrder->process_order_id = $request->process_order_id;
$statusOrder->update();
// DB::table('user_status_orders')
// ->join('status_orders','user_status_orders.status_order_id','=','status_orders.id')
// ->where('status_order_id',$statusOrder->id)
// ->update(['user_id' => Auth::user()->id]);
$user_status_order = UserStatusOrder::find($statusOrder->id);
$user_status_order->user_id = Auth::user()->id;
$user_status_order->update();
// step 2 if all good commit
DB::commit();
} catch (\Exception $exception) {
// step 3 if some error rollback
DB::rollBack();
}
return redirect()->route('home');
} | {
"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(StatusOrder $statusOrder)
{
//
} | {
"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 |
restsearchservice.php longdesc LICENSE: This source file is subject to version 4.0 of the Creative Commons license that is available through the worldwideweb at the following URI: | function sigorigval($origval,$origerr,$numplaces){
//Math from Noah McLean at MIT
$x=round($origval*pow(10,(($numplaces-1)-floor(log10(2*$origerr))))) * pow(10,((floor(log10(2*$origerr))))-($numplaces-1));
return($x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function rest_search() {\n\t\t// return json elements here\n\t}",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"function ap_register_search(){\n\t register_rest_route('americanpromise/v1','search', array(\n\t\t'methods' => \\WP_REST_SERVER::READABLE,\n\t\t'callback' => __NAMESPACE__ . '\\ap_search_results'\n\t));\n}",
"public function GetSearch(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $user_id = $_POST['user_id'];\n $keyword = $_POST['keyword'];\n $type = $_POST['type'];\n $user_auth_key = $_POST['user_auth_key'];\n $latitude = $_POST['latitude'];\n $longitude = $_POST['longitude'];\n $page_no = $_POST['page_no'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($keyword) && !empty($type) && !empty($user_auth_key) && !empty($page_no)){\n $result = $res->CheckAuthentication($user_id, $user_auth_key, $conn);\n if($result != false){\n $res->get_search($user_id, $keyword, $type, $latitude, $longitude, $page_no, $conn);\n $this->dbClose();\n }\n else{\n $this->dbclose();\n $error = array('status' => \"0\", \"msg\" => \"Not Authorised To get detail\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }",
"private function _search(){\n\t\tif($this->curluse){\n\t\t\ttry{\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $this->searchURL);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t\t\tif(isset($this->proxy_url) && isset($this->proxy_port)){\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy_port);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXY, $this->proxy_url);\n\t\t\t\t}\n\t\t\t\t$output = curl_exec($ch);\n\t\t\t\tif(curl_errno($ch))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Exception(curl_error($ch));\n\t\t\t\t}\n\t\t\t\tcurl_close($ch);\n\t\t\t\treturn $output;\n\t\t\t} catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ($stream = fopen($this->searchURL, 'r')) {\n\t\t\t\treturn stream_get_contents($stream);\n\t\t\t\tfclose($stream);\n\t\t\t}\n\t\t}\n\t}",
"function getSearch()\n\t{\n\t\t$search = $this->input->post('search');\n\t\t$response = $this->mapi->getSearch($search);\n\n\t\techo json_encode($response);\n\t}",
"function solr_proxy_main() {\n $params = array();\n\tglobal $userdata;\n\n // The names of Solr parameters that may be specified multiple times.\n $multivalue_keys = array('bf', 'bq', 'facet.date', 'facet.date.other', 'facet.field', 'facet.query', 'fq', 'pf', 'qf');\n\n foreach ($_GET as $key => $value) {\n if (in_array($key, $multivalue_keys)) {\n $params[$key][] = $value;\n }\n elseif ($key == 'q') {\n $keys = $value;\n }\n else {\n $params[$key] = $value;\n }\n }\n\n $hour = (time() / (60 * 60)) % 24;\n $app = (($hour / 4) % 2) ? '/solr' : '/solralt';\n $transportInstance = new Apache_Solr_HttpTransport_Curl(array(CURLOPT_USERPWD => $userdata, CURLOPT_HTTPAUTH => CURLAUTH_ANY));\n $solr = new Apache_Solr_Service('localhost', 8080, $app, $transportInstance); \n\n var_dump($params);\n\n try {\n if(!isset($params['start'])) {\n $params['start'] = 0;\n }\n $response = $solr->search($keys, $params['start'], $params['rows'], $params);\n }\n catch (Exception $e) {\n die($e->__toString());\n }\n print $response->getRawResponse();\n}",
"function searchResources( $q )\n {\n try\n {\n $params = ( is_array($q) && isset($q['q']) ) ? $q : array( 'q' => $q );\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources.json\",$params);\n return $this->createResponse($result,'search Resources','Search Criteria');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"function doAPISearch($params) {\n global $searchUrl;\n\n $ch = curl_init(); // initialize curl handle\n curl_setopt($ch, CURLOPT_URL,$searchUrl . $params);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable\n curl_setopt($ch, CURLOPT_TIMEOUT, 8); // times out after 4s\n curl_setopt($ch, CURLOPT_POST, 0); // set GET method\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n // Retrieve result\n $result = curl_exec($ch);\n // TODO return error if error\n // $cerror = curl_error($ch);\n\n return $result;\n}",
"public function searchuserAction(){\n\n $data = [ 'search' => 'search' , 'id' => 1 ];\n $client = new Client();\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest');\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setParameterPost(\n $data\n );\n $client->setMethod( Request::METHOD_POST );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }",
"function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }",
"function display_elastic_search ($q, $filter=null, $from = 0, $size = 20, $callback = '')\n{\n\tglobal $elastic;\n\t\n\t$status = 404;\n\t\t\t\t\n\tif ($q == '')\n\t{\n\t\t$obj = new stdclass;\n\t\t$obj->hits = new stdclass;\n\t\t$obj->hits->total = 0;\n\t\t$obj->hits->hits = array();\n\t\t\n\t\t$status = 200;\n\t}\n\telse\n\t{\t\t\n\t\t// query type\t\t\n\t\t$query_json = '';\n\t\t\n\t\tif ($filter)\n\t\t{\n\t\t\tif (isset($filter->author))\n\t\t\t{\n\t\t\t\t// author search is different( but not working yet)\t\n\t\t\t\t$query_json = \t\t\n\t'{\n\t\"size\":50,\n \"query\": {\n \"bool\": {\n \"must\": [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.author\"] \n\t\t\t\t}\n\t\t\t\t}]\n }\n }\n\t}';\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t\t\n\t\t\t// echo $query_json;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default is search on fulltext fields\n\t\tif ($query_json == '')\n\t\t{\n\t\t\t$query_json = '{\n\t\t\t\"size\":50,\n\t\t\t\t\"query\": {\n\t\t\t\t\t\"bool\" : {\n\t\t\t\t\t\t\"must\" : [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.fulltext\", \"search_data.fulltext_boosted^4\"] \n\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\"filter\": <FILTER>\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"aggs\": {\n\t\t\t\"type\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.type.keyword\" }\n\t\t\t },\n\t\t\t \"year\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.year\" }\n\t\t\t },\n\t\t\t \"container\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.container.keyword\" }\n\t\t\t },\n\t\t\t \"author\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.author.keyword\" }\n\t\t\t },\n\t\t\t \"classification\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.classification.keyword\" }\n\t\t\t } \n\n\t\t\t}\n\n\t\n\t\t\t}';\n\t\t\t\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t}\n\t\n\t$filter_string = '[]';\n\t\n\tif ($filter)\n\t{\n\t\t$f = array();\n\t\t\n\t\tif (isset($filter->year))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.year'} = $filter->year;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\n\t\t// this doesn't work\n\t\tif (isset($filter->author))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.author'} = $filter->author;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\t\t\n\t\t$filter_string = json_encode($f);\n\t}\n\t\n\t$query_json = str_replace('<FILTER>', $filter_string, $query_json);\n\t\n\t\n\t$resp = $elastic->send('POST', '_search?pretty', $post_data = $query_json);\n\t\n\n\t\t$obj = json_decode($resp);\n\n\t\t$status = 200;\n\t}\n\t\n\tapi_output($obj, $callback, 200);\n}",
"function BingWebSearch ($url, $key, $query,$count,$offset) {\n // Prepare HTTP request\n // NOTE: Use the key 'http' even if you are making an HTTPS request. See:\n // http://php.net/manual/en/function.stream-context-create.php\n $headers = \"Ocp-Apim-Subscription-Key: $key\\r\\n\";\n $options = array ('http' => array (\n 'header' => $headers,\n 'method' => 'GET'));\n\n // Perform the Web request and get the JSON response\n $context = stream_context_create($options);\n\n\n $result = file_get_contents($url . \"?q=\" . urlencode($query).\"&count=\".$count.\"&offset=\".$offset, false, $context);\n\n // Extract Bing HTTP headers\n $headers = array();\n foreach ($http_response_header as $k => $v) {\n $h = explode(\":\", $v, 2);\n if (isset($h[1]))\n if (preg_match(\"/^BingAPIs-/\", $h[0]) || preg_match(\"/^X-MSEdge-/\", $h[0]))\n $headers[trim($h[0])] = trim($h[1]);\n }\n\n return array($headers, $result);\n }",
"public function GetSearchNameList(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $type = $_POST['type'];\n $user_auth_key = $_POST['user_auth_key'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($type) && !empty($user_auth_key)){\n $result = $res->CheckAuthentication('', $user_auth_key, $conn);\n if($result != false){\n $res->get_search_name_list($type, $conn);\n $this->dbClose();\n }\n else{\n $this->dbclose();\n $error = array('status' => \"0\", \"msg\" => \"Not Authorised To get detail\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }",
"function search($institution, $queryType, $queryTerm, $start=0, $limit=10)\n\t{\n\t\t\n\t\tif (strcasecmp($institution,'CASENT') == 0) { $institution = 'CASENT'; }\n\t\tif (strcasecmp($institution,'inbiocri') == 0) { $institution = 'CASENT'; }\n\t\tif (strcasecmp($institution,'lacment') == 0) { $institution = 'CASENT'; }\t\n\t\tif (strcasecmp($institution,'jtlc') == 0) { $institution = 'CASENT'; }\t\n\t\t\n\t\t\n\t\t$server = $this->serverURL[$institution];\n\t\t$resource = $this->resourceCode[$institution] ;\n\n\t\t// Build request message\n\t\t$tree = new XML_Tree();\n\n\t\t$root = & $tree->addRoot(\n\t\t\t\"request\",\n\t\t\t'',\n\t\t\tarray(\n\t\t\t\t\t\"xmlns\" => 'http://digir.net/schema/protocol/2003/1.0',\n\t\t\t\t\t\"xmlns:xsd\" => 'http://www.w3.org/2001/XMLSchema',\n\t\t\t\t\t\"xmlns:xsi\" => 'http://www.w3.org/2001/XMLSchema-instance',\n\t\t\t\t\t\"xmlns:digir\" => 'http://digir.net/schema/protocol/2003/1.0',\n\t\t\t\t\t\"xmlns:dwc\" => 'http://digir.net/schema/conceptual/darwin/2003/1.0',\n\t\t\t\t\t\"xmlns:darwin\" => 'http://digir.net/schema/conceptual/darwin/2003/1.0',\n\t\t\t\t\t\"xsi:schemaLocation\" => 'http://digir.net/schema/protocol/2003/1.0',\n\t\t\t\t\t\"xsi:schemaLocation\" => 'http://digir.net/schema/protocol/2003/1.0 http://digir.sourceforge.net/schema/protocol/2003/1.0/digir.xsd http://digir.net/schema/conceptual/darwin/2003/1.0 http://digir.sourceforge.net/schema/conceptual/darwin/2003/1.0/darwin2.xsd',\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t$header = & $root->addChild(\"header\");\n\t\t$header->addChild(\"version\", \"1.0.0\");\n\t\t$header->addChild(\"sendTime\", date(\"Ymd \\TG:i:s\") ); \n\t\t$header->addChild(\"source\", $_SERVER['SERVER_ADDR']); \n\t\t$header->addChild(\"destination\", \n\t\t\t$server,\n\t\t\tarray(\n\t\t\t\t\"resource\" => $resource\n\t\t\t\t)\n\t\t\t); \n\t\t$header->addChild(\"type\", \"search\");\n\n\t\t$search = & $root->addChild(\"search\");\n\t\t$filter = & $search->addChild(\"filter\");\n\t\t$equals = & $filter->addChild(\"equals\");\n\t\t\n\t\tswitch($queryType)\n\t\t{\n\t\t\tcase 'genus':\n\t\t\t\t$equals->addChild(\"darwin:Genus\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'family':\n\t\t\t\t$equals->addChild(\"darwin:Family\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'class':\n\t\t\t\t$equals->addChild(\"darwin:Class\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'country':\n\t\t\t\t$equals->addChild(\"darwin:Country\", $queryTerm);\n\t\t\t\tbreak;\n\t\t\tcase 'specimen':\n\t\t\t\tswitch ($this->schema[$institution])\n\t\t\t\t{\n\t\t\t\t\tcase \"1.14\":\n\t\t\t\t\t\t$equals->addChild(\"darwin:CatalogNumber\", $queryTerm);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$equals->addChild(\"darwin:CatalogNumberText\", $queryTerm);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$records = & $search->addChild(\"records\",\n\t\t\t\"\",\n\t\t\tarray(\n\t\t\t\t\"limit\" => $limit,\n\t\t\t\t\"start\" => $start\n\t\t\t\t)\n\t\t\t);\n\t\t\t\tif ($this->schema[$institution] == '1.12')\n\t\t\t\t{\n\t\t\t\t$records->addChild(\"structure\",\n\t\t\t\t\t\"\",\n\t\t\t\t\tarray(\n\t//\t\t\t\t\t\"schemaLocation\" => \"http://bnhm.berkeley.museum/manis/DwC/darwin2resultfull.xsd\",\n\n\t\t\t\t\t\t\"schemaLocation\" => \"http://digir.sourceforge.net/schema/conceptual/darwin/result/full/2003/darwin2resultfull.xsd\",\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{\n\n\t\t\t\t\t$structure = & $records->addChild(\"structure\", \"\");\n\n\t\t\t\t\t$element = & $structure->addChild(\"xsd:element\", \"\", \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"name\" => \"record\"\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t$complexType = & $element->addChild(\"xsd:complexType\", \"\");\n\t\t\t\t\t$sequence = & $complexType->addChild(\"xsd:sequence\", \"\");\n\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:InstitutionCode\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:CollectionCode\"\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:CatalogNumber\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:ScientificName\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:VerbatimCollectingDate\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:DateLastModified\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:YearCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:MonthCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:DayCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:TimeCollected\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Kingdom\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Phylum\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Class\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Order\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Family\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Genus\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Species\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Subspecies\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Country\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:StateProvince\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:County\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Island\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:IslandGroup\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:ContinentOcean\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Locality\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:HorizontalDatum\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Collector\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Remarks\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:TypeStatus\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:OtherCatalogNumbers\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:CollectorNumber\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:FieldNumber\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:GenBankNum\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Latitude\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Longitude\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Sex\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:Notes\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:IdentifiedBy\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:YearIdentified\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:MonthIdentified\"\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$sequence->addChild(\"xsd:element\", \"\",\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"ref\" => \"darwin:DayIdentified\"\n\t\t\t\t\t\t\t));\n\n\n\n\n\t\t\t\t}\n\t\t$xml = \t$tree->get();\n\n\t\t//echo $xml;\n\n\t\t// Strip XML header\n\t\t$xml = str_replace (\n\t\t\t'<?xml version=\"1.0\"?>', \n\t\t\t'', \n\t\t\t$xml);\n\n\t\t// Remove line breaks\n\t\t$xml = str_replace (\n\t\t\t\"\\n\", \n\t\t\t'', \n\t\t\t$xml);\n\n\t\t// Replace spaces with HEX code\n\t\t$xml = str_replace (\n\t\t\t\" \", \n\t\t\t'%20', \n\t\t\t$xml);\n\n\t\t\t//echo $xml;\n\n\t\t\t$url = \"http://$server?doc=\";\n\t\t\t$url .= $xml;\n\n\t\t//echo $url;\n\n\t\treturn $url;\n\n\n\n\t\t\n\t}",
"public function search()\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $this->getUrl());\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n ob_start();\n curl_exec($ch);\n $response = ob_get_contents();\n ob_end_clean();\n\n curl_close($ch);\n\n return $response;\n }",
"function product_search($query_string = false, $lang = 'en_us')\n\t{\n\t\t$lang = str_replace('_', '-', $lang);\n\t\t\n\t\tif (!empty($query_string))\n\t\t{\n\t\t\n\t\t\t$query = explode(' ', $query_string);\n\t\t\n\t\t}\n\t\t\n\t\t$content = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t\t<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\t\t\t\t<soap:Header>\n\t\t\t\t\t<ServiceAuthHeader xmlns=\"http://tempuri.org/\">\n\t\t\t\t\t\t<UserName>' . $this->username . '</UserName>\n\t\t\t\t\t\t<Password>' . $this->password . '</Password>\n\t\t\t\t\t</ServiceAuthHeader>\n\t\t\t\t</soap:Header>\n\t\t\t\t<soap:Body>\n\t\t\t\t\t<product_search xmlns=\"http://tempuri.org/\">';\n\t\tif (!empty($query)) {\n\t\t\tforeach ($query as $q) $content .= '<search_terms>' . $q . '</search_terms>';\n\t\t}\n\t\t$content .=\t'<lang>'.$lang.'</lang></product_search>\n\t\t\t\t</soap:Body>\n\t\t\t</soap:Envelope>';\n\t\t\n\t\t$headers = array( \n\t\t\t'POST /redactedapiservice.asmx HTTP/1.1',\n\t\t\t'Host: 000.00.000.185',\n\t\t\t'Content-Type: text/xml; charset=utf-8',\n\t\t\t'Content-Length: ' . strlen($content),\n\t\t\t'SOAPAction: \"http://tempuri.org/product_search\"',\n\t\t);\n\t\t\n\t\treturn $this->_init_curl($content, $this->url, $headers);\n\t\t\n\t}",
"function searchListExample($service, $part, $optParams)\n{\n\ttry\n\t{\n\t\t// Parameter validation.\n\t\tif ($service == null)\n\t\t\tthrow new Exception(\"service is required.\");\n\t\tif ($optParams == null)\n\t\t\tthrow new Exception(\"optParams is required.\");\n\t\tif (part == null)\n\t\t\tthrow new Exception(\"part is required.\");\n\t\t// Make the request and return the results.\n\t\treturn $service->search->ListSearch($part, $optParams);\n\t}\n\tcatch (Exception $e)\n\t{\n\t\tprint \"An error occurred: \" . $e->getMessage();\n\t}\n}",
"public function search()\n {\n return $this->call('GET', $this->endpoint);\n }",
"function getsearch_get(){\n $keyword = $this->get('keyword');\n $result = $this->lecturers_model->getsearch_all($keyword);\n $this->response($result); \n\n }",
"function curl_index($vs = null, $ev = null, $search = null)\n\t{\n\t\t\n\t\t$url \t = 'http://webbond.seminolesheriff.org/Search.aspx';\n\t\t$headers = array('GET /public/ArRptQuery.aspx HTTP/1.1',\n\t\t\t\t\t'Host: www.sheriffseminole.org',\n\t\t\t\t\t'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1',\n\t\t\t\t\t'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n\t\t\t\t\t'Accept-Language: en-us,en;q=0.5',\n\t\t\t\t\t'Accept-Encoding: gzip, deflate',\n\t\t\t\t\t'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',\n\t\t\t\t\t'Keep-Alive: 115',\n\t\t\t\t\t'Connection: keep-alive',\n\t\t\t\t\t'Cookie: ASP.NET_SessionId=hhwz3u45zmuiddbhqwy2y1rw',\n\t\t\t\t\t'Cache-Control: max-age=0');\n\t\t$ch = curl_init(); \n \tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookies);\n\t\tcurl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookies);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tif ($ev && $vs && $search)\n\t\t{\n\t\t\t$fields = '__EVENTTARGET=&__EVENTARGUMENT=&__LASTFOCUS=&__VIEWSTATE='.urlencode($vs).'&__EVENTVALIDATION='.urlencode($ev).'&ctl00%24ContentPlaceHolder1%24ddllist=Last+Name&ctl00%24ContentPlaceHolder1%24txtTST='.urlencode($search).'&ctl00%24ContentPlaceHolder1%24Button1=Search';\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n\t\t}\n\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $index = curl_exec($ch);\n curl_close($ch);\n\t\treturn $index;\n\t}",
"public static function SearchOffer(){\n\n\n\n\t\t}",
"public function search();",
"public function search();",
"public function adv_data_search_get()\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n\n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $data = file_get_contents('php://input', 'r');\n \n $json = $sutil->adv_data_search($data, $from, $size);\n $this->response($json);\n }",
"function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}",
"function search($term, $location, $price, $radius, $categories, $sort) {\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $location;\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\n\t$url_params['open_now'] = true;\n $url_params['price'] = $price;\n $url_params['radius'] = $radius;\n $url_params['categories'] = $categories;\n $url_params['sort_by'] = $sort;\n \n return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n}",
"public function getSearch();",
"public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}",
"function optimatRegisterSearch() {\n\t// new api search url: 1. name 2. route\n\tregister_rest_route('optimat/v1', 'search', array(\n\t\t'methods' => WP_REST_SERVER::READABLE, // like 'GET'\n\t\t'callback' => 'optimatSearchResults'\n\t)); \n}",
"function api($object, $search, $start = 0, $limit = 30)\n\t{\n\t\t$this->load->library('apiaccess');\n\t\t$this->apiaccess->check(true);\n\t\tif(strlen($search) < $this->config->item('min_chars'))\n\t\t{\n\t\t\t$results = array('error' => array('message' => 'You have to enter minimum ' . $this->config->item('min_chars') . ' characters to get any results!', 'reason' => 'min_letters'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($start != (string) (int) $start) $start = 0;\n\t\t\tif($limit != (string) (int) $limit) $limit = 30;\n\t\t\tif(1 > $limit || $limit > $this->config->item('max_results')) $limit = 30;\n\t\t\t$search = urldecode($search);\n\t\t\tif($object == 'user')\n\t\t\t{\n\t\t\t\t$results = $this->_search_user($search, $start, $limit);\n\t\t\t}\n\t\t\t$results['results'] = count($results);\n\t\t}\n\t\t$this->output->set_content_type('application/json')->set_output(json_encode($results));\n\t}",
"public function searches($method='GET')\n\t{\n $this->data['message'] = lang_check('Hello, API here!');\n\n echo json_encode($this->data);\n exit();\n\t}",
"public function getTimelineBySearch_get() {\n extract($_GET);\n //------------checking the limit is empty or numeric------------//\n\n if (!(is_numeric($limit))) {\n if (empty($limit)) {\n $this->response([\n 'status' => 500,\n 'status_message' => 'Data Not Found.!'], REST_Controller::HTTP_PRECONDITION_FAILED);\n } else {\n $this->response([\n 'status' => 500,\n 'status_message' => 'Limit should be numeric!'], REST_Controller::HTTP_PRECONDITION_FAILED);\n }\n }\n //--------------------ends---------------------------------//\n //------------checking the limit is empty or numeric------------//\n\n if (!(is_numeric($start))) {\n if (empty($start)) {\n $this->response([\n 'status' => 500,\n 'status_message' => 'Data Not Found.!'], REST_Controller::HTTP_PRECONDITION_FAILED);\n } else {\n $this->response([\n 'status' => 500,\n 'status_message' => 'Start value should be numeric!'], REST_Controller::HTTP_PRECONDITION_FAILED);\n }\n }\n \n $result = $this->feeds_model->getTimelineBySearch($limit, $start, $search);\n // print_r($result);die(); \n switch ($result['status']) {\n case '200': //-----------------if response is 200 it returns login successful\n $this->response([\n 'status' => 200,\n 'PRODUCTIMAGE_PATH' => PRODUCTIMAGE_PATH,\n 'PROFILEIMAGEPATH' => PROFILEIMAGE_PATH,\n 'status_message' => $result['status_message']], REST_Controller::HTTP_OK);\n break;\n\n case '500': //-----------------if response is 500 it returns error message\n $this->response([\n 'status' => 500,\n 'status_message' => 'Oops! No more Feeds available.'], REST_Controller::HTTP_PRECONDITION_FAILED);\n break;\n\n default:\n $this->response([\n 'status' => 500,\n 'status_message' => \"Something went wrong. Request was not send...!!!\"], REST_Controller::HTTP_PRECONDITION_FAILED);\n break;\n }\n }",
"public function testSearchUsingGET()\n {\n\n }",
"public function testSearchApi()\n {\n $response = $this->callJsonApi('GET', '/api/v1/resources/search');\n $code = $response['response']['code'];\n $this->assertSame(200, $code);\n $this->assertSame(16, $response['result']['query']['total']);\n $this->assertSame(16, count($response['result']['hits']));\n }",
"public function serviceSearch($search){\n $this->getDataAccessObject()->daoSearch($search);\n }",
"private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }",
"public function search(Classes\\SearchRequest $arg) {\n\t\treturn $this->makeSoapCall(\"search\", $arg);\n\t}",
"public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }",
"public function getSearchResults($keywords, $maxResults, $fixedPriceOnly = false)\n\t{\n\t\t$keywords = urlencode(htmlentities(strip_tags(trim($keywords)))); //remove html from query\n\t\t$priceRangeMax = 500;\n\t\t$priceRangeMin = 0.0;\n\t\t$itemType = \"\";\n\t\t\n\t\tif($fixedPriceOnly)\n\t\t{\n\t\t\t$itemType = \"FixedPricedItem\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$itemType = \"AllItems\";\n\t\t}\n\t\t\n\t\t// Construct the FindItems call \n $apicall = $this->endPoint.\"?callname=FindItemsAdvanced\"\n . \"&version=537\"\n . \"&siteid=\". SITE_ID\n . \"&appid=\". APP_ID\n . \"&QueryKeywords=$keywords\"\n . \"&MaxEntries=$maxResults\"\n . \"&ItemSort=EndTime\"\n . \"&ItemType=\". $itemType\t\t// AllItemTypes or AllItems\n . \"&PriceMin.Value=$priceRangeMin\"\n . \"&PriceMax.Value=$priceRangeMax\"\n . \"&IncludeSelector=SearchDetails\" \n . \"&trackingpartnercode=9\"\n . \"&trackingid=\". TRACKING_ID\n . \"&affiliateuserid=\".USER_ID\n . \"&CategoryID=\". CATEGORY_ID\n . \"&responseencoding=\". RESPONSE_ENCODING;\n \n //try:\n //SortOrder=Ascending&MaxEntries\n \n $this->xmlResponse = simplexml_load_file($apicall);\n \n //print_r($this->xmlResponse);\n \n if ($this->xmlResponse && $this->xmlResponse->TotalItems > 0)\n {\n \tforeach($this->xmlResponse->SearchResult->ItemArray->Item as $item)\n \t{\n \t\t$link = $item->ViewItemURLForNaturalSearch;\n \t\t$title = $item->Title;\n \t\t\n \t\tif($item->GalleryURL) \n \t\t{\n \t\t$thumbURL = $item->GalleryURL;\n \t\t} \n \t\telse \n \t\t{\n \t\t$thumbURL = \"img/pic.gif\";\n \t\t\t}\n \t\t\t\n \t\t\t$price = sprintf(\"%01.2f\", $item->ConvertedCurrentPrice);\n \t\t\t\n \t\t\t/*\n \t\t$ship = sprintf(\"%01.2f\", $item->ShippingCostSummary->ShippingServiceCost);\n \t\t$total = sprintf(\"%01.2f\", ((float)$item->ConvertedCurrentPrice \n + (float)$item->ShippingCostSummary->ShippingServiceCost));\n */\n \t\t\t \n\t\t\t\t\t\t// Determine currency to display - so far only seen cases where priceCurr = shipCurr, but may be others\n \t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$priceCurr = (string) $item->ConvertedCurrentPrice['currencyID'];\n \t\t$shipCurr = (string) $item->ShippingCostSummary->ShippingServiceCost['currencyID'];\n \t\t\n \t\tif ($priceCurr == $shipCurr) \n \t\t{\n \t\t$curr = $priceCurr;\n \t\t} \n \t\telse \n \t\t{\n \t\t$curr = \"$priceCurr / $shipCurr\"; // potential case where price/ship currencies differ\n \t\t}\n \t\t\t\t\t*/\n \t\t\n\t\t\t\t\t\t$timeLeft = $this->getPrettyTimeFromEbayTime($item->TimeLeft); \n \t\t//$endTime = strtotime($item->EndTime); // returns Epoch seconds\n \t\t//$endTime = $item->EndTime;\n \t\t\n \t\t/**\n \t\t * Here you echo out the info for each result /////////////////////////////////////\n \t\t */\n \t\techo 'Price: ' .$price;\n\t\t\t\t\t\techo 'Title: ' .$title;\n\t\t\t\t\t\techo 'url: ' .$link;\n \t\t\n \t}//foreach\n }\n else\n {\n \t//echo \"Sorry, No Results.\";\n }\n \n\t}",
"public function search()\n\t{\n\t\t\n\t}",
"public function action_search_doc()\n\t{\n\t\tglobal $context;\n\n\t\t$context['doc_apiurl'] = 'https://github.com/elkarte/Elkarte/wiki/api.php';\n\t\t$context['doc_scripturl'] = 'https://github.com/elkarte/Elkarte/wiki/';\n\n\t\t// Set all the parameters search might expect.\n\t\t$postVars = explode(' ', $context['search_term']);\n\n\t\t// Encode the search data.\n\t\tforeach ($postVars as $k => $v)\n\t\t{\n\t\t\t$postVars[$k] = urlencode($v);\n\t\t}\n\n\t\t// This is what we will send.\n\t\t$postVars = implode('+', $postVars);\n\n\t\t// Get the results from the doc site.\n\t\trequire_once(SUBSDIR . '/Package.subs.php');\n\t\t// Demo URL:\n\t\t// https://github.com/elkarte/Elkarte/wiki/api.php?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=template+eval\n\t\t$search_results = fetch_web_data($context['doc_apiurl'] . '?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=' . $postVars);\n\n\t\t// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?\n\t\tif (!$search_results || preg_match('~<' . '\\?xml\\sversion=\"\\d+\\.\\d+\"\\?' . '>\\s*(<api>.+?</api>)~is', $search_results, $matches) !== 1)\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t$search_results = !empty($matches[1]) ? $matches[1] : '';\n\n\t\t// Otherwise we simply walk through the XML and stick it in context for display.\n\t\t$context['search_results'] = array();\n\n\t\t// Get the results loaded into an array for processing!\n\t\t$results = new XmlArray($search_results, false);\n\n\t\t// Move through the api layer.\n\t\tif (!$results->exists('api'))\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t// Are there actually some results?\n\t\tif ($results->exists('api/query/search/p'))\n\t\t{\n\t\t\t$relevance = 0;\n\t\t\tforeach ($results->set('api/query/search/p') as $result)\n\t\t\t{\n\t\t\t\t$title = $result->fetch('@title');\n\t\t\t\t$context['search_results'][$title] = array(\n\t\t\t\t\t'title' => $title,\n\t\t\t\t\t'relevance' => $relevance++,\n\t\t\t\t\t'snippet' => str_replace('class=\\'searchmatch\\'', 'class=\"highlight\"', un_htmlspecialchars($result->fetch('@snippet'))),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function gc_get_from_api() {\n $keyword = $_POST['keyword'];\n $hub = $_POST['hub'];\n $type = $_POST['type'];\n $url = 'https://graphcommons.com/api/v1/' . $type . 's/search?query='. urlencode($keyword) . '&limit=' . $this->api_limit;\n\n if ( $hub !== '' ) {\n $url = $url . '&hub=' . $hub;\n }\n\n $this->gc_get_url_and_print_json( $url );\n }",
"public function searchAction() {\n\t\n\t if($this->getRequest()->isXmlHttpRequest()){\n\t\n\t $term = $this->getParam('term');\n\t $id = $this->getParam('id');\n\t\n\t if(!empty($term)){\n\t $term = \"%$term%\";\n\t $records = Invoices::findbyCustomFields(\"formatted_number LIKE ? OR number LIKE ?\", array($term, $term));\n\t die(json_encode($records));\n\t }\n\t\n\t if(!empty($id)){\n\t $records = Invoices::find($id);\n\t if($records){\n\t $records = $records->toArray();\n\t }\n\t die(json_encode(array($records)));\n\t }\n\t\n\t $records = Invoices::getAll();\n\t die(json_encode($records));\n\t }else{\n\t die();\n\t }\n\t}",
"function fullTextSearch($client, $html, $query)\n{\n if ($html) {echo \"<h2>Documents containing $query</h2>\\n\";}\n\n $feed = $client->getDocumentListFeed(\n 'https://docs.google.com/feeds/documents/private/full?q=' . $query);\n\n printDocumentsFeed($feed, $html);\n}",
"public function __construct( ){\n parent::__construct();\n // Get and set search options.\n $this->searchOptions = new stdClass();\n $this->searchOptions->searchDescription = \"false\"; // Should we search in the description? [true,false]\n $this->searchOptions->entriesPerPage = 10; // [Min: 1. Max: 100. Default: 100.]\n $this->searchOptions->pageToGet = 1; // [Min: 1. Max: 100. Default: 1.]\n $this->searchOptions->filters = array(); // Filter our search - Array(array('name' => 'filtername','value' => 'filtervalue','paramName' => 'name','paramValue' => 'value'));\n $this->searchOptions->aspects = array(); // Aspect filter - Array(\"aspectName1\" => array(\"value1\", \"value2\", \"value3\"...),\"aspectName2\" => array(\"value1\", \"value2\", \"value3\"...)...)\n $this->searchOptions->categories = array(); // Categories for the search - Array(\"categoryID1\", \"categoryID2\", \"categoryID3\"...)\n $this->searchOptions->sortOrder = \"BestMatch\"; // Search results sorting order. [BestMatch, PricePlusShippingHighest, PricePlusShippingLowest]\n $this->searchOptions->searchQuery = \"\"; // Our search query.\n\n // Default comms header.\n $this->headers = array();\n $this->_setDefaultHeaders();\n }",
"function culturefeed_search_ui_redirect_cnapi_urls() {\n\n $new_query = array();\n\n // Check if we are on a searchable page.\n $current_search_page = culturefeed_get_searchable_type_by_path();\n if (!$current_search_page) {\n return;\n }\n\n // Regio is now location.\n if (isset($_GET['regio'])) {\n $region = db_query('SELECT name FROM {culturefeed_search_terms} WHERE tid = :tid', array(':tid' => 'reg.' . $_GET['regio']))->fetchField();\n if ($region) {\n $new_query['location'] = $region;\n }\n }\n\n // City id is now location.\n if (isset($_GET['cityid'])) {\n $result = db_query('SELECT name, zip FROM {culturefeed_search_cities} WHERE cid = :cityid', array(':cityid' => $_GET['cityid']))->fetchObject();\n if ($result) {\n $new_query['location'] = $result->zip . ' ' . $result->name;\n }\n }\n\n // City can be mapped to location.\n if (isset($_GET['city'])) {\n $query = $_GET['city'];\n $new_query['location'] = $query;\n }\n\n // Query is now search.\n if (isset($_GET['query'])) {\n $query = $_GET['query'];\n $new_query['search'] = $query;\n }\n\n // K is now keyword.\n if (isset($_GET['k'])) {\n $k = $_GET['k'];\n $new_query['keyword'] = $k;\n }\n\n // Datetype is now facet[datetype][0].\n if (isset($_GET['datetype'])) {\n $datetype = $_GET['datetype'];\n $new_query['facet']['datetype'][0] = $datetype;\n }\n\n // Date is now date_range.\n if (isset($_GET['date'])) {\n $date = $_GET['date'];\n $new_date = date(\"d/m/Y\", strtotime($date));\n $new_query['date_range'] = $new_date;\n }\n\n // Headings are now a combination of facets.\n if (isset($_GET['heading'])) {\n\n if (strpos($_GET['heading'], ';') !== false) {\n $heading = explode(';', $_GET['heading']);\n if ($heading[0] !== '') {\n $heading = $heading[0];\n }\n else {\n $heading = $heading[1];\n }\n }\n else {\n $heading = $_GET['heading'];\n }\n\n $mapping = culturefeed_search_ui_get_headings_mapping($heading);\n\n // Voor kinderen is not a facet\n if (isset($mapping['voor_kinderen'])) {\n $new_query['voor-kinderen'] = '1';\n unset($mapping['voor_kinderen']);\n }\n foreach ($mapping as $category => $id) {\n $new_query['facet'][$category][0] = $id;\n }\n }\n\n if (!empty($new_query)) {\n drupal_goto(current_path(), array('query' => $new_query), 301);\n }\n\n}",
"public function search(){}",
"public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}",
"public function search()\n {\n $domains = Configure::read('AccessControlAllowOrigin');\n $this->response->cors($this->request)\n ->allowOrigin($domains)\n ->allowMethods(['GET'])\n ->allowHeaders(['X-CSRF-Token'])\n ->maxAge(300)\n ->build();\n\n $version = '2-2';\n if (!empty($this->request->query['version'])) {\n $version = $this->request->query['version'];\n }\n if (empty($this->request->query['lang'])) {\n throw new BadRequestException();\n }\n $lang = $this->request->query['lang'];\n\n $page = 1;\n if (!empty($this->request->query['page'])) {\n $page = $this->request->query['page'];\n }\n $page = max($page, 1);\n\n if (count(array_filter(explode(' ', $this->request->query['q']))) === 1) {\n $this->request->query['q'] .= '~';\n }\n\n $options = [\n 'query' => $this->request->query('q'),\n 'page' => $page,\n ];\n $this->loadModel('Search', 'Elastic');\n $results = $this->Search->search($lang, $version, $options);\n\n $this->viewBuilder()->className('Json');\n $this->set('results', $results);\n $this->set('_serialize', 'results');\n }",
"public function searchService_get($query=\"\")\n {\n $em = $this->doctrine->em;\n $serviceRepo = $em->getRepository('Entities\\Service');\n $criteria = new \\Doctrine\\Common\\Collections\\Criteria();\n //AQUI TODAS LAS EXPRESIONES POR LAS QUE SE PUEDE BUSCAR CON TEXTO\n $expresion = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"title\", \\Doctrine\\Common\\Collections\\Expr\\Comparison::CONTAINS, $query);\n $expresion2 = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"subtitle\", \\Doctrine\\Common\\Collections\\Expr\\Comparison::CONTAINS, $query);\n// $expresion3 = new \\Doctrine\\Common\\Collections\\Expr\\Comparison(\"title\", 'ENDS_WITH', $query);\n\n $criteria->where($expresion);\n $criteria->orWhere($expresion2);\n// $criteria->orWhere($expresion3);\n\n $respuesta = $serviceRepo->matching($criteria);\n foreach ($respuesta as $service) {\n $service->loadRelatedData(null, null, site_url());\n }\n $response[\"desc\"] = \"Resultados de la busqueda\";\n $response[\"query\"] = $query;\n $response[\"count\"] = 0;\n $response[\"data\"] = $respuesta->toArray();\n $response[\"count\"] = count($response[\"data\"]);\n $this->set_response($response, REST_Controller::HTTP_OK);\n }",
"function polizeipresse_search_office_callback() {\r\n\r\n\t$result = array();\r\n\r\n\t$terms = trim($_POST['terms']);\r\n\r\n $api_key = polizeipresse_get_option(POLIZEIPRESSE_API_KEY);\r\n\tif (empty($api_key)) {\r\n\t\t// If api key is not in database, use api_key from request\r\n\t\t$api_key = trim($_POST['api_key']);\r\n\t};\r\n\r\n\tif (!empty ($terms) && !empty ($api_key)) {\r\n\t\trequire_once(dirname(__FILE__) . '/Presseportal.class.php');\r\n\t $pp = new Presseportal($api_key, 'de');\r\n\t $pp->format = 'xml';\r\n\t $pp->limit = '30';\r\n\r\n\t\t$response = $pp->search_office($terms);\r\n\r\n\t\tif((!$response->error) && ($response->offices)) {\r\n\t\t\tforeach($response->offices AS $office) {\r\n\t\t\t\t$result[] = array('name' => $office->name, 'id' => $office->id);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Empty result\r\n\t\t}\r\n\t}\r\n\r\n\t// Return reponse\r\n\techo json_encode($result);\r\n\r\n\t// this is required to return a proper result\r\n\tdie();\r\n}",
"public abstract function search_items(\\WP_REST_Request $request);",
"function opdsSearchDescriptor()\n{\n global $app;\n\n $gen = mkOpdsGenerator($app);\n $cat = $gen->searchDescriptor(null, '/opds/searchlist/0/');\n mkOpdsResponse($app, $cat, OpdsGenerator::OPENSEARCH_MIME);\n}",
"function search() {}",
"function solr_select($url, $params=array(), $more=array()){\n\n\t\t$params['wt'] = 'json';\n\n\t\t#\n\n\t\t$str_params = implode('&', $params);\n\n\t\t$cache_key = \"solr_select_\" . md5($str_params);\n\t\t$cache = cache_get($cache_key);\n\n\t\tif ($cache['ok']){\n\t\t\treturn $cache['data'];\n\t\t}\n\n\t\t$http_rsp = http_post($url, $str_params);\n\n\t\tif (! $http_rsp['ok']){\n\t\t\treturn $http_rsp;\n\t\t}\n\n\t\t$as_array = True;\n\t\t$json = json_decode($http_rsp['body'], $as_array);\n\n\t\tif (! $json){\n\t\t\treturn array(\n\t\t\t\t'ok' => 0,\n\t\t\t\t'error' => 'Failed to parse response',\n\t\t\t);\n\t\t}\n\n\t\t$rsp = array(\n\t\t\t'ok' => 1,\n\t\t\t'rows' => $json,\t# this probably needs to be keyed off something I've forgotten about\n\t\t);\n\n\t\tcache_set($cache_key, $rsp);\n\t\treturn $rsp;\n\t}",
"function rest()\r\n\t{\r\n\t\theader ( 'Content-Type: text/plain;' );\r\n\t\theader ( \"Cache-Control: no-cache, must-revalidate\" ); // HTTP/1.1\r\n\t\theader ( \"Expires: Sat, 26 Jul 1997 05:00:00 GMT\" ); // Date in the past\r\n\t\t\r\n\r\n\t\terror_reporting ( E_ALL ^ E_NOTICE );\r\n\t\trequire_once (LIBPATH . 'xml/objectxml.php');\r\n\t\tif (version_compare ( PHP_VERSION, '5', '>=' )) {\r\n\t\t\trequire_once (LIBPATH . 'xml/domxml-php4-to-php5.php');\r\n\t\t\tset_error_handler ( rest_error_handler, E_ALL ^ E_NOTICE );\r\n\t\t} else {\r\n\t\t\tset_error_handler ( rest_error_handler );\r\n\t\t}\r\n\t\t\r\n\t\t$args = func_get_args ();\r\n\t\t\r\n\t\t$action = array_shift ( $args );\r\n\t\tif(strtolower($args[sizeof($args)-1]) == \"json\"){\r\n\t\t\tarray_pop($args);\r\n\t\t\tif ( function_exists('json_encode') ){\r\n\t\t\t\t$this->response_format = \"json\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($action == NULL) {\r\n\t\t\t\r\n\t\t\t$this->rest_show_error ( '100' );\r\n\t\t\r\n\t\t} else {\r\n\t\t\t$method = 'api_' . $action;\r\n\t\t\tif (method_exists ( $this, $method )) {\r\n\t\t\t\t$result = call_user_func_array ( array (\r\n\t\t\t\t\t\t&$this, \r\n\t\t\t\t\t\t$method \r\n\t\t\t\t), $args );\r\n\t\t\t\tif (is_array ( $result ) && array_key_exists ( 'error', $result )) {\r\n\t\t\t\t\t$this->rest_show_error ( $result ['error'] ['code'] );\r\n\t\t\t\t} else {// if ($result != NULL) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//@todo uncomment during production.\r\n\t\t\t\t\t//$this->output->cache(10);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($this->response_format == \"json\"){\r\n\t\t\t\t\t\techo json_encode($result);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (file_exists(APPPATH . 'views/api/rest/' . $method)){\r\n\t\t\t\t\t\t\t$this->load->view ( \"api/rest/$method\", $result );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//} else {\r\n\t\t\t\t//\t$this->rest_show_error ( '404' );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$this->rest_show_error ( '400' );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function go_search_list() {\n\n\tif(!has_user_permission(__FUNCTION__)) return; \n\n\tglobal $ROW, $TEMPLATE;\n\tLOG_MSG('INFO',\"go_search_list(): START GET=\".print_r($_GET,true));\n\n\t// Do we have a search string?\n\t// Get all the args from $_GET\n\t$reg_no=get_arg($_GET,\"reg_no\");\n\t$imei=get_arg($_GET,\"imei\");\n\t$vehicle_model=get_arg($_GET,\"vehicle_model\");\n\t$vehicle_status=get_arg($_GET,\"vehicle_status\");\n\t$description=get_arg($_GET,\"description\");\n\t$driver_name=get_arg($_GET,\"driver_name\");\n\t$driver_phone_no=get_arg($_GET,\"driver_phone_no\");\n\t$owner_ph_no=get_arg($_GET,\"owner_ph_no\");\n\t$driver_sal=get_arg($_GET,\"driver_sal\");\n\t$cleaner_name=get_arg($_GET,\"cleaner_name\");\n\t$cleaner_salary=get_arg($_GET,\"cleaner_salary\");\n\t$supervisor_name=get_arg($_GET,\"supervisor_name\");\n\t$supervisor_phone_no=get_arg($_GET,\"supervisor_phone_no\");\n\t$client_name=get_arg($_GET,\"client_name\");\n\t$client_mobile=get_arg($_GET,\"client_mobile\");\n\t$daily_fuel_lmt=get_arg($_GET,\"daily_fuel_lmt\");\n\t$monthly_fuel_lmt=get_arg($_GET,\"monthly_fuel_lmt\");\n\t$filling_station=get_arg($_GET,\"filling_station\");\n\t$fuel_rate=get_arg($_GET,\"fuel_rate\");\n\t$fuel_filled=get_arg($_GET,\"fuel_filled\");\n\t$odometer_reading=get_arg($_GET,\"odometer_reading\");\n\t$fuel_image=get_arg($_GET,\"fuel_image\");\n\t$odometer_image=get_arg($_GET,\"odometer_image\");\n\t$accountability_date=get_arg($_GET,\"accountability_date\");\n\t$created_dt=get_arg($_GET,\"created_dt\");\n\tLOG_MSG('DEBUG',\"do_search_list(): Got args\");\n\n\t// Validate parameters as normal strings \n\tif (\n\t\t!validate(\"Vehicle No\",$reg_no,0,20,\"varchar\") ||\n\t\t!validate(\"Vehicle Status\",$vehicle_status,0,11,\"varchar\") ||\n\t\t!validate(\"Driver Name\",$driver_name,0,200,\"varchar\") ||\n\t\t!validate(\"Daily Fuel Lmt\",$daily_fuel_lmt,0,10,\"varchar\") ||\n\t\t!validate(\"Monthly Fuel Lmt\",$monthly_fuel_lmt,0,10,\"varchar\") ||\n\t\t!validate(\"Fuel Filled\",$fuel_filled,0,10,\"varchar\") ||\n\t\t!validate(\"Odometer Reading\",$odometer_reading,0,45,\"varchar\") ||\n\t\t!validate(\"Created Dt\",$created_dt,0,30,\"varchar\") \t){\n\t\tLOG_MSG('ERROR',\"do_search_list(): Validate args failed!\");\n\t\treturn;\n\t}\n\tLOG_MSG('DEBUG',\"do_search_list(): Validated args\");\n\n\t// Rebuild search string for future pages\n\t$search_str=\"reg_no=$reg_no&vehicle_status=$vehicle_status&driver_name=$driver_name&daily_fuel_lmt=$daily_fuel_lmt&monthly_fuel_lmt=$monthly_fuel_lmt&fuel_filled=$fuel_filled&odometer_reading=$odometer_reading&created_dt=$created_dt\";\n\n\t$ROW=db_search_select(\n\t\t\"\",\n\t\t\t$reg_no,\n\t\t\t$imei,\n\t\t\t$vehicle_model,\n\t\t\t$vehicle_status,\n\t\t\t$description,\n\t\t\t$driver_name,\n\t\t\t$driver_phone_no,\n\t\t\t$owner_ph_no,\n\t\t\t$driver_sal,\n\t\t\t$cleaner_name,\n\t\t\t$cleaner_salary,\n\t\t\t$supervisor_name,\n\t\t\t$supervisor_phone_no,\n\t\t\t$client_name,\n\t\t\t$client_mobile,\n\t\t\t$daily_fuel_lmt,\n\t\t\t$monthly_fuel_lmt,\n\t\t\t$filling_station,\n\t\t\t$fuel_rate,\n\t\t\t$fuel_filled,\n\t\t\t$odometer_reading,\n\t\t\t$fuel_image,\n\t\t\t$odometer_image,\n\t\t\t$accountability_date,\n\t\t\t$created_dt\t);\n\tif ( $ROW[0]['STATUS'] != \"OK\" ) {\n\t\tadd_msg(\"ERROR\",\"There was an error loading the Searchs. Please try again later. <br/>\");\n\t\treturn;\n\t}\n\n\t// PAGE & URL Details\n\t$page_arr=get_page_params($ROW[0][\"NROWS\"]);\n\t$url=\"index.php?mod=admin&ent=search&go=list&$search_str\";\n\t$search_url='';\n\t$order_url='';\n\t$ordert_url='';\n\t$page_url='&page='.get_arg($page_arr,'page');\n\n\t// No rows found\n\tif ( !get_arg($ROW[0],'IS_SEARCH') && get_arg($page_arr,'page_row_count') <= 0 ) {\n\t\tadd_msg(\"NOTICE\",\"No cleaners found! <br />Click on <strong>Add cleaner</strong> to create a one.<br />\"); \n\t}\n\n\t// To get driver details\n\tif ( ($row_driver=db_get_list('ARRAY','name,driver_id','tDriver','travel_id='.TRAVEL_ID)) === false ) return;\n\n\t// To get supervisor details\n\tif ( ($row_supervisor=db_get_list('ARRAY','name,supervisor_id','tSupervisor','travel_id='.TRAVEL_ID)) === false ) return;\n\n\t// To get client details\n\tif ( ($row_client=db_get_list('ARRAY','name,client_id','tClient','travel_id='.TRAVEL_ID)) === false ) return;\n\n\t// To get cleaner details\n\tif ( ($row_cleaner=db_get_list('ARRAY','name,cleaner_id','tCleaner','travel_id='.TRAVEL_ID)) === false ) return;\n\n\tif ( isset( $TEMPLATE ) ) { $template=$TEMPLATE; } else { $template=TEMPLATE_DIR.\"list.html\"; } \n\tinclude($template); \n\n\tLOG_MSG('INFO',\"go_search_list(): END\");\n}",
"public function find($search_data) {\r\n\r\n # invoke find operation\r\n\r\n $params = array_merge($search_data, array('ws.op' => 'find'));\r\n\r\n $data = $this->adapter->request('GET', $this->url, $params);\r\n\r\n\r\n\r\n # get total size\r\n\r\n $ts_params = array_merge($params, array('ws.show' => 'total_size'));\r\n\r\n $total_size = $this->adapter->request('GET', $this->url, $ts_params, array('return' => 'integer'));\r\n\r\n $data['total_size'] = $total_size;\r\n\r\n\r\n\r\n # return collection\r\n\r\n return $this->readResponse($data, $this->url);\r\n\r\n }",
"protected function search()\n\t{\n\t\treturn Phpfox::getLib('search');\t\n\t}",
"public function searchAction()\n { \n $request = Request::createFromGlobals();\n \n $search = $request->query->get('search');\n \n $em = $this->getDoctrine()->getManager();\n \n $addresses = $em->getRepository('comemNewsroomBundle:Ad')->search($search);\n \n $response = new Response(json_encode($addresses));\n \n $response->headers->set('Content-Type', 'application/json');\n \n return $response;\n }",
"public function advanced_document_search_get($id=\"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n\n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $data = file_get_contents('php://input', 'r');\n \n //$url = $this->config->item('elasticsearchPrefix').\"/data/_search\".\"?q=CIL_CCDB.Status.Deleted:false&from=\".$from.\"&size=\".$size;\n $url = $this->config->item('elasticsearchPrefix').\"/data/_search?from=\".$from.\"&size=\".$size;\n $response = $sutil->just_curl_get_data($url,$data);\n $json = json_decode($response);\n \n //$this->response($data);\n $this->response($json);\n }",
"function Search()\n{\n\tglobal $txt, $settings, $context;\n\n\t// Search may be disabled if they're softly banned.\n\tsoft_ban('search');\n\n\t// Is the load average too high to allow searching just now?\n\tif (!empty($context['load_average']) && !empty($settings['loadavg_search']) && $context['load_average'] >= $settings['loadavg_search'])\n\t\tfatal_lang_error('loadavg_search_disabled', false);\n\n\tloadLanguage('Search');\n\tloadTemplate('Search');\n\n\t// Popup mode?\n\tif (AJAX)\n\t{\n\t\twetem::load('search_ajax');\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tisAllowedTo('search_posts');\n\n\t// Link tree....\n\t// !!! If we've come back here because of an error, we're going to have: Site > Search > Search Results > Search in the linktree. Is this what we want?\n\tadd_linktree($txt['search'], '<URL>?action=search');\n\n\t// This is hard coded maximum string length.\n\t$context['search_string_limit'] = 100;\n\n\t$context['require_verification'] = we::$is_guest && !empty($settings['search_enable_captcha']) && empty($_SESSION['ss_vv_passed']);\n\tif ($context['require_verification'])\n\t{\n\t\tloadSource('Subs-Editor');\n\t\t$verificationOptions = array(\n\t\t\t'id' => 'search',\n\t\t);\n\t\t$context['require_verification'] = create_control_verification($verificationOptions);\n\t\t$context['visual_verification_id'] = $verificationOptions['id'];\n\t}\n\n\t// If you got back from search2 by using the linktree, you get your original search parameters back.\n\tif (isset($_REQUEST['params']))\n\t{\n\t\t// Due to IE's 2083 character limit, we have to compress long search strings\n\t\t$temp_params = base64_decode(str_replace(array('-', '_', '.'), array('+', '/', '='), $_REQUEST['params']));\n\t\t// Test for gzuncompress failing\n\t\t$temp_params2 = @gzuncompress($temp_params);\n\t\t$temp_params = explode('|\"|', !empty($temp_params2) ? $temp_params2 : $temp_params);\n\n\t\t$context['search_params'] = array();\n\t\tforeach ($temp_params as $i => $data)\n\t\t{\n\t\t\t@list ($k, $v) = explode('|\\'|', $data);\n\t\t\t$context['search_params'][$k] = $v;\n\t\t}\n\t\tif (!empty($context['search_params']['brd']))\n\t\t\tloadSource('Search2');\n\t\t$context['search_params']['brd'] = empty($context['search_params']['brd']) ? array() : wedge_ranged_explode(',', $context['search_params']['brd']);\n\t}\n\n\tif (isset($_REQUEST['search']))\n\t\t$context['search_params']['search'] = un_htmlspecialchars($_REQUEST['search']);\n\n\tif (isset($context['search_params']['search']))\n\t\t$context['search_params']['search'] = westr::htmlspecialchars($context['search_params']['search']);\n\tif (isset($context['search_params']['userspec']))\n\t\t$context['search_params']['userspec'] = htmlspecialchars($context['search_params']['userspec']);\n\tif (!empty($context['search_params']['searchtype']))\n\t\t$context['search_params']['searchtype'] = 2;\n\tif (!empty($context['search_params']['minage']))\n\t\t$context['search_params']['minage'] = (int) $context['search_params']['minage'];\n\tif (!empty($context['search_params']['maxage']))\n\t\t$context['search_params']['maxage'] = (int) $context['search_params']['maxage'];\n\n\t$context['search_params']['show_complete'] = !empty($context['search_params']['show_complete']);\n\t$context['search_params']['subject_only'] = !empty($context['search_params']['subject_only']);\n\n\t// Load the error text strings if there were errors in the search.\n\tif (!empty($context['search_errors']))\n\t{\n\t\tloadLanguage('Errors');\n\t\t$context['search_errors']['messages'] = array();\n\t\tforeach ($context['search_errors'] as $search_error => $dummy)\n\t\t{\n\t\t\tif ($search_error === 'messages')\n\t\t\t\tcontinue;\n\n\t\t\t$context['search_errors']['messages'][] = $txt['error_' . $search_error];\n\t\t}\n\t}\n\n\t// Find all the boards this user is allowed to see.\n\t$request = wesql::query('\n\t\tSELECT b.id_cat, c.name AS cat_name, b.id_board, b.name, b.child_level\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND redirect = {string:empty_string}\n\t\tORDER BY b.board_order',\n\t\tarray(\n\t\t\t'empty_string' => '',\n\t\t)\n\t);\n\t$context['num_boards'] = wesql::num_rows($request);\n\t$context['boards_check_all'] = true;\n\t$context['categories'] = array();\n\twhile ($row = wesql::fetch_assoc($request))\n\t{\n\t\t// This category hasn't been set up yet...\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array(\n\t\t\t\t'id' => $row['id_cat'],\n\t\t\t\t'name' => $row['cat_name'],\n\t\t\t\t'boards' => array()\n\t\t\t);\n\n\t\t// Set this board up, and let the template know when it's a child, so it can indent them.\n\t\t$context['categories'][$row['id_cat']]['boards'][$row['id_board']] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => $row['name'],\n\t\t\t'child_level' => $row['child_level'],\n\t\t\t'selected' => (empty($context['search_params']['brd']) && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']) && !in_array($row['id_board'], we::$user['ignoreboards'])) || (!empty($context['search_params']['brd']) && in_array($row['id_board'], $context['search_params']['brd']))\n\t\t);\n\n\t\t// If a board wasn't checked that probably should have been, ensure the board selection is selected!\n\t\tif (!$context['categories'][$row['id_cat']]['boards'][$row['id_board']]['selected'] && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']))\n\t\t\t$context['boards_check_all'] = false;\n\t}\n\twesql::free_result($request);\n\n\t// Now, let's sort the list of categories into the boards for templates that like that.\n\t$temp_boards = array();\n\tforeach ($context['categories'] as $category)\n\t{\n\t\t$temp_boards[] = array(\n\t\t\t'name' => $category['name'],\n\t\t\t'child_ids' => array_keys($category['boards'])\n\t\t);\n\t\t$temp_boards = array_merge($temp_boards, array_values($category['boards']));\n\n\t\t// Include a list of boards per category for easy toggling.\n\t\t$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);\n\t}\n\n\t$max_boards = ceil(count($temp_boards) / 2);\n\tif ($max_boards == 1)\n\t\t$max_boards = 2;\n\n\t// Now, alternate them so they can be shown left and right ;).\n\t$context['board_columns'] = array();\n\tfor ($i = 0; $i < $max_boards; $i++)\n\t{\n\t\t$context['board_columns'][] = $temp_boards[$i];\n\t\tif (isset($temp_boards[$i + $max_boards]))\n\t\t\t$context['board_columns'][] = $temp_boards[$i + $max_boards];\n\t\telse\n\t\t\t$context['board_columns'][] = array();\n\t}\n\n\tif (!empty($_REQUEST['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $_REQUEST['topic'];\n\t\t$context['search_params']['show_complete'] = true;\n\t}\n\tif (!empty($context['search_params']['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $context['search_params']['topic'];\n\n\t\t$context['search_topic'] = array(\n\t\t\t'id' => $context['search_params']['topic'],\n\t\t\t'href' => '<URL>?topic=' . $context['search_params']['topic'] . '.0',\n\t\t);\n\n\t\t$request = wesql::query('\n\t\t\tSELECT ms.subject\n\t\t\tFROM {db_prefix}topics AS t\n\t\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)\n\t\t\t\tINNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)\n\t\t\tWHERE t.id_topic = {int:search_topic_id}\n\t\t\t\tAND {query_see_board}\n\t\t\t\tAND {query_see_topic}\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'search_topic_id' => $context['search_params']['topic'],\n\t\t\t)\n\t\t);\n\n\t\tif (wesql::num_rows($request) == 0)\n\t\t\tfatal_lang_error('topic_gone', false);\n\n\t\tlist ($context['search_topic']['subject']) = wesql::fetch_row($request);\n\t\twesql::free_result($request);\n\n\t\t$context['search_topic']['link'] = '<a href=\"' . $context['search_topic']['href'] . '\">' . $context['search_topic']['subject'] . '</a>';\n\t}\n\n\t$context['page_title'] = $txt['search'];\n}",
"public function search_patron($search) {\n //authorization\n $this->search_headers['Authorization'] = $this->get_access_token_authorization('SCIM');\n\n $header_array = [];\n foreach ($this->search_headers as $k => $v) {\n $header_array[] = \"$k: $v\";\n }\n\n //CURL\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL, $this->search_url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $header_array);\n curl_setopt($curl, CURLOPT_POST, $this->search_POST);\n curl_setopt($curl, CURLOPT_POSTFIELDS,$search);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n //curl_setopt($curl, CURLOPT_, );\n //curl_setopt($curl, CURLOPT_, );\n\n $result = curl_exec($curl);\n $error_number = curl_errno($curl);\n curl_close($curl);\n\n\n if ($error_number) {\n //return info in json format\n $result = '{\"Curl_errno\": \"'.$error_number.'\", \"Curl_error\": \"'.curl_error($curl).'\"}';\n $this->errors['curl'] = json_decode($result,TRUE);\n return false;\n }\n else {\n //store result in this object as an array\n $this->search = json_decode($result,TRUE);\n\n return true;\n }\n }",
"function search()\n\t{}",
"function search()\n\t{}",
"function searchQuery($client, $textoAbuscar)\n {\n echo '<h2>SOLR: This is the result of your search in the Solr database with this text: \"'.$textoAbuscar.'\"</h2><br />';\n // get a select query instance\n $query = $client->createSelect();\n\n // get the facetset component\n $facetSet = $query->getFacetSet();\n\n // create a facet field instance and set options\n $facetSet->createFacetField('Rts')->setField('retweet_count');\n\n // set a query (all prices starting from 12)\n //$query->setQuery('price:[12 TO *]');\n $query->setQuery('full_text: *'.$textoAbuscar.'*');\n\n // set start and rows param (comparable to SQL limit) using fluent interface\n $query->setStart(2)->setRows(20);\n\n // set fields to fetch (this overrides the default setting 'all fields')\n //$query->setFields(array('ID','username','favorite_count', 'description','full_text'));\n\n // sort the results by price ascending\n //$query->addSort('price', $query::SORT_ASC);\n $query->addSort('favorite_count', $query::SORT_ASC);\n\n // this executes the query and returns the result\n $resultset = $client->select($query);\n\n // display the total number of documents found by solr\n echo 'NumFound: '.$resultset->getNumFound();\n\n // show documents using the resultset iterator\n foreach ($resultset as $document) {\n\n echo '<hr/><table>';\n\n // the documents are also iterable, to get all fields\n foreach ($document as $field => $value) {\n // this converts multivalue fields to a comma-separated string\n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n\n echo '<tr><th>' . $field . '</th><td>' . $value . '</td></tr>';\n }\n\n echo '</table>';\n }\n\n // display facet counts\n echo '<hr/>Facet counts for field \"retweet_count\":<br/>';\n $facet = $resultset->getFacetSet()->getFacet('Rts');\n foreach ($facet as $value => $count) {\n echo $value . ' [' . $count . ']<br/>';\n }\n\n }",
"public function search($params)\n\t{\n\t\t//echo solr_get_version();\n\t\t$options = array\n\t\t(\n\t\t\t\t'hostname' => SOLR_SERVER_HOSTNAME,\n\t\t\t\t'login' => SOLR_SERVER_USERNAME,\n\t\t\t\t'password' => SOLR_SERVER_PASSWORD,\n\t\t\t\t'port' => SOLR_SERVER_PORT,\n\t\t\t\t'path' => SOLR_SERVER_PATH,\n\t\t\t\t'wt' => 'json',\n\t\t\n\t\t);\n\t\t\n\t\t$client = new SolrClient($options);\n\t\t\n// \t\tif(!$this->_isOnline)\n// \t\t{\n// \t\t\ttry {\n// \t\t\t\t$pingresponse = $client->ping();\n// \t\t\t\tif($pingresponse)\n// \t\t\t\t{\n// \t\t\t\t\t$this->_isOnline=true;\n// \t\t\t\t}\n// \t\t\t} catch (Exception $e) {\n// \t\t\t\tthrow new NotAcceptableHttpException($e->getMessage());\n// \t\t\t}\n\t\t\t\n// \t\t}\n\t\t\n\t\t$query = new SolrQuery();\n\t\t\n\t\t$this->load($params);\n\t\t\t\n\t\tif (!$this->validate()) {\n\t\t\t// uncomment the following line if you do not want to any records when validation fails\n\t\t\t// $query->where('0=1');\n\t\t\treturn $dataProvider;\n\t\t}\n\t\t\t\n\t\t\n\t\tif($this->keyWords)\n\t\t{\n\t\t\t$query->setQuery('title:'.$this->keyWords);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query->setQuery('title:*');\n\t\t}\n\t\t\n\t\t$responseFields=self::getSolrResponseFields();\n\t\t\n\t\t$query->addFields($responseFields);\n\t\t\n \t\t$query->setHighlight(1);\n\t\t\n \t\t$query->addHighlightField('title');\n \t\t\n \t\t$query->setHighlightSimplePre('<mark class=\"text-danger\">');\n \t\t\n \t\t$query->setHighlightSimplePost('</mark>');\n\t\t\n// \t\t$query->addField('id');\n\t\t\n// \t\t$query->addField('tstamp');\n\t\t\n// \t\t$query->addField('title');\n\t\t\n// \t\t//$query->addField('content');\n\t\t\n// \t\t$query->addField('url');\n\t\t\n\t\t// \t\t$query->addField('id')->addField('title');\n\t\t\n\t\t// \t\t$query->setStart(0);\n\t\t\n\t\t// \t\t$query->setRows(10);\n\t\t\n \t\t\n\t\t\n\t\t$dataProvider=new SolrDataProvider([\n\t\t\t\t'solr' => $client,\n\t\t\t\t'query' => $query,\n\t\t\t\t'pagination' => [\n\t\t\t\t\t\t'pagesize' => '30',\n\t\t\t\t],\n// \t\t\t\t'sort' => [\n// \t\t\t\t\t\t'defaultOrder' => [\n// \t\t\t\t\t\t\t\t//'boost' => SolrQuery::ORDER_DESC,\n// \t\t\t\t\t\t\t\t'title' => SolrQuery::ORDER_ASC,\n// \t\t\t\t\t\t\t\t'id' => SolrQuery::ORDER_ASC,\n// \t\t\t\t\t\t\t\t//'tstamp' => SolrQuery::ORDER_DESC,\n// \t\t\t\t\t\t]\n// \t\t\t\t],\n\t\t]);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// \t\t$dataProvider->solr=$client;\n\t\t\n\t\t// \t\t$dataProvider->query=$query;\n\t\t\n\t\t//$dataProvider->pagination->pagesize=5;\n\t\t\n\t\t//var_dump($dataProvider);\n\t\t\n\t\t// \t\techo $query;\n\t\t\n\t\t// \t\tdie();\n\t\t\n\t\treturn $dataProvider;\n\t\t\n\t\t/* $models=$dataProvider->models;\n\t\t\n\t\techo $dataProvider->getTotalCount();\n\t\t\n\t\tforeach ($models as $doc)\n\t\t{\n\t\techo \"id:\".$doc->id.\"</br>\";\n\t\techo \"titles:\".\"</br>\";\n\t\tforeach ($doc->title as $title)\n\t\t{\n\t\techo \"  \".$title.\"</br>\";\n\t\t}\n\t\t} */\n\t\t\n\t\t\n\t\t\n\t\t/* \t\t$query_response = $client->query($query);\n\t\t\n\t\t$response = $query_response->getResponse();\n\t\t\n\t\tprint_r($response);\n\t\t\n\t\techo \"////////////////////////////////////\";\n\t\t\n\t\tvar_dump($response['responseHeader']);\n\t\t\n\t\tforeach ($response->response->docs as $doc)\n\t\t{\n\t\techo \"id:\".$doc->id.\"</br>\";\n\t\techo \"titles:\".\"</br>\";\n\t\tforeach ($doc->title as $title)\n\t\t{\n\t\techo \"  \".$title.\"</br>\";\n\t\t}\n\t\t\n\t\t}\n\t\t*/\n\t}",
"public function getSearch($parameters = array());",
"private static function getSearchUrl()\n {\n return @self::CLIENT_URL_SEARCH . 'amazon/search';\n }",
"public function search()\n {\n $elasticsearch_search = ClientBuilder::create()->build();\n //$client =new ClientBuilder();\n $query = \"data systems\";\n $items = $elasticsearch_search->search([\n 'index' => 'articles',\n 'type' => 'article',\n 'body' => [\n 'query' => [\n 'multi_match' => [\n 'fields' => ['title', 'body'],\n 'query' => $query,\n ],\n ],\n \n ],\n \n 'size' =>100,\n \n ]);\n return $items;\n }",
"function ItemSearch($SearchIndex, $Keywords) {\r\n\r\n\r\n//Set the values for some of the parameters\r\n $Operation = \"ItemSearch\";\r\n $Version = \"2013-08-01\";\r\n $ResponseGroup = \"ItemAttributes,Offers\";\r\n//User interface provides values\r\n//for $SearchIndex and $Keywords\r\n//Define the request\r\n $request = \"http://webservices.amazon.com/onca/xml\"\r\n . \"?Service=AWSECommerceService\"\r\n . \"&AssociateTag=\" . Associate_tag\r\n . \"&AWSAccessKeyId=\" . Access_Key_ID\r\n . \"&Operation=\" . $Operation\r\n . \"&Version=\" . $Version\r\n . \"&SearchIndex=\" . $SearchIndex\r\n . \"&Keywords=\" . $Keywords\r\n . \"&Signature=\"\r\n . \"&ResponseGroup=\" . $ResponseGroup;\r\n\r\n// echo $request;\r\n// exit;\r\n\r\n//Catch the response in the $response object\r\n $response = file_get_contents($request);\r\n $parsed_xml = simplexml_load_string($response);\r\n echo \"<pre>\";\r\n print_r($parsed_xml, $SearchIndex);\r\n// printSearchResults($parsed_xml, $SearchIndex);\r\n echo \"</pre>\";\r\n}",
"function service_list_json(){\r\n\t\t\t$aColumns = array( 'sl','branch','invoice','date','type','customer','net_amount','action' );\r\n\t\t\t\r\n\t\t\t//Array of database search columns//\r\n\t\t\t$sColumns = array('customer','invoice','net_amount');\r\n\t\t\t\r\n\t\t\t//Indexed column (used for fast and accurate table attributes) //\r\n\t\t\t$sIndexColumn = \"service_id\";\r\n\t\t\t\r\n\t\t\t//DB tables to use//\r\n\t\t\t$sTable = \"tbl_service \r\n\t\t\t\t\t INNER JOIN tbl_branch ON service_branch=branch_id\r\n\t\t\t\t\t INNER JOIN tbl_payment_method ON service_type=payment_method_id\r\n\t\t\t\t\t INNER JOIN tbl_customer ON service_customer=customer_id\";\r\n\t\t\t\r\n\t\t\t//Paging//\r\n\t\t\t$sLimit = \"\";\r\n\t\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\r\n\t\t\t{\r\n\t\t\t\t$sLimit = \"LIMIT \".( $_GET['iDisplayStart'] ).\", \".\r\n\t\t\t\t\t( $_GET['iDisplayLength'] );\r\n\t\t\t}\r\n\t\r\n\t\t\t//Ordering//\r\n\t\t\tif ( isset( $_GET['iSortCol_0'] ) )\r\n\t\t\t{\r\n\t\t\t\t$sOrder = \"ORDER BY \";\r\n\t\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\"\r\n\t\t\t\t\t\t\t\".( $_GET['sSortDir_'.$i] ) .\", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\r\n\t\t\t\tif ( $sOrder == \"ORDER BY\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t$sOrder = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t//Filtering//\r\n\t\t\t$sWhere = \"\";\r\n\t\t\tif ( $_GET['sSearch'] != \"\" )\r\n\t\t\t{\r\n\t\t\t\t$sWhere = \"WHERE (\";\r\n\t\t\t\tfor ( $i=0 ; $i<count($sColumns) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$sWhere .= $sColumns[$i].\" LIKE '%\".( $_GET['sSearch'] ).\"%' OR \";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\r\n\t\t\t\t$sWhere .= ')';\r\n\t\t\t}\r\n\t\r\n\t\t\t//Individual column filtering//\r\n\t\t\tfor ( $i=0 ; $i<count($sColumns) ; $i++ )\r\n\t\t\t{\r\n\t\t\t\tif ( $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $sWhere == \"\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sWhere = \"WHERE \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sWhere .= \" AND \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sWhere .= $sColumns[$i].\" LIKE '%\".($_GET['sSearch_'.$i]).\"%' \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t//SQL queries//\r\n\t\t\t$sQuery\t\t\t= \"SELECT SQL_CALC_FOUND_ROWS service_id as sl,branch_name as branch,service_invoice as invoice,\r\n\t\t\t\t\t\t\tDATE_FORMAT(service_date,'%d/%m/%Y') as date,payment_method_title as type,\r\n\t\t\t\t\t\t\tcustomer_name as customer,service_amount as amount,service_tax as tax,service_discount as discount,\r\n\t\t\t\t\t\t\tservice_total as total,service_net_amount as net_amount,service_id as id,\r\n\t\t\t\t\t\t\tservice_status as status\r\n\t\t\t\t\t\t\tFROM $sTable\r\n\t\t\t\t\t\t\t$sWhere\r\n\t\t\t\t\t\t\t$sOrder\r\n\t\t\t\t\t\t\t$sLimit\";\r\n\t\t\t$rResult \t\t= $this->db->query($sQuery);\r\n\t\r\n\t\t\t//Data set length after filtering//\r\n\t\t\t$fQuery\t\t\t= \"SELECT $sIndexColumn FROM $sTable $sWhere\";\r\n\t\t\t$fResult\t\t= $this->db->query($fQuery);\r\n\t\t\t$FilteredTotal\t= $fResult->num_rows();\r\n\t\r\n\t\t\t//Total data set length //\r\n\t\t\t$tQuery\t\t\t= \"SELECT $sIndexColumn FROM $sTable\";\r\n\t\t\t$tResult\t\t= $this->db->query($tQuery);\r\n\t\t\t$Total\t\t\t= $tResult->num_rows();\r\n\t\r\n\t\t\t//Output\r\n\t\t\t\r\n\t\t\tif($_GET['sEcho']==1){\r\n\t\t\t\t\r\n\t\t\t\t$cStart=0;\r\n\t\t\t\t$cEnd=$_GET['iDisplayLength'];\r\n\t\t\t\t$cLength=$_GET['iDisplayLength'];\r\n\t\t\t\t$cPage=0;\r\n\t\t\t\t$cTotalPage=ceil($FilteredTotal/$_GET['iDisplayLength']);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$cStart=$_GET['iDisplayStart'];\r\n\t\t\t\t$cEnd=$_GET['iDisplayStart']=$_GET['iDisplayLength'];\r\n\t\t\t\t$cLength=$_GET['iDisplayLength'];\r\n\t\t\t\t$cPage=intval($cStart/$cLength);\r\n\t\t\t\t$cTotalPage=ceil($FilteredTotal/$_GET['iDisplayLength']);\r\n\t\t\t}\r\n\t\t\t$output = array(\r\n\t\t\t\t\"cStart\"\t\t\t\t=> $cStart,\r\n\t\t\t\t\"cEnd\"\t\t\t\t\t=> $cEnd,\r\n\t\t\t\t\"cLength\"\t\t\t\t=> $cLength,\r\n\t\t\t\t\"cPage\"\t\t\t\t\t=> $cPage,\r\n\t\t\t\t\"cTotalPage\"\t\t\t=> $cTotalPage,\r\n\t\t\t\t\"sEcho\" \t\t\t\t=> intval($_GET['sEcho']),\r\n\t\t\t\t\"iTotalRecords\" \t\t=> $Total,\r\n\t\t\t\t\"iTotalDisplayRecords\" \t=> $FilteredTotal,\r\n\t\t\t\t\"aaData\" \t\t\t\t=> array()\r\n\t\t\t);\r\n\t\t\t$result\t= $rResult->result_array();\r\n\t\t\t$j=$cStart+1;\r\n\t\t\tforeach($result as $aRow){\r\n\t\t\t\t\r\n\t\t\t\t$row = array();\r\n\t\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( $aColumns[$i] == \"sl\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$row[] = $j;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//else if($aColumns[$i] == \"amount\"){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//if(PR_TAX_INCLUDE){\r\n\t\t\t\t\t\t\t//$row[]=$aRow[ $aColumns[$i] ];\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t//else{\r\n\t\t\t\t\t\t\t//$row[]=number_format($aRow[ $aColumns[$i] ]+ $aRow['pr_tax_amount'],DECIMAL_DIGITS);\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\t\t\t\t\telse if( $aColumns[$i] == \"status\" ){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$row[] = \"<button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Extra Small Button</button>\";\r\n\t\t\t\t\t\t$row[] = $this->Common_model->status_template($aRow['status']);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if( $aColumns[$i] == \"action\" ){\r\n\t\t\t\t\t\t$id\t\t=$aRow['id'];\r\n\t\t\t\t\t\t//if($aRow['status']==2){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//$row[]\t= \"<a href='Purchase/purchase_confirm/$id/' class='on-default edit-row edit-icon'><button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Confirm</button></a>\";\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t//if($aRow['status']==5){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$row[]\t= \"<a href='Service/service_details/$id/' class='on-default edit-row edit-icon'><button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Details</button></a>\";\r\n\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( $aColumns[$i] != ' ' )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// General output \r\n\t\t\t\t\t\t$row[] = $aRow[ $aColumns[$i] ];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$output['aaData'][] = $row;\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo json_encode( $output );\r\n\t\t}",
"public function search($search) {\n\t\t//Argument 1 must be a string\n\t\tEden_Twitter_Error::i()->argument(1, 'string');\t\n\n\t\t$this->_query['q'] = $search;\n\t\t\n\t\treturn $this->_getResponse(self::URL_SEARCH, $this->_query);\n\t}",
"public function index() {\n $output = $this->verifyProvidedInput(['keywords' => 'Keywords are required to perform a search']);\n\n if (empty($output)) {\n $preparedKeywords = htmlspecialchars($this->request->keywords);\n if (!empty($this->request->advancedSearch) && $this->request->advancedSearch) {\n $sortBy = (isset($this->request->sortBy) ? $this->request->sortBy : 'rawListPrice');\n $reverseSort = (isset($this->request->reverseSort) ? boolval($this->request->reverseSort) : false);\n $data = $this->getRETS->getListing()\n ->setSortBy($sortBy)\n ->setReverseSort($reverseSort)\n ->search($preparedKeywords, \n $this->request->extra, \n $this->request->maxPrice, \n $this->request->minPrice, \n $this->request->beds, \n $this->request->baths, \n $this->request->includeResidential, \n $this->request->includeLand, \n $this->request->includeCommercial);\n \n $this->addThumbnails($data);\n $output = $this->respondData($data);\n } else {\n $preparedKeywords = htmlspecialchars($this->request->keywords);\n $data = $this->getRETS->getListing()->searchByKeyword($preparedKeywords);\n $this->addThumbnails($data);\n $output = $this->respondData($data);\n }\n }\n\n return $output;\n }",
"public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }",
"public function search($search_term = \"\"){\r\n\t\tif($search_term != \"\"){\r\n\t\t\t$req = $this->config->getDomain() . \"Search\";\r\n\t\t\t$req .= \"?search_term=\" . $search_term;\r\n\t\t\t$req .= \"&dataType=\" . $this->config->getDataType();\r\n\t\t\t$resp = $this->helper->curlGet($req);\r\n\t\t\t$resultsArray = array();\r\n\t\t\tforeach (json_decode($resp) as $obj){\r\n\t\t\t\t$searchResult = new CurtSearchResult;\r\n\t\t\t\t$sR = $searchResult->castToSearchResult($obj);\r\n\t\t\t\tarray_push($resultsArray, $sR);\r\n\t\t\t}\r\n\t\t\treturn $resultsArray;\r\n\t\t} // end if\r\n\t}",
"function get_resource_SOLR($field,$desc)\n#############################\n# \n# returns the resource from the descritpor\n#\n{\n $solr_collection='zbw_stw';\n if (($SOLRCLIENT = init_SOLRCLIENT($solr_collection,'solr_index_skos_namespaces system error init SOLRCLIENT')))\n {\n // get a select query instance\n $query = $SOLRCLIENT->createSelect();\n //$query->setQuery((\"id%3A$desc\"));\n $query->createFilterQuery($field)->setQuery($desc);\n \n // set start and rows param (comparable to SQL limit) using fluent interface\n $query->setStart(0)->setRows(500); // one should be enough\n\n // set fields to fetch (this overrides the default setting 'all fields')\n // $query->setFields(array('id','name','price'));\n\n // sort the results by price ascending\n //$query->addSort('price', Solarium_Query_Select::SORT_ASC);\n\n // this executes the query and returns the result\n $resultset = $SOLRCLIENT->select($query);\n $noofresults=$resultset->getNumFound();\n if ($noofresults > 1) print \"Descriptor Query returns more than one element ($noofresults)\";\n //var_dump($resultset);\n // display the total number of documents found by solr\n $returndocument=array();\n // show documents using the resultset iterator\n foreach ($resultset as $document) \n {\n // the documents are also iterable, to get all fields\n foreach($document AS $field => $value)\n {\n // this converts multivalue fields to a comma-separated string\n if(is_array($value)) $value = implode(', ', $value);\n $returndocument[]=array($field,$value);\n }\n }\n \n }\n\treturn $returndocument;\n}",
"public function actionSearch()\n {\n $route = 'merchant.searchProduct';\n $request = new searchProductRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n //$request->setKeyword('方便面');\n $request->setWholesalerId(3);\n $request->setPageSize(10);\n $request->setCategoryId(377);\n $request->setCategoryLevel(3);\n// $request->setBrand('百威;王老吉;');\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n try{\n $body = searchProductResponse::parseFromString($result->getPackageBody());\n }catch (\\Exception $e){\n $body = null;\n }\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }",
"function resourcesSearch($args)\n {\n if(!array_key_exists('search', $args))\n {\n throw new Exception('Parameter search is not defined', MIDAS_INVALID_PARAMETER);\n }\n $userDao = $this->_getUser($args);\n\n $order = 'view';\n if(isset($args['order']))\n {\n $order = $args['order'];\n }\n return $this->Component->Search->searchAll($userDao, $args['search'], $order);\n }",
"function search()\n\t{\n\t\t$search = $this->input->post('search') != '' ? $this->input->post('search') : null;\n\t\t$limit_from = $this->input->post('limit_from');\n\t\t$lines_per_page = $this->Appconfig->get('lines_per_page');\n\n\t\t$suppliers = $this->Supplier->search($search, $lines_per_page, $limit_from);\n\t\t$total_rows = $this->Supplier->get_found_rows($search);\n\t\t$links = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from, $total_rows);\n\t\t$data_rows = get_supplier_manage_table_data_rows($suppliers, $this);\n\n\t\techo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));\n\t}",
"function searchContactList($type, $query) {\n\tglobal $apiBaseURL; // bad practice in production - fine for this example\n\n\t// the URL expects the type to have a capital first letter - lets force this\n\t$type = ucfirst($type);\n\n\t// lets lowercase and strip white space (really you should do more cleaning up of user input)\n\t$query = trim(strtolower($query));\n\n\t//\n\t// To do a search we are using the $filter from the oData specification\n\t// http://www.odata.org/documentation/uri-conventions#FilterSystemQueryOption\n\t// We search only the CoLastName and FirstName for this example\n\t//\n\n\t$filter = \"filter=substringof('\".$query.\"',%20CoLastName)%20or%20substringof('\".$query.\"',%20FirstName)%20eq%20true\";\n\n\n\t// use the getURL function to call the URL - remember we are calling the vars we need from the session vars\n\t$response = getURL($apiBaseURL.$_SESSION['companyFileGUID'].'/Contact/'.$type.'/?$'.$filter, $_SESSION['username'], $_SESSION['password']);\n\n\t// it returned as JSON so lets decode it\n\t$response = json_decode($response);\n\t// return the response\n\treturn($response);\n\n}",
"function ODQuery_QueryService() {\n\t\t$this->client = new SoapClient(__DIR__.'/../wsdl/QueryService2.wsdl',array(\n 'exceptions'=>true,\n 'encoding'=>'utf-8')\n );\n\t\t$this->soapException = new ODSubmission_SoapException();\n\t}",
"public function search($keyword, $page = 1) {\n\t\t$params = array(\n\t\t\t'api_key' => $this->api_key,\n\t\t\t'method' => 'flickr.photos.search',\n\t\t\t'format'\t=> 'php_serial',\n\t\t\t'text' => $keyword,//This one we'll have to think about a bit, but it shouldn't be too hard.\n\t\t\t'safe_search' => '2',\n\t\t\t'license' => '4,5,7,8',//This one can be CSVed\n\t\t\t'per_page' => 30,\n\t\t\t'sort' => 'relevance',\n\t\t\t'page' => $page,\n\t\t);\n\t\t\n\t\t$encoded_params = array();\n\t\t\n\t\tforeach ($params as $k => $v){\n\t\t\t$encoded_params[] = urlencode($k).'='.urlencode($v);\n\t\t}\n\t\t\n\t\t$res = curl_init($this->url.implode('&', $encoded_params));\n\t\t\n\t\tcurl_setopt($res, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\treturn $response = curl_exec($res);\n\t}",
"function _search($transaction_id, $startDateStr = null, $endDateStr = null) {\n\t\t// Set request-specific fields.\n\t\t$transactionID = urlencode($transaction_id);\n\t\t\n\t\t// Add request-specific fields to the request string.\n\t\t$this->nvpStr = \"&TRANSACTIONID=$transactionID\";\n\t\t\n\t\t// Set additional request-specific fields and add them to the request string.\n\t\tif(isset($startDateStr)) {\n\t\t $start_time = strtotime($startDateStr);\n\t\t $iso_start = date('Y-m-d\\T00:00:00\\Z', $start_time);\n\t\t $this->nvpStr .= \"&STARTDATE=$iso_start\";\n\t\t }\n\t\t\n\t\tif(isset($endDateStr)&&$endDateStr!='') {\n\t\t $end_time = strtotime($endDateStr);\n\t\t $iso_end = date('Y-m-d\\T24:00:00\\Z', $end_time);\n\t\t $this->nvpStr .= \"&ENDDATE=$iso_end\";\n\t\t}\n\t\treturn $this->query(\"TransactionSearch\");\n\t}",
"public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }",
"function ajaxSearch($searchForm) {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_SEARCH_RESULTS###');\n\t\t$template['item'] = $this->cObj->getSubpart( $template['list'], '###SINGLE###');\n\t\t$smallConf = $this->conf['search.'];\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\n\t\t$test = '';\n\t\t$debug = array();\n\t\t$error = array();\n\n\t\t$jsResultDelete = 'deleteSearchResult();';\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// minimum characters needed, default = 3\n\t\tif (strlen($searchForm['rggmsearchValue']) >= $this->conf['search.']['minChars'] ||\n\t\t\t ($searchForm['rggmActivateRadius']=='1' && $searchForm['rggmRadius']>0)) {\n\t\t\t$res = array();\n\t\t\t$coordinatesSaved = array();\n\n\t\t\t/*\n\t\t\t * Search for the text\n\t\t\t */\n\n\t\t\t// escaping the search-value\n\t\t\t$delete = array(\"'\", \"\\\"\", \"\\\\\", \"/\", \"\");\n\t\t\t$searchExpression = $searchForm['rggmsearchValue'];\n\t\t\t$searchExpression = str_replace($delete, '', $searchExpression);\n\n\t\t\t$tablelist = explode(',', $this->config['tables']);\n\n\t\t\tforeach ($tablelist as $key => $table) {\n\t\t\t\t$searchClause = array();\n\t\t\t\t$searchClause['general'] = 'lng!=0 AND lat!=0 '.$this->config['pid_list'];\n\n\t\t\t\t// just search the tables where search fields are specified\n\t\t\t\tif ($this->conf['search.']['fields.'][$table]) {\n\t\t\t\t\t$select = '*';\n\t\t\t\t\t$searchField = t3lib_div::trimExplode(',',$this->conf['search.']['fields.'][$table]);\n\t\t\t\t\t$where2 = '';\n\t\t\t\t\tforeach ($searchField as $key => $value) {\n\t\t\t\t\t\t$where2.= \" $value LIKE '%$searchExpression%' OR\";\n\t\t\t\t\t}\n\t\t\t\t\t$searchClause['text'] = ' ( ' . substr($where2, 0, -3) . ' ) ';\n\n\t\t\t\t\t// search only within the map area\n\t\t\t\t\tif ($searchForm['rggmOnMap'] == 'on') {\n\t\t\t\t\t\t$areaArr = $this->intExplode('%2C%20', $searchForm['rggmBound'], 1);\n\t\t\t\t\t\t$searchClause['maparea'] = ' lng between ' . $areaArr[1] . ' AND ' . $areaArr[3] . '\n\t\t\t\t\t\t\tAND\tlat between ' . $areaArr[0] . ' AND ' . $areaArr[2];\n\t\t\t\t\t}\n\n\t\t\t\t\t// radius search (umkreissuche)\n\t\t\t\t\tif ($searchForm['rggmActivateRadius'] == 'on') {\n\n\t\t\t\t\t\t// avoid multiple geocoding calls, just 1 is necessary\n\t\t\t\t\t\tif (count($coordinatesSaved) == 0) {\n\t\t\t\t\t\t\t$coordinates = $this->helperGeocodeAddress('', $searchForm['rggmZip'], '', $searchForm['rggmCountry']);\n\t\t\t\t\t\t\t$coordinatesSaved = $coordinates;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$coordinates = $coordinatesSaved;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if status is ok (200) and accuracy fits settings in TS\n\t\t\t\t\t\tif ($coordinates['status'] == 200 && (intval($coordinates['accuracy']) >= intval($this->conf['search.']['radiusSearch.']['minAccuracy']))) {\n\t\t\t\t\t\t\t$select = '*,SQRT(POW('.$coordinates['lng'].'-lng,2)*6400 + POW('.$coordinates['lat'].'-lat,2)*12100) AS distance';\n\t\t\t\t\t\t\t$searchClause['radius'] = ' SQRT(POW('.$coordinates['lng'].'-lng,2)*6400 + POW('.$coordinates['lat'].'-lat,2)*12100) <'.intval($searchForm['rggmRadius']);\n\t\t\t\t\t\t\t$orderBy = 'distance';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$searchClause['errorWithRadiusSearch'] = '1=2';\n\n\t\t\t\t\t\t\t// if status is ok, the accuracy failed\n\t\t\t\t\t\t\tif ($coordinates['status'] == 200) {\n\t\t\t\t\t\t\t\t$error['accuracy'] = $this->pi_getLL('search_error_geocode-accuracy');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$error['status'] = $this->pi_getLL('search_error_geocode-status-' . $coordinates['status']);\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// if a category is used, search for it\n\t\t\t\t\tif ($searchForm['rggmCat'] != '') {\n\t\t\t\t\t\t$catList = $this->intExplode(',', $searchForm['rggmCat']);\n\t\t\t\t\t\t$whereCat = '';\n\t\t\t\t\t\tforeach ($catList as $key => $value) {\n\t\t\t\t\t\t\t$whereCat .= ' FIND_IN_SET(' . $value . ',rggmcat) OR';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$searchClause['cat'] = ' ( ' . substr($whereCat, 0, -3) . ' ) ';\n\t\t\t\t\t}\n\n\t\t\t\t\t$limit = ''; // no limit, because this is done afterwards from the whole list\n\n\t\t\t\t\t// Adds hook for processing of extra search expressions\n\t\t\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraSearchHook'])) {\n\t\t\t\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rggooglemap']['extraSearchHook'] as $_classRef) {\n\t\t\t\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t\t\t\t$searchClause = $_procObj->extraSearchProcessor($table, $searchClause, $orderBy, $limit, $error, $this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$where = implode(' AND ', $searchClause);\n\n\t\t\t\t\tif (count($error) == 0) {\n\t\t\t\t\t\t$res += $this->generic->exec_SELECTquery($select, $table, $where, $groupBy, $orderBy, $limit);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$debug[$table]['where'] = $where;\n\t\t\t}\n\n\t\t\tif (count($error) == 0) {\n\t\t\t\t// todo Limit\n\t\t\t\t$res = array_slice($res, 0, 99);\n\n\t\t\t\t/*\n\t\t\t\t * Create the output of the search\n\t\t\t\t */\n\t\t\t\t$i = 0;\n\n\t\t\t\t$jsResultUpdate = 'var bounds = new GLatLngBounds();';\n\t\t\t\t$debug['count'] = 0;\n\t\t\t\t$debug[$table]['res'] = $res;\n\n\t\t\t\t// run through the results\n\t\t\t\t$content_item = '';\n\t\t\t\twhile ($row = array_shift($res)) {\n\t\t\t\t\t$debug['count']++;\n\n\t\t\t\t\t// check if there is really no records with lng/lat = 0\n\t\t\t\t\tif (floatval($row['lat']) == 0 || floatval($row['lng']) == 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$markerArray = $this->getMarker($row, 'search.', $i);\n\n\t\t\t\t\t$markerArray['###SEARCHID###'] = $i + 1;\n\n\t\t\t\t\t\t// set the correct title\n\t\t\t\t\t$field = ($this->conf['title.']['useRggmTitle'] == 1) ? 'rggmtitle' : $this->conf['title.'][$table];\n\t\t\t\t\t$title = ($this->cObj2->stdWrap(htmlspecialchars($row[$field]), $this->conf['title.']['searchresult.']));\n\t\t\t\t\t$title = str_replace('\\'', '\"', $title);\n\n\t\t\t\t\t// icon for the map\n\t\t\t\t\t$icon = 'marker'. ($i + 1) . '.png';\n\n\t\t\t\t\t// JS which displayes the search markers\n\t\t\t\t\t$jsResultUpdate .= '\n\t\t\t\t\t\tmarker = createMarker(new GLatLng(' . $row['lat'] . ',' . $row['lng'] . '), ' . $row['uid'] . ', \\'' . $icon . '\\', \\'' . $title . '\\', \\'' . $row['table'] . '\\', 1);\n\n\t\t\t\t\t\tmap.addOverlay(marker);\n\t\t\t\t\t\tsearchresultmarkers[' . $i . '] = marker;\n\t\t\t\t\t\tbounds.extend(new GLatLng(' . $row['lat'] . ',' . $row['lng'] . '));\n\t\t\t\t\t';\n\n\t\t\t\t\t$i++;\n\n\t\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray, array(), $wrappedSubpartArray);\n\t\t\t\t}\n\n\t\t\t\t$jsResultUpdate .= $test;\n\n\t\t\t\t$markerArray['###SEARCHEXPRESSION###'] = $searchForm['rggmsearchValue'];\n\t\t\t\t$markerArray['###SEARCHCOUNT###'] = $i;\n\n\t\t\t\t$subpartArray['###CONTENT###'] = $content_item;\n\n\t\t\t\t$jsResultUpdate .= '\n\t\t\t\t\tvar zoom=map.getBoundsZoomLevel(bounds);\n\n\t\t\t\t\tvar centerLat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) /2;\n\t\t\t\t\tvar centerLng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) /2;\n\t\t\t\t\tmap.setCenter(new GLatLng(centerLat,centerLng),zoom);\n\t\t\t\t';\n\n\t\t\t\t// Nothing found\n\t\t\t\tif ($i ==0) {\n\t\t\t\t\t$subpartArray['###CONTENT###'] = $this->pi_getLL('searchNoResult');\n\t\t\t\t\t$jsResultUpdate = '';\n\t\t\t\t}\n\n\t\t\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray, $wrappedSubpartArray);\n\t\t\t}\n\n\t\t\t$debugOut = 0;\n\t\t\tif ($debugOut == 1) {\n\t\t\t\t$content = t3lib_div::view_array($debug) . $content;\n\t\t\t}\n\n\t\t// minimum character length not reached\n\t\t} else {\n\t\t\t$error['minChars'] = sprintf($this->pi_getLL('searchMinChars'), $this->conf['search.']['minChars']);\n\t\t\t$objResponse->addAssign('searchFormError', 'innerHTML', $content);\n\t\t}\n\n\t\t// if any errors are found, load the error template\n\t\tif (count($error) > 0) {\n\t\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_SEARCH_RESULTS_ERROR###');\n\t\t\t$template['item'] = $this->cObj->getSubpart( $template['list'], '###SINGLE###');\n\n\t\t\tforeach ($error as $key) {\n\t\t\t\t$markerArray['###ERROR###'] = $key;\n\t\t\t\t$content_item .= $this->cObj->substituteMarkerArrayCached($template['item'], $markerArray);\n\t\t\t}\n\t\t\t$subpartArray['###CONTENT###'] = $content_item;\n\n\t\t\t$markerArray['###LL_HEADER###'] = $this->pi_getLL('search_error_header');\n\n\t\t\t$content .= $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\t}\n\n\t\t$objResponse->addScript($this->cObj->stdWrap($jsResultDelete, $smallConf['modify.']['deleteJS.']));\n\t\t$objResponse->addAssign('searchFormResult', 'innerHTML', $content);\n\t\t$objResponse->addScript($this->cObj->stdWrap($jsResultUpdate, $smallConf['modify.']['updateJS.']));\n\n\t\treturn $objResponse->getXML();\n\t}",
"function curl_function($url){\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n//$searchResponse = json_decode($output,true);\n return $output;\n\t\n\t}",
"function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"public function search($args){\n\t\t//Sets defaults where input doesn't exist.\n\t\t//This will only add if the index doesn't exist?\n\t\t$args += [\n\t\t\t\"page\" => 0,\n\t\t\t\"index\" => null,\n\t\t\t\"type\" => \"books\"\n\t\t];\n\t\textract($args);\n\t\t//Now check we have a query\n\t\tif(!isset($query)){\n\t\t\techo \"NEED TO HAVE A QUERY IN SEARCH\";\n\t\t\texit(1);\n\t\t}\n\t\t//Create url for search\n\t\t$url = \"$this->apiRoot/$type?q=$query&p=$page\" . ($index === null ? \"\" : \"&i=$index\") . $this->apiTail;\n\n\t\t//Run search, return json as array\n\t\t//return file_get_contents($url);\n\t\treturn apiSampleSearch();\n\t}",
"public function search($searchTerm)\n {\n// if (!array_key_exists($feed, $this->_feeds)) {\n// throw new Zend_Tool_Project_Exception(sprintf(\n// 'Unknown feed \"%s\"',\n// $feed\n// ));\n// }\n\n// $feed = Zend_Feed_Reader::import($this->_feeds[$feed]);\n// $title = $desc = $link = '';\n// foreach ($feed as $entry) {\n// $title = $entry->getTitle();\n// $desc = $entry->getDescription();\n// $link = $entry->getLink();\n// break;\n// }\n\n\n\n //$content = sprintf(\"%s\\n%s\\n\\n%s\\n\", $title, strip_tags($desc), $link);\n\n $response = $this->_registry->getResponse();\n $response->appendContent(\"Hello '$searchTerm'\");\n return true;\n }",
"function getSearch($search, $page, $per_page = 32 , $tag = false){\n\n\t\t/* Build URL */\n\t\tif($tag){\n\t\t\t/* Return User's Tags */\n\t\t\t$query = 'tags='.$tag.'&user_id='.$this->user.'&per_page='.$per_page.'&page='.$page.'&extras=title&content_type=7';\n\t\t} elseif($search){\n\t\t\t/* Search for tags, name and description within user's photos */\n\t\t\t$query = 'text='.urlencode($search).'&user_id='.$this->user.'&per_page='.$per_page.'&page='.$page.'&extras=title&content_type=7';\n\t\t} else {\n\t\t\t/* This is used for Recent Photos */\n\t\t\t$query = 'user_id='.$this->user.'&per_page='.$per_page.'&page='.$page.'&extras=title&content_type=7';\n\t\t}\n\n\t\t/* Return Search Query */\n\t\t$search = $this->askFlickr('photos.search',$query);\n\t\treturn $search;\n\t}",
"function cxense_search($query, $args) {\n $default_args = array(\n 'columns' => 'title,description,body',\n 'count' => 10,\n 'pagination' => 0,\n 'sort' => 'og-article-published-time:desc',\n 'cache_ttl' => HOUR_IN_SECONDS,\n 'site_id' => cxense_get_opt('cxense_site_id'),\n );\n\n $args = array_merge($default_args, $args);\n\n $url = sprintf(\n 'http://sitesearch.cxense.com/api/search/%s?p_aq=query(%s:\"%s\",token-op=and)&p_c=%d&p_s=%d&p_sm=%s',\n $args['site_id'],\n $args['columns'],\n urlencode($query),\n $args['count'],\n $args['pagination'],\n $args['sort']\n );\n\n $cache_key = md5($url);\n $result = get_transient($cache_key);\n\n if( !$result ) {\n $response = wp_remote_get($url);\n if ( is_wp_error( $response ) ) {\n $error_message = $response->get_error_message();\n error_log('PHP Warning: Something went wrong trying to get cxense search data: '.$error_message, E_USER_WARNING);\n return false;\n } else {\n $result = @json_decode($response['body'], true);\n if( !$result ) {\n error_log('PHP Warning: Unable to parse json from result ('.json_last_error().')', E_USER_WARNING);\n return false;\n }\n set_transient($cache_key, $result, $args['cache_ttl']);\n }\n }\n\n return $result;\n}",
"public function search($search);",
"function get_search($word, $searchTerm, $pageItem = 50, $pageNo = 1){\n\t\t// do nothing...\n\n\t\t// have the link of the search as a variable with the query at the end of it\n\t\t$url = \"https://thesession.org/\".$word.\"/search?q=\".$searchTerm.\"&format=json&perpage=\".$pageItem.\"&page=\".$pageNo;\n\n\t\t// put in the curl function\n\t\t$ch = curl_init($url);\n\n\t\t// create an array for the data to be pulled into\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json;', 'Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n\t\t// save response to variable\n\t\t$response = curl_exec($ch);\n\n\t\tif(empty($response)) {\n\t\t\t\t$error = curl_error($ch);\n\t\t //$error now contains the error thrown when curl_exec failed to execute\n\t\t echo $error;\n\t\t} else {\n\n\t\t\t\t//prints out the JSON for the new tunes for the session API\n\t\t\t\t$res = $response;\n\n\t\t\t\t// return JSON object;\n\t\t\t\treturn $res;\n\t\t} \n\n\t}",
"public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }",
"public function search() {\n\t\t$this->ApiClass = ClassRegistry::init('ApiGenerator.ApiClass');\n\t\t$conditions = array();\n\t\tif (isset($this->params['url']['query'])) {\n\t\t\t$query = $this->params['url']['query'];\n\t\t\t$conditions = array('ApiClass.search_index LIKE' => '%' . $query . '%');\n\t\t}\n\t\t$this->paginate['fields'] = array('DISTINCT ApiClass.name', 'ApiClass.search_index');\n\t\t$this->paginate['order'] = 'ApiClass.name ASC';\n\t\t$results = $this->paginate($this->ApiClass, $conditions);\n\t\t$classIndex = $this->ApiClass->getClassIndex();\n\t\t$this->helpers[] = 'Text';\n\t\t$this->set(compact('results', 'classIndex'));\n\t}",
"public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }",
"public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }"
] | [
"0.7561279",
"0.67975795",
"0.664306",
"0.65720814",
"0.6391867",
"0.63458365",
"0.6212787",
"0.62100136",
"0.6183537",
"0.61503804",
"0.6137931",
"0.61332023",
"0.61228967",
"0.61128926",
"0.6091",
"0.6075503",
"0.60692763",
"0.6060482",
"0.6054722",
"0.6052283",
"0.60426337",
"0.6016824",
"0.60127574",
"0.60127574",
"0.59422076",
"0.59407187",
"0.59160376",
"0.5903657",
"0.59028083",
"0.58930147",
"0.58901054",
"0.588749",
"0.5879431",
"0.5831665",
"0.5821943",
"0.58212787",
"0.5814968",
"0.5805243",
"0.57849234",
"0.5781432",
"0.57794505",
"0.57686776",
"0.5761477",
"0.5755565",
"0.57355964",
"0.5734383",
"0.57329285",
"0.5719442",
"0.57071686",
"0.57027",
"0.56994236",
"0.5698028",
"0.56928885",
"0.5688278",
"0.56876504",
"0.5679304",
"0.5675687",
"0.5671417",
"0.56534415",
"0.56518734",
"0.5647656",
"0.56474483",
"0.56473243",
"0.5639954",
"0.5639073",
"0.5639073",
"0.56328017",
"0.56287724",
"0.5618249",
"0.5609642",
"0.56064224",
"0.5590609",
"0.5568817",
"0.55669373",
"0.5564605",
"0.5563497",
"0.55631566",
"0.5555481",
"0.5552587",
"0.5551075",
"0.5546822",
"0.5544941",
"0.55425495",
"0.5542424",
"0.5536499",
"0.55306983",
"0.5514771",
"0.5503104",
"0.54940504",
"0.5488801",
"0.546554",
"0.5464408",
"0.54587233",
"0.5454873",
"0.54539055",
"0.54466015",
"0.5444709",
"0.54429454",
"0.54392964",
"0.54269844",
"0.5424487"
] | 0.0 | -1 |
Math from Noah McLean at MIT | function sigerrval($origerr,$numplaces){
$x=round(2*$origerr*(pow(10,(($numplaces-1)-floor(log10(2*$origerr)))))) * pow(10,(floor(log10(2*$origerr)))-($numplaces-1));
return($x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tinhchuvihinhtron($r){\n $bk = 3.14 * 2 * $r;\n return $bk;\n}",
"function tinhchuvihinhtron($r) {\n $bk = 3.14 * $r * 2;\n return $bk;\n}",
"function evclid($name1, $name2, $film1, $film2, $t)\n{\n $res = sqrt( \n\tpow($t->$name1->$film1 - $t->$name2->$film1,2 )\n\t+ pow ($t->$name1->$film2 - $t->$name2->$film2,2)\n );\n\n #return 1/(1+$res);\n return $res;\n}",
"function e4fn( $x ) {\r\n #$con;\r\n #$com;\r\n $con = 1.0 + $x;\r\n $com = 1.0 - $x;\r\n return (sqrt( (pow( $con, $con )) * (pow( $com, $com )) ));\r\n}",
"public function factor();",
"function aMathematicalfunction($input)\r\n{\r\n\treturn $value\r\n}",
"function sq($a, $b){\n return $a * $b;\n}",
"function math_eval($s) \r\n{\r\n $ma = eval('return ' . $s . ';');\r\n return $ma;\r\n}",
"function elevaralcubo($num1){\n \n $res=pow($num1,3);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function cubeIt($val) { \n return $val*$val*$val;\n }",
"abstract protected function calcular($x, $y);",
"function variant_pow($left, $right) {}",
"function elevaralcuadrado($num1){\n \n $res=pow($num1,2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function aspcalc()\n{\n global $ASP1, $ASP2, $SH, $MR, $SB;\n $SB = round ( ($ASP2 * $SH - $SH * $ASP1) / ($MR - $ASP2) );\n display ();\n}",
"function training_math_callback() {\n ctools_include('math-expr');\n $expr = new ctools_math_expr();\n $expr->evaluate('f(x, y)=x+y');\n $result = $expr->evaluate('f(10, 20)');\n\n return t('Result is !result', array(\n '!result' => $result,\n ));\n}",
"function elevar($num1,$num2){\n \n $res=pow($num1,$num2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function math ($first_number,$math,$second_number){\n switch ($math){\n case '+':\n return $first_number + $second_number;\n break;\n case '-':\n return $first_number - $second_number;\n break;\n case '*':\n return $first_number * $second_number;\n break;\n case '/':\n if ($second_number == 0){\n break;\n }else{\n return $first_number / $second_number;\n break;\n }\n }\n}",
"function warp1($c)\n{\n if($c > 10.3148)\n {\n return pow((561 + 40*$c)/10761, 2.4);\n }\n else\n {\n return $c / 3294.6;\n }\n}",
"function length2() {/*{{{*/\n $r = $this->getReal(); \n $i = $this->getI();\n $j = $this->getJ(); \n $k = $this->getK();\n return ($r*$r + $i*$i + $j*$j + $k*$k);\n }",
"function total($n,$q){\r\n\treturn $n*$q;\r\n\r\n}",
"function egyptianMultiplication($a, $n) {\n\t//we could use bits here\n\t//ONE DAY :P\n\t$startValue = $a;\n\tif ($n == 1) {\n\t\treturn $a;\n\t}\n\n\t$odd = $n % 2;\n\n\tif ($odd) {\n\t\t$n = $n - 1;\n\t}\n\t// $log2 = floor(log($n, 2));\n\n\t// for ($i = 0; $i < $log2; $i++) {\n\t// \t$n = $n / 2;\n\t// \t$a += $a;\n\t// }\n\t$i = 0;\n\twhile ($n != 1) {\n\t\t$n = $n / 2;\n\t\t$a += $a;\n\t\t$i++;\n\t}\n\n\tif ($odd) {\n\t\t$a += $startValue;\n\t}\n\treturn $a;\n}",
"function get_nice_equation($equation)\r\n{\r\n \r\n $equation = str_replace(' ' , '' ,$equation);\r\n \r\n $first_char = first_char($equation);\r\n $pos_f_char = strpos($equation,$first_char);\r\n \r\n \r\n if($pos_f_char == 0)\r\n {\r\n $equation1 = '1' . $equation;\r\n }\r\n else if(is_sign($equation[$pos_f_char - 1]) && $pos_f_char == 1)\r\n {\r\n $equation1 = $equation[0] . '1' . substr($equation , 1);\r\n }\r\n else\r\n {\r\n $equation1 = $equation;\r\n }\r\n \r\n \r\n $new_equation = '';\r\n if(filter_var($equation1[$pos_f_char - 1] , FILTER_VALIDATE_INT) || $equation1[$pos_f_char -1] == \"0\")\r\n {\r\n $new_equation = $equation1;\r\n \r\n }\r\n else\r\n {\r\n for($i=0;$i<strlen($equation1);$i++)\r\n {\r\n if($i == $pos_f_char)\r\n $new_equation .= '1';\r\n \r\n $new_equation .= $equation1[$i];\r\n }\r\n }\r\n $arr = secand_char($new_equation);\r\n $secand_char = $arr[0];\r\n $pos_s_char = $arr[1];\r\n \r\n \r\n $new_equation2 = '';\r\n if(filter_var($new_equation[$pos_s_char - 1] , FILTER_VALIDATE_INT) || $new_equation[$pos_s_char -1] == \"0\")\r\n {\r\n $new_equation2 = $new_equation;\r\n \r\n }\r\n else\r\n {\r\n for($i=0;$i<strlen($new_equation);$i++)\r\n {\r\n if($i == $pos_s_char)\r\n $new_equation2 .= '1';\r\n \r\n $new_equation2 .= $new_equation[$i];\r\n }\r\n }\r\n /*\r\n * if the equation written like this x^2-x+3 = 1\r\n * we want change the standard to be like this x^2 - x + 3 -1 = 0 \r\n */\r\n \r\n $fourth_factor = fourth_factor($new_equation2);\r\n $sign_fourth = sign_fourth_factor($new_equation2);\r\n \r\n $t_arr = third_factor($new_equation2);\r\n $third_factor = $t_arr[0];\r\n $pos_third = $t_arr[1];\r\n \r\n $sign_third = sign_third_factor($new_equation2);\r\n \r\n if($fourth_factor != 0)\r\n {\r\n //here we want to know the sign of fourth factor \r\n \r\n if($sign_fourth == \"+\")\r\n {\r\n //here we want Subtraction the third factor from fourth factor \r\n \r\n if($sign_third == \"+\")\r\n {\r\n $new_third = $third_factor - $fourth_factor;\r\n }\r\n else if($sign_third == \"-\")\r\n {\r\n $new_third = get_m($third_factor) - $fourth_factor;\r\n }\r\n }\r\n else if($sign_fourth == \"-\")\r\n {\r\n //here we want sum the third factor with fourth factor\r\n if($sign_third == \"+\")\r\n {\r\n \r\n $new_third = $third_factor + $fourth_factor;\r\n }\r\n else\r\n {\r\n $new_third = get_m($third_factor) + $fourth_factor;\r\n }\r\n }\r\n else\r\n {\r\n //there no probability to come here\r\n return \"fuck\";\r\n }\r\n //we want to know the sign of new third factor\r\n if($new_third > 0)\r\n {\r\n //so the sign is +\r\n //if sign is + so we will put + sign to equation on the place of old third factor\r\n if($pos_third == 0)//so he write the third factor on first\r\n {\r\n $substr = substr($new_equation2 , ($pos_third + strlen($third_factor) - 1));\r\n $new_equation3 = $new_third . $substr;\r\n }\r\n else\r\n {\r\n if($sign_third == \"+\" || $sign_third == \"-\")\r\n {\r\n //so we will just change the number\r\n \r\n \r\n $test_equation = '';\r\n for($i=0;$i<strlen($new_equation2);$i++)\r\n {\r\n if($i == $pos_third -1)\r\n {\r\n $test_equation .= \"+\" . $new_third;\r\n $i = $pos_third + strlen($third_factor) -1 ;\r\n }\r\n else\r\n {\r\n $test_equation .= $new_equation2[$i];\r\n }\r\n }\r\n \r\n $new_equation3 = $test_equation;\r\n }\r\n \r\n \r\n }\r\n }\r\n else\r\n {\r\n //so the sign of new third -\r\n \r\n if($pos_third == 0)//so he write the third factor on first\r\n {\r\n $substr = substr($new_equation2 , ($pos_third + strlen($third_factor) - 1));\r\n $new_equation3 = \"-\" . $new_third . $substr;\r\n }\r\n else\r\n {\r\n if($sign_third == \"+\" || $sign_third == \"-\")\r\n {\r\n //in + and in - we will change it with \r\n \r\n $test_equation = '';\r\n for($i=0;$i<strlen($new_equation2);$i++)\r\n {\r\n if($i == $pos_third -1)\r\n {\r\n $test_equation .= $new_third;\r\n $i = $pos_third + strlen($third_factor) -1 ;\r\n }\r\n else\r\n {\r\n $test_equation .= $new_equation2[$i];\r\n }\r\n }\r\n \r\n $new_equation3 = $test_equation;\r\n }\r\n \r\n }\r\n }\r\n }\r\n else if($fourth_factor == 0)\r\n {\r\n //nothing will change\r\n $new_equation3 = $new_equation2;\r\n }\r\n //we want change the old fourth factor to be zero\r\n $arr = explode(\"=\" , $new_equation3);\r\n \r\n $first_part = $arr[0];\r\n \r\n $new_equation4 = $first_part . \"=0\";\r\n \r\n \r\n \r\n /*\r\n * if the q_factor has nagative sign we will reverse all equation signs \r\n * like this -x^2+4x-12=0\r\n * will be like this x^2-4x+12=0\r\n */\r\n $q = q_factor($new_equation4);\r\n $pos_sign_q = $q[1] - 1;\r\n \r\n \r\n $s = s_factor($new_equation4);\r\n $pos_sign_s = $s[1] -1;\r\n if($pos_sign_s == -1)\r\n {\r\n $pos_sign_s++;\r\n }\r\n $sign_s_factor = sign_s_factor($new_equation4); \r\n \r\n $t = third_factor($new_equation4);\r\n $pos_sign_t = $t[1] -1;\r\n if($pos_sign_t == -1)\r\n {\r\n $pos_sign_t++;\r\n }\r\n $sign_t_factor = sign_third_factor($new_equation4);\r\n \r\n $sign_q_factor = sign_q_factor($new_equation4);\r\n if($sign_q_factor == \"-\")\r\n {\r\n $new_equation5 = '';\r\n for($i=0;$i<strlen($new_equation4);$i++)\r\n {\r\n if($i == $pos_sign_q)\r\n {\r\n $new_equation5 .= \"+\";\r\n }\r\n else if($i == $pos_sign_s)\r\n {\r\n \r\n if($sign_s_factor == \"+\")\r\n $new_equation5 .= \"-\";\r\n else \r\n $new_equation5 .= \"+\";\r\n \r\n if($pos_sign_s == 0)\r\n {\r\n $new_equation5 .= $new_equation4[$i]; \r\n }\r\n }\r\n else if($i == $pos_sign_t)\r\n {\r\n if($sign_t_factor == \"+\")\r\n $new_equation5 .= \"-\";\r\n else\r\n $new_equation5 .= \"+\";\r\n \r\n if($pos_sign_t == 0)\r\n $new_equation5 .= $new_equation4[$i];\r\n }\r\n else\r\n $new_equation5 .= $new_equation4[$i];\r\n }\r\n }\r\n else\r\n {\r\n //nothing will be change\r\n $new_equation5 = $new_equation4;\r\n }\r\n \r\n return $new_equation5;\r\n}",
"function calculerSurface ($longueur, $largeur, $hauteur)\r\n{\r\n $surfaceGrandMur = $longueur * $hauteur;\r\n $surfacePetitMur = $largeur * $hauteur;\r\n $surfaceTotale = ($surfaceGrandMur + $surfacePetitMur) * 2;\r\n \r\n return $surfaceTotale;\r\n // return 2 * $hauteur * ($longueur + $largeur);\r\n}",
"function cuadrado($a1){\n\t\t$a1*=$a1;\n\t\t$R = $a1;\n\t\treturn $R;\n\t\t\n\t}",
"function getMathRepresentation($primeFactorization) {\n $r = '';\n foreach ($primeFactorization as $p => $e) {\n $r .= \"$p^$e * \";\n }\n\n return substr($r, 0, - 3);\n}",
"function Dsbs($yl, $jf, $mwhgn){ \n return sqrt($yl) + round($jf) / atan($mwhgn);\n }",
"function sqrtMy($f)\n{\n $i = 0; \n while( ($i * $i) <= $f)\n $i++;\n $i--; \n $d = $f - $i * $i; \n $p = $d/(2*$i); \n $a = $i + $p; \n return $a-($p*$p)/(2*$a);\n}",
"function square($num)\n{\n return $num * $num;\n}",
"public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }",
"function square($num){\n $square = $num * $num;\n return $square;\n \n\n}",
"function opticalMod($base,$cs1,$lambda1,$defocus1)\n{\n $changeA=xaberration($cs1,$lambda1,$defocus1);\n $change=$base*exp(-2*M_PI*$changeA);\n return $change;\n}",
"function meterTomile($e){\n$getTotal = $e*0.000621371;\nreturn $getTotal;\n}",
"static private function champGaloisSum($a, $b){\n return $a ^ $b;\n }",
"function calculate($a, $b)\n\t\t{\n\t\t\t$sum1 = $a + $b;\n\t\t\treturn $sum1;\n\t\t}",
"function calculDelta($a, $b, $c){\n $a = $_POST['fname'];\n $b = $_POST['sname'];\n $c = $_POST['lname'];\n $delta = pow($b, 2) - 4*$a*$c;\n\n return $delta;\n}",
"public function calculate();",
"public function calculate();",
"function cuadrado($numero){\r\n $res=$numero*$numero;\r\n return $res;\r\n}",
"function conv($t) {\n$t*=1.8;\n$t+=32;\nreturn($t);}",
"public static function montgomeryExponentation($n, $a, $c, $n_, $R) {\n //echo \"montgomeryExponentation(n=$n, a=$a, c=$c, n'=$n_, R=$R):\";\n $R2 = ($R * $R) % $n;\n //echo \"\\n R^2=\".$R2;\n //echo \"\\n x=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, 1 * $R2);\n //echo \"\\n s=\";\n $s = Algebra::montgomeryReduction($n, $n_, $R, $a * $R2);\n $cBin = base_convert($c, 10, 2);\n echo \"\\n c=bin(\" . $cBin . \")\";\n $k = strlen($cBin) - 1;\n if ($cBin[$k] == 1) {\n $x = $s;\n //echo \"\\n x=s=$s, koska c[0] = 1\\n\";\n }\n //echo \"\\n Silmukka alkaa:\";\n $t = 1;\n for ($i = $k - 1; $i >= 0; $i--) {\n //echo \"\\n\\tKIERROS $t:\";\n //echo \"\\n\\t s=mr(s^2)=\";\n $s = Algebra::montgomeryReduction($n, $n_, $R, pow($s, 2));\n if ($cBin[$i] == 1) {\n //echo \"\\n\\t\\t x=mr(x*s)=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, $x * $s);\n //echo \", koska c[\".$t.\"]=1\";\n }\n $t++;\n }\n //echo \"\\n Silmukka loppuu: \\n x=mr(x)=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, $x);\n //echo \"\\n\";\n return $x;\n }",
"function s_factor($equation)\r\n{\r\n \r\n $first_char = first_char($equation);\r\n $pos_f_char = strpos($equation , $first_char);\r\n \r\n $arr = secand_char($equation);\r\n $secand_char = $arr[0];\r\n $pos_s_char = $arr[1];\r\n \r\n \r\n if($equation[$pos_f_char + 1] == \"^\")\r\n {\r\n $pos = $pos_s_char;\r\n }\r\n else\r\n {\r\n $pos = $pos_f_char;\r\n }\r\n \r\n $number1 = '';\r\n for($i = $pos-1;$i >= 0 ; $i--)\r\n {\r\n if(filter_var($equation[$i] , FILTER_VALIDATE_INT) || $equation[$i] == \"0\")\r\n {\r\n $number1 .= $equation[$i];\r\n \r\n }\r\n else\r\n break;\r\n }\r\n $number = '' ;\r\n for($i=strlen($number1)-1 ;$i >=0 ; $i--)\r\n {\r\n $number .= $number1[$i];\r\n }\r\n \r\n $pos_num = $pos - strlen($number);\r\n return array((int)$number , $pos_num);\r\n \r\n \r\n}",
"function square($number) {\n $square = $number * $number;\n return $square;\n}",
"function psquare($a){\r\n $b = (int)(sqrt($a));\r\n return($b * $b == $a);\r\n\r\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 }",
"function multiply($c, $d)\r\n{\r\n\treturn $c * $d;\r\n}",
"function potencias($base, $cant)\n{\n $retorno =\"\";\n\n for($i=1;$i<=$cant;$i++)\n {\n $retorno = \" \".$retorno.pow($base, $i).\" -\";\n }\n\n return $retorno;\n\n}",
"function modpow($a, $b, $m){\n\t\tif ($b == 0) return 1%$m;\n\t\t$tmp = modpow($a,$b/2,$m);\n\t\tif ($b%2 == 0) return $tmp*$tmp%$m;\n\t\treturn (($tmp*$tmp%$m)*$a)%$m;\n\t}",
"private function mcm($a, $b) {\n return (integer) ($a * $b) / $this->mcd($a,$b);\n }",
"function multiplicacion($numeroUno,$numeroDos){\r\n return $resultado=$numeroDos*$numeroUno;\r\n}",
"function imc($masse,$taille)\n\t{\n\t\tif ($taille > 0)\n\t\t{\n\t\t\t$res = $masse / pow($taille,2);\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}",
"function hesapla($x){\n return $x + ( $x * ( ($x%10)/100 ) );\n }",
"function getSomme( int $a , int $b )\n{\n return $a+$b;\n}",
"function Tn_tro_her($level,$MBn) // Ct dung\n{\n\treturn round((2300+450*($level-1)+pow(1.6*($level-1),3))*$MBn);\n}",
"function ttt($n){\n $s = [];\n $sum = 0;\n $ln = 0;\n $rn = 0;\n $fa = 0;\n $f = \"\";\n for($i=1;$i<$n;$i++){\n if ($i > 1) {\n $r = $l;\n }\n $l = $i*$i;\n if ($i == 1){\n $f = \"-\";\n $sum += $l;\n }else{\n $f = $i % 2 == 0 ? \"-\" : \"+\";\n if ($i % 2 == 0){\n $sum += $l+$r;\n }else{\n $sum += $l-$r;\n }\n }\n $s[] = \"($i*$i) $f\";\n \n \n \n }\n echo implode($s,\"*\").\"=\".$sum;\n return $sum;\n}",
"function candies($n, $m) {\n $result = 0; \n $result = intval($m/$n); \n $result = $n * $result; \n return $result;\n}",
"function testFunction($n) {\n\treturn ($n * $n * $n);\n}",
"function cuadrado(int $numero){\n return $numero * $numero;\n}",
"public function luas()\n {\n return $this->panjang * $this->lebar;\n }",
"public function mag2()\n\t{\n\t\t$m2 = ( $this->x()*$this->x() ) + ( $this->y()*$this->y() );\n\t\treturn $m2;\n\t}",
"function somar($a, $b){\n\n\treturn $a + $b;\n}",
"public function getModulus(): float\n {\n return sqrt($this->real ** 2 + $this->imaginary ** 2);\n }",
"function jc1($n)\n{\n\t$sum=1;\n\tfor($i=1;$i<=$n;$i++)\n\t{\n\t\t$sum=$sum*$i;\n\t}\n\techo $sum;\n}",
"function multiply($p1, $p2, $p3)\n{\n return $p1 * $p2 + $p3;\n}",
"function multiply(string $a, string $b): string {\n if($a == 0 || $b == 0) return \"0\";\n $a = ltrim($a, \"0\");\n $b = ltrim($b, \"0\");\n $top_matrix = str_split($a);\n $right_matrix = str_split($b);\n $WIDTH = strlen($a);\n $HEIGHT = strlen($b);\n $matrix = [];\n for($i = 0; $i < sizeof($top_matrix); $i++){\n $tmp =[];\n for($j = 0; $j < sizeof($right_matrix); $j++){\n $mul = intval($top_matrix[$i]) * intval($right_matrix[$j]);\n ($mul < 10) ? array_push($tmp,\"0\" . strval($mul)) : array_push($tmp, strval($mul));\n }\n array_push($matrix, $tmp);\n }\n\n $sums = [];\n $tmp = [];\n $entered = false;\n\n for($i = 0; $i <= $WIDTH + $HEIGHT - 2; $i++){\n $sum = 0;\n if($tmp != []) $sum = array_sum($tmp);\n $tmp = [];\n for($j = 0; $j <= $i; $j++){\n $entered = true;\n $x = $i - $j;\n if($x < $HEIGHT && $j < $WIDTH){\n $sum += (int)$matrix[$j][$x][0];\n array_push($tmp, (int)$matrix[$j][$x][1]);\n }\n \n }\n array_push($sums, $sum);\n }\n array_push($sums, array_sum($tmp));\n \n $result = [];\n $remainder = 0;\n $sums = array_reverse($sums);\n for($i = 0; $i < sizeof($sums); $i++){\n $current_value = $sums[$i] + $remainder;\n $remainder = 0;\n if($current_value > 9){\n $val = $current_value.\"\";\n $sums[$i] = (int)substr($val, -1);\n $remainder = (int)substr($val, 0, -1);\n }else{\n $sums[$i] = $current_value;\n }\n }\n $sums = array_reverse($sums);\n\n return ltrim(implode(\"\", $sums), \"0\");\n}",
"function bases($aa,$bb,$cc,$l,$m,$n,$psi4,$phi4,$tetha4)\n{\n $ax=array();\n $ay=array();\n $az=array();\n $a11=$aa;\n $a12=0;\n $a13=0;\n $a21=0;\n $a22=$bb;\n $a23=0;\n $a31=0;\n $a32=0;\n $a33=$cc;\n $rotated=rotativeMatrix($phi4,$tetha4,$psi4);\n $b11=$rotated[0];\n $b12=$rotated[1];\n $b13=$rotated[2];\n $b21=$rotated[3];\n $b22=$rotated[4];\n $b23=$rotated[5];\n $b31=$rotated[6];\n $b32=$rotated[7];\n $b33=$rotated[8];\n $c11=$b11*$a11;\n $c12=$b12*$a22;\n $c13=$b13*$a33;\n $c21=$b21*$a11;\n $c22=$b22*$a22;\n $c23=$b23*$a33;\n $c31=$b31*$a11;\n $c32=$b32*$a22;\n $c33=$b33*$a33;\n for($i=-$l;$i<$l;$i++)\n {\n for($j=-$m;$j<$m;$j++)\n {\n for($k=-$n;$k<$n;$k++)\n {\n $aaa=($j*$c11)+($i*$c12)+($k*$c13);\n $bbb=($j*$c21)+($i*$c22)+($k*$c23);\n $ccc=($j*$c31)+($i*$c32)+($k*$c33);\n $mon2=($i+0.5)*$bbb;\n $mon1=($j+0.5)*$aaa;\n $ax[]=$j*$aaa;\n $ay[]=$i*$bbb;\n $az[]=$k*$ccc;\n $ax[]=$mon1;\n $ay[]=$mon2;\n $az[]=$k*$ccc;\n }\n }\n }\n return [$ax,$ay,$az];\n}",
"function shwe_16_pell_to_15_pell($kyat){\n $ans = $kyat * 17;\n $ans = $ans / 16;\n return $ans;\n}",
"function doneComputing()\n{\n\tglobal $ieeeSigno, $ieeeMantisa;\n\techo \"\\n--------------------------\\n\"; // por cuestiones de estetica\n\techo \"El resultado: \";\n\techo $ieeeMantisa * $ieeeSigno; // aqui desplegamos nuestro resultado final, multiplicando el numero de la conversion por su signo correspondiente\n\techo \"\\n\\n\";\n\treturn 0;\n}",
"private function calcResult(): void {\n\t\tswitch($this->rndOperator) {\n\t\t\tcase self::PLUS:\n\t\t\t\t$this->result = $this->rndNumber1 + $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MINUS:\n\t\t\t\t// Avoid negative results\n\t\t\t\tif($this->rndNumber1 < $this->rndNumber2) {\n\t\t\t\t\t$tmp = $this->rndNumber1;\n\t\t\t\t\t$this->rndNumber1 = $this->rndNumber2;\n\t\t\t\t\t$this->rndNumber2 = $tmp;\n\t\t\t\t}\n\n\t\t\t\t$this->result = $this->rndNumber1 - $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MULTIPLE:\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->rndNumber1 * $this->rndNumber2;\n\t\t}\n\t}",
"function penjumlahan2($b,$c){\r\n\r\n $a = $b + $c;\r\n\r\n return $a;\r\n}",
"function PI($h) \n\t{\n\t//Femme = Taille(cm) - 100 - [Taille(cm) - 150] / 2 \n\t//Homme = Taille(cm) - 100 - [Taille(cm) - 150] / 4\n\t//âge de supérieur à 18 ans ;taille entre 140 et 220 cm (55 à 87 inch)\n\t//Poids idéal = 50 + [Taille(cm) - 150]/4 + [Age(an) - 20]/4\n\t$PI =$h-100-($h-150)/4 .\"kg\" ;\n\treturn $PI;\n\t}",
"function soma($x, $y) {\r\n\t\t\treturn $x + $y;\r\n\t\t}",
"function norm() {\n return sqrt($this->length2());\n }",
"function next_m($k, $m, $x){\n return $m + ($x - $m) / $k;\n}",
"function p3_ex4() {\n for ($i = 1; $i <= 10; $i = $i += ($i/2))\n $return .= $i.\" - \";\n\n return $return;\n}",
"public function calculAc() {\n\n return $this->va * (1 + ($this->nbta - $this->nbad) / $this->nbta);\n }",
"public function exponent();",
"static function math_form() {\n\t\t\t// Check if jpp_math_pass cookie is set and it matches valid transient\n\t\t\tif( isset( $_COOKIE[ 'jpp_math_pass' ] ) ) {\n\t\t\t\t$jetpack_protect = Jetpack_Protect_Module::instance();\n\t\t\t\t$transient = $jetpack_protect->get_transient( 'jpp_math_pass_' . $_COOKIE[ 'jpp_math_pass' ] );\n\n\t\t\t\tif( $transient && $transient > 0 ) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$num1 = rand( 0, 10 );\n\t\t\t$num2 = rand( 1, 10 );\n\t\t\t$ans = $num1 + $num2;\n\n\t\t\t$time_window = Jetpack_Protect_Math_Authenticate::time_window();\n\t\t\t$salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|';\n\t\t\t$salted_ans = hash_hmac( 'sha1', $ans, $salt . $time_window );\n\t\t\t?>\n\t\t\t<div style=\"margin: 5px 0 20px;\">\n\t\t\t\t<label for=\"jetpack_protect_answer\">\n\t\t\t\t\t<?php esc_html_e( 'Prove your humanity', 'jetpack' ); ?>\n\t\t\t\t</label>\n\t\t\t\t<br/>\n\t\t\t\t<span style=\"vertical-align:super;\">\n\t\t\t\t\t<?php echo esc_html( \"$num1 + $num2 = \" ); ?>\n\t\t\t\t</span>\n\t\t\t\t<input type=\"text\" id=\"jetpack_protect_answer\" name=\"jetpack_protect_num\" value=\"\" size=\"2\" style=\"width:30px;height:25px;vertical-align:middle;font-size:13px;\" class=\"input\" />\n\t\t\t\t<input type=\"hidden\" name=\"jetpack_protect_answer\" value=\"<?php echo esc_attr( $salted_ans ); ?>\" />\n\t\t\t</div>\n\t\t<?php\n\t\t}",
"function promedio_general($vector){ \n $promedio=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n $promedio=$promedio+$n;\n }\n }\n return ($promedio/10);\n }",
"function montantTot () {\n\t $montant = 0;\n\t for ($i = 0; $i < count ($_SESSION['panier']['numE']);$i ++) {\n\t\t $montant += $_SESSION['panier']['nbr'][$i] * $_SESSION['panier']['prix'][$i]; \n\t }\n\t return $montant;\n }",
"function verteilung2($n) {\n return (powInt($n, 7/4));\n}",
"function iva($subtotal, $iva = 0.21){ // cuando le ponemos el valor a un parametro nos permite que cada vez que haga la operacion, lo haga con el valor que le pusimos al parametro obviamente, esto es mejor que asignarle un valor desde dentro y no estableciendo el valor fijo\n $porcentaje = $subtotal * $iva;\n\n // pusimos en comentarios esto porque no necesitamos que nos haga una operacion final, solo que nos muestre el dato final\n // $solucion = $subtotal + $porcentaje;\n return $porcentaje;\n }",
"function multiplicar(int $a, int $b){\n return $a * $b;\n}",
"public function rgveda_verse_modern($gra) {\n $data = [\n [1,191,1,1,191],\n [192,234,2,1,43],\n [235,295,3,1,62],\n [297,354,4,1,58],\n [355,441,5,1,87],\n [442,516,6,1,75],\n [517,620,7,1,104],\n [621,668,8,1,48],\n [1018,1028,8,59,59], //Vālakhilya hymns 1—11\n [669,712,8,60,103],\n [713,826,9,1,114],\n [827,1017,10,1,191]\n ];\n for($i=0;$i<count($data);$i++) {\n list($gra1,$gra2,$mandala,$hymn1,$hymn2) = $data[$i];\n if (($gra1 <= $gra) && ($gra<=$gra2)) {\n $hymn = $hymn1 + ($gra - $gra1);\n $x = \"$mandala.$hymn\";\n return $x;\n }\n }\n return \"?\"; // algorithm failed\n}",
"function calculate() {\n switch($this->operator) {\n case \"add\":\n return $this->num1 + $this->num2;\n case \"sub\":\n return $this->num1 - $this->num2;\n case \"mult\":\n return $this->num1 * $this->num2;\n case \"div\":\n return $this->num1 / $this->num2;\n default:\n return \"Invalid Operator\";\n }\n }",
"function resta($a,$b)\n {\n return $a-$b;\n }",
"final public function exp2()\n {\n $func = function(&$element)\n {\n $element = 2 ** $element;\n };\n\n return $this->copy()->walk_recursive($func);\n }",
"function power($base,$n){\r\n $x=pow($base,$n);\r\n return $x;\r\n}",
"function getInterestFactor($interest)\n{\n $rate = $interest / 365.25;\n return $rate;\n}",
"function bmi($bb, $tb){\n\t$bmi = $bb / (($tb * 0.01) * ($tb * 0.01));\n\treturn $bmi;\n}",
"function calculate($num1, $num2) { // Args are just like python, no specification -> must check\n return $num1 + $num2;\n}",
"function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}",
"function kira2($dulu,$kini)\n{\n return @number_format((($kini-$dulu)/$dulu)*100,0,'.',',');\n //@$kiraan=(($kini-$dulu)/$dulu)*100;\n}",
"function calculerSurfaceMurs ($largeur, $longueur, $hauteur)\n {\n // $surface = ($largeur * $hauteur + $longueur * $hauteur) * 2;\n $surface = 2 * $hauteur * ($largeur + $longueur);\n\n return $surface; \n }",
"function exp(float $num): float\n{\n return php_exp($num);\n}",
"function findDifference($a, $b) {\n $s1 = $a[0] * $a[1] * $a[2];\n $s2 = $b[0] * $b[1] * $b[2];\n \n return abs ($s1 - $s2);\n}",
"public function l2Norm() : float\n {\n return sqrt($this->square()->sum()->sum());\n }",
"function verteilung3($n) {\n return (powInt($n, 3)) / 3;\n}",
"function armstrong_number(int $num){\n $temp = $num; // store the number in a temporary variable\n $result = 0; // variable to store the result\n\n // loop till the the temporary variable is not equal to zero\n while($temp != 0){\n $remainder = $temp%10; // get the remainder of temp variable divided by 10\n $result = $result + $remainder*$remainder*$remainder; // add the result with cube of the remainder\n\n $temp = $temp/10; // change the temp variable by dividing it by 10\n }\n\n return $result; // return result\n }",
"function findSharp($intOrig, $intFinal)\n{\n $intFinal = $intFinal * (750.0 / $intOrig);\n $intA = 52;\n $intB = -0.27810650887573124;\n $intC = .00047337278106508946;\n $intRes = $intA + $intB * $intFinal + $intC * $intFinal * $intFinal;\n return max(round($intRes), 0);\n}",
"public function evaluateWealth() : float;",
"public function getE()\n {\n $es = $this->getES();\n\n return sqrt($es);\n }"
] | [
"0.6490454",
"0.6201972",
"0.6160381",
"0.6133771",
"0.60785586",
"0.6018784",
"0.6006412",
"0.59337264",
"0.59232515",
"0.59186137",
"0.5848588",
"0.58387154",
"0.5792689",
"0.5772175",
"0.5746004",
"0.5744475",
"0.5688037",
"0.5672046",
"0.5667053",
"0.5666641",
"0.5665748",
"0.5640119",
"0.5625299",
"0.561516",
"0.561429",
"0.56098884",
"0.5608553",
"0.5601882",
"0.55947405",
"0.5566069",
"0.55659693",
"0.55579054",
"0.55515546",
"0.5537883",
"0.5533727",
"0.5533096",
"0.5533096",
"0.5531955",
"0.5509639",
"0.5503382",
"0.55028856",
"0.54948926",
"0.54920137",
"0.5489736",
"0.5487594",
"0.54833174",
"0.5477",
"0.54762423",
"0.5470001",
"0.54687136",
"0.5464086",
"0.5443253",
"0.5438314",
"0.5404538",
"0.54045326",
"0.53964007",
"0.5393352",
"0.53895366",
"0.5382844",
"0.53796417",
"0.53756535",
"0.536738",
"0.5367307",
"0.53615487",
"0.5349933",
"0.5348668",
"0.534649",
"0.53368986",
"0.5336445",
"0.5331511",
"0.5328864",
"0.5323759",
"0.5314917",
"0.5313033",
"0.5310064",
"0.53078634",
"0.53068507",
"0.5304808",
"0.5304752",
"0.5297657",
"0.5295757",
"0.52938515",
"0.5293391",
"0.5290453",
"0.5287239",
"0.5280262",
"0.5272214",
"0.52675986",
"0.5260392",
"0.5251634",
"0.52512366",
"0.5250846",
"0.52503955",
"0.5248376",
"0.524546",
"0.5239845",
"0.52394485",
"0.523836",
"0.52377325",
"0.5236044",
"0.52296543"
] | 0.0 | -1 |
Math from Noah McLean at MIT | function sigaloneval($origerr,$numplaces){
$x=round($origerr*(pow(10,(($numplaces-1)-floor(log10($origerr)))))) * pow(10,(floor(log10($origerr)))-($numplaces-1));
return($x);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tinhchuvihinhtron($r){\n $bk = 3.14 * 2 * $r;\n return $bk;\n}",
"function tinhchuvihinhtron($r) {\n $bk = 3.14 * $r * 2;\n return $bk;\n}",
"function evclid($name1, $name2, $film1, $film2, $t)\n{\n $res = sqrt( \n\tpow($t->$name1->$film1 - $t->$name2->$film1,2 )\n\t+ pow ($t->$name1->$film2 - $t->$name2->$film2,2)\n );\n\n #return 1/(1+$res);\n return $res;\n}",
"function e4fn( $x ) {\r\n #$con;\r\n #$com;\r\n $con = 1.0 + $x;\r\n $com = 1.0 - $x;\r\n return (sqrt( (pow( $con, $con )) * (pow( $com, $com )) ));\r\n}",
"public function factor();",
"function aMathematicalfunction($input)\r\n{\r\n\treturn $value\r\n}",
"function sq($a, $b){\n return $a * $b;\n}",
"function math_eval($s) \r\n{\r\n $ma = eval('return ' . $s . ';');\r\n return $ma;\r\n}",
"function elevaralcubo($num1){\n \n $res=pow($num1,3);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function cubeIt($val) { \n return $val*$val*$val;\n }",
"abstract protected function calcular($x, $y);",
"function variant_pow($left, $right) {}",
"function elevaralcuadrado($num1){\n \n $res=pow($num1,2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function aspcalc()\n{\n global $ASP1, $ASP2, $SH, $MR, $SB;\n $SB = round ( ($ASP2 * $SH - $SH * $ASP1) / ($MR - $ASP2) );\n display ();\n}",
"function training_math_callback() {\n ctools_include('math-expr');\n $expr = new ctools_math_expr();\n $expr->evaluate('f(x, y)=x+y');\n $result = $expr->evaluate('f(10, 20)');\n\n return t('Result is !result', array(\n '!result' => $result,\n ));\n}",
"function elevar($num1,$num2){\n \n $res=pow($num1,$num2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function math ($first_number,$math,$second_number){\n switch ($math){\n case '+':\n return $first_number + $second_number;\n break;\n case '-':\n return $first_number - $second_number;\n break;\n case '*':\n return $first_number * $second_number;\n break;\n case '/':\n if ($second_number == 0){\n break;\n }else{\n return $first_number / $second_number;\n break;\n }\n }\n}",
"function warp1($c)\n{\n if($c > 10.3148)\n {\n return pow((561 + 40*$c)/10761, 2.4);\n }\n else\n {\n return $c / 3294.6;\n }\n}",
"function length2() {/*{{{*/\n $r = $this->getReal(); \n $i = $this->getI();\n $j = $this->getJ(); \n $k = $this->getK();\n return ($r*$r + $i*$i + $j*$j + $k*$k);\n }",
"function total($n,$q){\r\n\treturn $n*$q;\r\n\r\n}",
"function egyptianMultiplication($a, $n) {\n\t//we could use bits here\n\t//ONE DAY :P\n\t$startValue = $a;\n\tif ($n == 1) {\n\t\treturn $a;\n\t}\n\n\t$odd = $n % 2;\n\n\tif ($odd) {\n\t\t$n = $n - 1;\n\t}\n\t// $log2 = floor(log($n, 2));\n\n\t// for ($i = 0; $i < $log2; $i++) {\n\t// \t$n = $n / 2;\n\t// \t$a += $a;\n\t// }\n\t$i = 0;\n\twhile ($n != 1) {\n\t\t$n = $n / 2;\n\t\t$a += $a;\n\t\t$i++;\n\t}\n\n\tif ($odd) {\n\t\t$a += $startValue;\n\t}\n\treturn $a;\n}",
"function get_nice_equation($equation)\r\n{\r\n \r\n $equation = str_replace(' ' , '' ,$equation);\r\n \r\n $first_char = first_char($equation);\r\n $pos_f_char = strpos($equation,$first_char);\r\n \r\n \r\n if($pos_f_char == 0)\r\n {\r\n $equation1 = '1' . $equation;\r\n }\r\n else if(is_sign($equation[$pos_f_char - 1]) && $pos_f_char == 1)\r\n {\r\n $equation1 = $equation[0] . '1' . substr($equation , 1);\r\n }\r\n else\r\n {\r\n $equation1 = $equation;\r\n }\r\n \r\n \r\n $new_equation = '';\r\n if(filter_var($equation1[$pos_f_char - 1] , FILTER_VALIDATE_INT) || $equation1[$pos_f_char -1] == \"0\")\r\n {\r\n $new_equation = $equation1;\r\n \r\n }\r\n else\r\n {\r\n for($i=0;$i<strlen($equation1);$i++)\r\n {\r\n if($i == $pos_f_char)\r\n $new_equation .= '1';\r\n \r\n $new_equation .= $equation1[$i];\r\n }\r\n }\r\n $arr = secand_char($new_equation);\r\n $secand_char = $arr[0];\r\n $pos_s_char = $arr[1];\r\n \r\n \r\n $new_equation2 = '';\r\n if(filter_var($new_equation[$pos_s_char - 1] , FILTER_VALIDATE_INT) || $new_equation[$pos_s_char -1] == \"0\")\r\n {\r\n $new_equation2 = $new_equation;\r\n \r\n }\r\n else\r\n {\r\n for($i=0;$i<strlen($new_equation);$i++)\r\n {\r\n if($i == $pos_s_char)\r\n $new_equation2 .= '1';\r\n \r\n $new_equation2 .= $new_equation[$i];\r\n }\r\n }\r\n /*\r\n * if the equation written like this x^2-x+3 = 1\r\n * we want change the standard to be like this x^2 - x + 3 -1 = 0 \r\n */\r\n \r\n $fourth_factor = fourth_factor($new_equation2);\r\n $sign_fourth = sign_fourth_factor($new_equation2);\r\n \r\n $t_arr = third_factor($new_equation2);\r\n $third_factor = $t_arr[0];\r\n $pos_third = $t_arr[1];\r\n \r\n $sign_third = sign_third_factor($new_equation2);\r\n \r\n if($fourth_factor != 0)\r\n {\r\n //here we want to know the sign of fourth factor \r\n \r\n if($sign_fourth == \"+\")\r\n {\r\n //here we want Subtraction the third factor from fourth factor \r\n \r\n if($sign_third == \"+\")\r\n {\r\n $new_third = $third_factor - $fourth_factor;\r\n }\r\n else if($sign_third == \"-\")\r\n {\r\n $new_third = get_m($third_factor) - $fourth_factor;\r\n }\r\n }\r\n else if($sign_fourth == \"-\")\r\n {\r\n //here we want sum the third factor with fourth factor\r\n if($sign_third == \"+\")\r\n {\r\n \r\n $new_third = $third_factor + $fourth_factor;\r\n }\r\n else\r\n {\r\n $new_third = get_m($third_factor) + $fourth_factor;\r\n }\r\n }\r\n else\r\n {\r\n //there no probability to come here\r\n return \"fuck\";\r\n }\r\n //we want to know the sign of new third factor\r\n if($new_third > 0)\r\n {\r\n //so the sign is +\r\n //if sign is + so we will put + sign to equation on the place of old third factor\r\n if($pos_third == 0)//so he write the third factor on first\r\n {\r\n $substr = substr($new_equation2 , ($pos_third + strlen($third_factor) - 1));\r\n $new_equation3 = $new_third . $substr;\r\n }\r\n else\r\n {\r\n if($sign_third == \"+\" || $sign_third == \"-\")\r\n {\r\n //so we will just change the number\r\n \r\n \r\n $test_equation = '';\r\n for($i=0;$i<strlen($new_equation2);$i++)\r\n {\r\n if($i == $pos_third -1)\r\n {\r\n $test_equation .= \"+\" . $new_third;\r\n $i = $pos_third + strlen($third_factor) -1 ;\r\n }\r\n else\r\n {\r\n $test_equation .= $new_equation2[$i];\r\n }\r\n }\r\n \r\n $new_equation3 = $test_equation;\r\n }\r\n \r\n \r\n }\r\n }\r\n else\r\n {\r\n //so the sign of new third -\r\n \r\n if($pos_third == 0)//so he write the third factor on first\r\n {\r\n $substr = substr($new_equation2 , ($pos_third + strlen($third_factor) - 1));\r\n $new_equation3 = \"-\" . $new_third . $substr;\r\n }\r\n else\r\n {\r\n if($sign_third == \"+\" || $sign_third == \"-\")\r\n {\r\n //in + and in - we will change it with \r\n \r\n $test_equation = '';\r\n for($i=0;$i<strlen($new_equation2);$i++)\r\n {\r\n if($i == $pos_third -1)\r\n {\r\n $test_equation .= $new_third;\r\n $i = $pos_third + strlen($third_factor) -1 ;\r\n }\r\n else\r\n {\r\n $test_equation .= $new_equation2[$i];\r\n }\r\n }\r\n \r\n $new_equation3 = $test_equation;\r\n }\r\n \r\n }\r\n }\r\n }\r\n else if($fourth_factor == 0)\r\n {\r\n //nothing will change\r\n $new_equation3 = $new_equation2;\r\n }\r\n //we want change the old fourth factor to be zero\r\n $arr = explode(\"=\" , $new_equation3);\r\n \r\n $first_part = $arr[0];\r\n \r\n $new_equation4 = $first_part . \"=0\";\r\n \r\n \r\n \r\n /*\r\n * if the q_factor has nagative sign we will reverse all equation signs \r\n * like this -x^2+4x-12=0\r\n * will be like this x^2-4x+12=0\r\n */\r\n $q = q_factor($new_equation4);\r\n $pos_sign_q = $q[1] - 1;\r\n \r\n \r\n $s = s_factor($new_equation4);\r\n $pos_sign_s = $s[1] -1;\r\n if($pos_sign_s == -1)\r\n {\r\n $pos_sign_s++;\r\n }\r\n $sign_s_factor = sign_s_factor($new_equation4); \r\n \r\n $t = third_factor($new_equation4);\r\n $pos_sign_t = $t[1] -1;\r\n if($pos_sign_t == -1)\r\n {\r\n $pos_sign_t++;\r\n }\r\n $sign_t_factor = sign_third_factor($new_equation4);\r\n \r\n $sign_q_factor = sign_q_factor($new_equation4);\r\n if($sign_q_factor == \"-\")\r\n {\r\n $new_equation5 = '';\r\n for($i=0;$i<strlen($new_equation4);$i++)\r\n {\r\n if($i == $pos_sign_q)\r\n {\r\n $new_equation5 .= \"+\";\r\n }\r\n else if($i == $pos_sign_s)\r\n {\r\n \r\n if($sign_s_factor == \"+\")\r\n $new_equation5 .= \"-\";\r\n else \r\n $new_equation5 .= \"+\";\r\n \r\n if($pos_sign_s == 0)\r\n {\r\n $new_equation5 .= $new_equation4[$i]; \r\n }\r\n }\r\n else if($i == $pos_sign_t)\r\n {\r\n if($sign_t_factor == \"+\")\r\n $new_equation5 .= \"-\";\r\n else\r\n $new_equation5 .= \"+\";\r\n \r\n if($pos_sign_t == 0)\r\n $new_equation5 .= $new_equation4[$i];\r\n }\r\n else\r\n $new_equation5 .= $new_equation4[$i];\r\n }\r\n }\r\n else\r\n {\r\n //nothing will be change\r\n $new_equation5 = $new_equation4;\r\n }\r\n \r\n return $new_equation5;\r\n}",
"function calculerSurface ($longueur, $largeur, $hauteur)\r\n{\r\n $surfaceGrandMur = $longueur * $hauteur;\r\n $surfacePetitMur = $largeur * $hauteur;\r\n $surfaceTotale = ($surfaceGrandMur + $surfacePetitMur) * 2;\r\n \r\n return $surfaceTotale;\r\n // return 2 * $hauteur * ($longueur + $largeur);\r\n}",
"function cuadrado($a1){\n\t\t$a1*=$a1;\n\t\t$R = $a1;\n\t\treturn $R;\n\t\t\n\t}",
"function getMathRepresentation($primeFactorization) {\n $r = '';\n foreach ($primeFactorization as $p => $e) {\n $r .= \"$p^$e * \";\n }\n\n return substr($r, 0, - 3);\n}",
"function Dsbs($yl, $jf, $mwhgn){ \n return sqrt($yl) + round($jf) / atan($mwhgn);\n }",
"function sqrtMy($f)\n{\n $i = 0; \n while( ($i * $i) <= $f)\n $i++;\n $i--; \n $d = $f - $i * $i; \n $p = $d/(2*$i); \n $a = $i + $p; \n return $a-($p*$p)/(2*$a);\n}",
"function square($num)\n{\n return $num * $num;\n}",
"public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }",
"function square($num){\n $square = $num * $num;\n return $square;\n \n\n}",
"function opticalMod($base,$cs1,$lambda1,$defocus1)\n{\n $changeA=xaberration($cs1,$lambda1,$defocus1);\n $change=$base*exp(-2*M_PI*$changeA);\n return $change;\n}",
"function meterTomile($e){\n$getTotal = $e*0.000621371;\nreturn $getTotal;\n}",
"static private function champGaloisSum($a, $b){\n return $a ^ $b;\n }",
"function calculate($a, $b)\n\t\t{\n\t\t\t$sum1 = $a + $b;\n\t\t\treturn $sum1;\n\t\t}",
"function calculDelta($a, $b, $c){\n $a = $_POST['fname'];\n $b = $_POST['sname'];\n $c = $_POST['lname'];\n $delta = pow($b, 2) - 4*$a*$c;\n\n return $delta;\n}",
"public function calculate();",
"public function calculate();",
"function cuadrado($numero){\r\n $res=$numero*$numero;\r\n return $res;\r\n}",
"function conv($t) {\n$t*=1.8;\n$t+=32;\nreturn($t);}",
"public static function montgomeryExponentation($n, $a, $c, $n_, $R) {\n //echo \"montgomeryExponentation(n=$n, a=$a, c=$c, n'=$n_, R=$R):\";\n $R2 = ($R * $R) % $n;\n //echo \"\\n R^2=\".$R2;\n //echo \"\\n x=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, 1 * $R2);\n //echo \"\\n s=\";\n $s = Algebra::montgomeryReduction($n, $n_, $R, $a * $R2);\n $cBin = base_convert($c, 10, 2);\n echo \"\\n c=bin(\" . $cBin . \")\";\n $k = strlen($cBin) - 1;\n if ($cBin[$k] == 1) {\n $x = $s;\n //echo \"\\n x=s=$s, koska c[0] = 1\\n\";\n }\n //echo \"\\n Silmukka alkaa:\";\n $t = 1;\n for ($i = $k - 1; $i >= 0; $i--) {\n //echo \"\\n\\tKIERROS $t:\";\n //echo \"\\n\\t s=mr(s^2)=\";\n $s = Algebra::montgomeryReduction($n, $n_, $R, pow($s, 2));\n if ($cBin[$i] == 1) {\n //echo \"\\n\\t\\t x=mr(x*s)=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, $x * $s);\n //echo \", koska c[\".$t.\"]=1\";\n }\n $t++;\n }\n //echo \"\\n Silmukka loppuu: \\n x=mr(x)=\";\n $x = Algebra::montgomeryReduction($n, $n_, $R, $x);\n //echo \"\\n\";\n return $x;\n }",
"function s_factor($equation)\r\n{\r\n \r\n $first_char = first_char($equation);\r\n $pos_f_char = strpos($equation , $first_char);\r\n \r\n $arr = secand_char($equation);\r\n $secand_char = $arr[0];\r\n $pos_s_char = $arr[1];\r\n \r\n \r\n if($equation[$pos_f_char + 1] == \"^\")\r\n {\r\n $pos = $pos_s_char;\r\n }\r\n else\r\n {\r\n $pos = $pos_f_char;\r\n }\r\n \r\n $number1 = '';\r\n for($i = $pos-1;$i >= 0 ; $i--)\r\n {\r\n if(filter_var($equation[$i] , FILTER_VALIDATE_INT) || $equation[$i] == \"0\")\r\n {\r\n $number1 .= $equation[$i];\r\n \r\n }\r\n else\r\n break;\r\n }\r\n $number = '' ;\r\n for($i=strlen($number1)-1 ;$i >=0 ; $i--)\r\n {\r\n $number .= $number1[$i];\r\n }\r\n \r\n $pos_num = $pos - strlen($number);\r\n return array((int)$number , $pos_num);\r\n \r\n \r\n}",
"function square($number) {\n $square = $number * $number;\n return $square;\n}",
"function psquare($a){\r\n $b = (int)(sqrt($a));\r\n return($b * $b == $a);\r\n\r\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 }",
"function multiply($c, $d)\r\n{\r\n\treturn $c * $d;\r\n}",
"function potencias($base, $cant)\n{\n $retorno =\"\";\n\n for($i=1;$i<=$cant;$i++)\n {\n $retorno = \" \".$retorno.pow($base, $i).\" -\";\n }\n\n return $retorno;\n\n}",
"function modpow($a, $b, $m){\n\t\tif ($b == 0) return 1%$m;\n\t\t$tmp = modpow($a,$b/2,$m);\n\t\tif ($b%2 == 0) return $tmp*$tmp%$m;\n\t\treturn (($tmp*$tmp%$m)*$a)%$m;\n\t}",
"private function mcm($a, $b) {\n return (integer) ($a * $b) / $this->mcd($a,$b);\n }",
"function multiplicacion($numeroUno,$numeroDos){\r\n return $resultado=$numeroDos*$numeroUno;\r\n}",
"function imc($masse,$taille)\n\t{\n\t\tif ($taille > 0)\n\t\t{\n\t\t\t$res = $masse / pow($taille,2);\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}",
"function hesapla($x){\n return $x + ( $x * ( ($x%10)/100 ) );\n }",
"function getSomme( int $a , int $b )\n{\n return $a+$b;\n}",
"function Tn_tro_her($level,$MBn) // Ct dung\n{\n\treturn round((2300+450*($level-1)+pow(1.6*($level-1),3))*$MBn);\n}",
"function ttt($n){\n $s = [];\n $sum = 0;\n $ln = 0;\n $rn = 0;\n $fa = 0;\n $f = \"\";\n for($i=1;$i<$n;$i++){\n if ($i > 1) {\n $r = $l;\n }\n $l = $i*$i;\n if ($i == 1){\n $f = \"-\";\n $sum += $l;\n }else{\n $f = $i % 2 == 0 ? \"-\" : \"+\";\n if ($i % 2 == 0){\n $sum += $l+$r;\n }else{\n $sum += $l-$r;\n }\n }\n $s[] = \"($i*$i) $f\";\n \n \n \n }\n echo implode($s,\"*\").\"=\".$sum;\n return $sum;\n}",
"function candies($n, $m) {\n $result = 0; \n $result = intval($m/$n); \n $result = $n * $result; \n return $result;\n}",
"function testFunction($n) {\n\treturn ($n * $n * $n);\n}",
"function cuadrado(int $numero){\n return $numero * $numero;\n}",
"public function luas()\n {\n return $this->panjang * $this->lebar;\n }",
"public function mag2()\n\t{\n\t\t$m2 = ( $this->x()*$this->x() ) + ( $this->y()*$this->y() );\n\t\treturn $m2;\n\t}",
"function somar($a, $b){\n\n\treturn $a + $b;\n}",
"public function getModulus(): float\n {\n return sqrt($this->real ** 2 + $this->imaginary ** 2);\n }",
"function jc1($n)\n{\n\t$sum=1;\n\tfor($i=1;$i<=$n;$i++)\n\t{\n\t\t$sum=$sum*$i;\n\t}\n\techo $sum;\n}",
"function multiply($p1, $p2, $p3)\n{\n return $p1 * $p2 + $p3;\n}",
"function multiply(string $a, string $b): string {\n if($a == 0 || $b == 0) return \"0\";\n $a = ltrim($a, \"0\");\n $b = ltrim($b, \"0\");\n $top_matrix = str_split($a);\n $right_matrix = str_split($b);\n $WIDTH = strlen($a);\n $HEIGHT = strlen($b);\n $matrix = [];\n for($i = 0; $i < sizeof($top_matrix); $i++){\n $tmp =[];\n for($j = 0; $j < sizeof($right_matrix); $j++){\n $mul = intval($top_matrix[$i]) * intval($right_matrix[$j]);\n ($mul < 10) ? array_push($tmp,\"0\" . strval($mul)) : array_push($tmp, strval($mul));\n }\n array_push($matrix, $tmp);\n }\n\n $sums = [];\n $tmp = [];\n $entered = false;\n\n for($i = 0; $i <= $WIDTH + $HEIGHT - 2; $i++){\n $sum = 0;\n if($tmp != []) $sum = array_sum($tmp);\n $tmp = [];\n for($j = 0; $j <= $i; $j++){\n $entered = true;\n $x = $i - $j;\n if($x < $HEIGHT && $j < $WIDTH){\n $sum += (int)$matrix[$j][$x][0];\n array_push($tmp, (int)$matrix[$j][$x][1]);\n }\n \n }\n array_push($sums, $sum);\n }\n array_push($sums, array_sum($tmp));\n \n $result = [];\n $remainder = 0;\n $sums = array_reverse($sums);\n for($i = 0; $i < sizeof($sums); $i++){\n $current_value = $sums[$i] + $remainder;\n $remainder = 0;\n if($current_value > 9){\n $val = $current_value.\"\";\n $sums[$i] = (int)substr($val, -1);\n $remainder = (int)substr($val, 0, -1);\n }else{\n $sums[$i] = $current_value;\n }\n }\n $sums = array_reverse($sums);\n\n return ltrim(implode(\"\", $sums), \"0\");\n}",
"function bases($aa,$bb,$cc,$l,$m,$n,$psi4,$phi4,$tetha4)\n{\n $ax=array();\n $ay=array();\n $az=array();\n $a11=$aa;\n $a12=0;\n $a13=0;\n $a21=0;\n $a22=$bb;\n $a23=0;\n $a31=0;\n $a32=0;\n $a33=$cc;\n $rotated=rotativeMatrix($phi4,$tetha4,$psi4);\n $b11=$rotated[0];\n $b12=$rotated[1];\n $b13=$rotated[2];\n $b21=$rotated[3];\n $b22=$rotated[4];\n $b23=$rotated[5];\n $b31=$rotated[6];\n $b32=$rotated[7];\n $b33=$rotated[8];\n $c11=$b11*$a11;\n $c12=$b12*$a22;\n $c13=$b13*$a33;\n $c21=$b21*$a11;\n $c22=$b22*$a22;\n $c23=$b23*$a33;\n $c31=$b31*$a11;\n $c32=$b32*$a22;\n $c33=$b33*$a33;\n for($i=-$l;$i<$l;$i++)\n {\n for($j=-$m;$j<$m;$j++)\n {\n for($k=-$n;$k<$n;$k++)\n {\n $aaa=($j*$c11)+($i*$c12)+($k*$c13);\n $bbb=($j*$c21)+($i*$c22)+($k*$c23);\n $ccc=($j*$c31)+($i*$c32)+($k*$c33);\n $mon2=($i+0.5)*$bbb;\n $mon1=($j+0.5)*$aaa;\n $ax[]=$j*$aaa;\n $ay[]=$i*$bbb;\n $az[]=$k*$ccc;\n $ax[]=$mon1;\n $ay[]=$mon2;\n $az[]=$k*$ccc;\n }\n }\n }\n return [$ax,$ay,$az];\n}",
"function shwe_16_pell_to_15_pell($kyat){\n $ans = $kyat * 17;\n $ans = $ans / 16;\n return $ans;\n}",
"function doneComputing()\n{\n\tglobal $ieeeSigno, $ieeeMantisa;\n\techo \"\\n--------------------------\\n\"; // por cuestiones de estetica\n\techo \"El resultado: \";\n\techo $ieeeMantisa * $ieeeSigno; // aqui desplegamos nuestro resultado final, multiplicando el numero de la conversion por su signo correspondiente\n\techo \"\\n\\n\";\n\treturn 0;\n}",
"private function calcResult(): void {\n\t\tswitch($this->rndOperator) {\n\t\t\tcase self::PLUS:\n\t\t\t\t$this->result = $this->rndNumber1 + $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MINUS:\n\t\t\t\t// Avoid negative results\n\t\t\t\tif($this->rndNumber1 < $this->rndNumber2) {\n\t\t\t\t\t$tmp = $this->rndNumber1;\n\t\t\t\t\t$this->rndNumber1 = $this->rndNumber2;\n\t\t\t\t\t$this->rndNumber2 = $tmp;\n\t\t\t\t}\n\n\t\t\t\t$this->result = $this->rndNumber1 - $this->rndNumber2;\n\t\t\t\tbreak;\n\t\t\tcase self::MULTIPLE:\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->rndNumber1 * $this->rndNumber2;\n\t\t}\n\t}",
"function penjumlahan2($b,$c){\r\n\r\n $a = $b + $c;\r\n\r\n return $a;\r\n}",
"function PI($h) \n\t{\n\t//Femme = Taille(cm) - 100 - [Taille(cm) - 150] / 2 \n\t//Homme = Taille(cm) - 100 - [Taille(cm) - 150] / 4\n\t//âge de supérieur à 18 ans ;taille entre 140 et 220 cm (55 à 87 inch)\n\t//Poids idéal = 50 + [Taille(cm) - 150]/4 + [Age(an) - 20]/4\n\t$PI =$h-100-($h-150)/4 .\"kg\" ;\n\treturn $PI;\n\t}",
"function soma($x, $y) {\r\n\t\t\treturn $x + $y;\r\n\t\t}",
"function norm() {\n return sqrt($this->length2());\n }",
"function next_m($k, $m, $x){\n return $m + ($x - $m) / $k;\n}",
"function p3_ex4() {\n for ($i = 1; $i <= 10; $i = $i += ($i/2))\n $return .= $i.\" - \";\n\n return $return;\n}",
"public function calculAc() {\n\n return $this->va * (1 + ($this->nbta - $this->nbad) / $this->nbta);\n }",
"public function exponent();",
"static function math_form() {\n\t\t\t// Check if jpp_math_pass cookie is set and it matches valid transient\n\t\t\tif( isset( $_COOKIE[ 'jpp_math_pass' ] ) ) {\n\t\t\t\t$jetpack_protect = Jetpack_Protect_Module::instance();\n\t\t\t\t$transient = $jetpack_protect->get_transient( 'jpp_math_pass_' . $_COOKIE[ 'jpp_math_pass' ] );\n\n\t\t\t\tif( $transient && $transient > 0 ) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$num1 = rand( 0, 10 );\n\t\t\t$num2 = rand( 1, 10 );\n\t\t\t$ans = $num1 + $num2;\n\n\t\t\t$time_window = Jetpack_Protect_Math_Authenticate::time_window();\n\t\t\t$salt = get_site_option( 'jetpack_protect_key' ) . '|' . get_site_option( 'admin_email' ) . '|';\n\t\t\t$salted_ans = hash_hmac( 'sha1', $ans, $salt . $time_window );\n\t\t\t?>\n\t\t\t<div style=\"margin: 5px 0 20px;\">\n\t\t\t\t<label for=\"jetpack_protect_answer\">\n\t\t\t\t\t<?php esc_html_e( 'Prove your humanity', 'jetpack' ); ?>\n\t\t\t\t</label>\n\t\t\t\t<br/>\n\t\t\t\t<span style=\"vertical-align:super;\">\n\t\t\t\t\t<?php echo esc_html( \"$num1 + $num2 = \" ); ?>\n\t\t\t\t</span>\n\t\t\t\t<input type=\"text\" id=\"jetpack_protect_answer\" name=\"jetpack_protect_num\" value=\"\" size=\"2\" style=\"width:30px;height:25px;vertical-align:middle;font-size:13px;\" class=\"input\" />\n\t\t\t\t<input type=\"hidden\" name=\"jetpack_protect_answer\" value=\"<?php echo esc_attr( $salted_ans ); ?>\" />\n\t\t\t</div>\n\t\t<?php\n\t\t}",
"function promedio_general($vector){ \n $promedio=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n $promedio=$promedio+$n;\n }\n }\n return ($promedio/10);\n }",
"function montantTot () {\n\t $montant = 0;\n\t for ($i = 0; $i < count ($_SESSION['panier']['numE']);$i ++) {\n\t\t $montant += $_SESSION['panier']['nbr'][$i] * $_SESSION['panier']['prix'][$i]; \n\t }\n\t return $montant;\n }",
"function verteilung2($n) {\n return (powInt($n, 7/4));\n}",
"function iva($subtotal, $iva = 0.21){ // cuando le ponemos el valor a un parametro nos permite que cada vez que haga la operacion, lo haga con el valor que le pusimos al parametro obviamente, esto es mejor que asignarle un valor desde dentro y no estableciendo el valor fijo\n $porcentaje = $subtotal * $iva;\n\n // pusimos en comentarios esto porque no necesitamos que nos haga una operacion final, solo que nos muestre el dato final\n // $solucion = $subtotal + $porcentaje;\n return $porcentaje;\n }",
"function multiplicar(int $a, int $b){\n return $a * $b;\n}",
"public function rgveda_verse_modern($gra) {\n $data = [\n [1,191,1,1,191],\n [192,234,2,1,43],\n [235,295,3,1,62],\n [297,354,4,1,58],\n [355,441,5,1,87],\n [442,516,6,1,75],\n [517,620,7,1,104],\n [621,668,8,1,48],\n [1018,1028,8,59,59], //Vālakhilya hymns 1—11\n [669,712,8,60,103],\n [713,826,9,1,114],\n [827,1017,10,1,191]\n ];\n for($i=0;$i<count($data);$i++) {\n list($gra1,$gra2,$mandala,$hymn1,$hymn2) = $data[$i];\n if (($gra1 <= $gra) && ($gra<=$gra2)) {\n $hymn = $hymn1 + ($gra - $gra1);\n $x = \"$mandala.$hymn\";\n return $x;\n }\n }\n return \"?\"; // algorithm failed\n}",
"function calculate() {\n switch($this->operator) {\n case \"add\":\n return $this->num1 + $this->num2;\n case \"sub\":\n return $this->num1 - $this->num2;\n case \"mult\":\n return $this->num1 * $this->num2;\n case \"div\":\n return $this->num1 / $this->num2;\n default:\n return \"Invalid Operator\";\n }\n }",
"function resta($a,$b)\n {\n return $a-$b;\n }",
"final public function exp2()\n {\n $func = function(&$element)\n {\n $element = 2 ** $element;\n };\n\n return $this->copy()->walk_recursive($func);\n }",
"function power($base,$n){\r\n $x=pow($base,$n);\r\n return $x;\r\n}",
"function getInterestFactor($interest)\n{\n $rate = $interest / 365.25;\n return $rate;\n}",
"function bmi($bb, $tb){\n\t$bmi = $bb / (($tb * 0.01) * ($tb * 0.01));\n\treturn $bmi;\n}",
"function calculate($num1, $num2) { // Args are just like python, no specification -> must check\n return $num1 + $num2;\n}",
"function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}",
"function kira2($dulu,$kini)\n{\n return @number_format((($kini-$dulu)/$dulu)*100,0,'.',',');\n //@$kiraan=(($kini-$dulu)/$dulu)*100;\n}",
"function calculerSurfaceMurs ($largeur, $longueur, $hauteur)\n {\n // $surface = ($largeur * $hauteur + $longueur * $hauteur) * 2;\n $surface = 2 * $hauteur * ($largeur + $longueur);\n\n return $surface; \n }",
"function exp(float $num): float\n{\n return php_exp($num);\n}",
"function findDifference($a, $b) {\n $s1 = $a[0] * $a[1] * $a[2];\n $s2 = $b[0] * $b[1] * $b[2];\n \n return abs ($s1 - $s2);\n}",
"public function l2Norm() : float\n {\n return sqrt($this->square()->sum()->sum());\n }",
"function verteilung3($n) {\n return (powInt($n, 3)) / 3;\n}",
"function armstrong_number(int $num){\n $temp = $num; // store the number in a temporary variable\n $result = 0; // variable to store the result\n\n // loop till the the temporary variable is not equal to zero\n while($temp != 0){\n $remainder = $temp%10; // get the remainder of temp variable divided by 10\n $result = $result + $remainder*$remainder*$remainder; // add the result with cube of the remainder\n\n $temp = $temp/10; // change the temp variable by dividing it by 10\n }\n\n return $result; // return result\n }",
"function findSharp($intOrig, $intFinal)\n{\n $intFinal = $intFinal * (750.0 / $intOrig);\n $intA = 52;\n $intB = -0.27810650887573124;\n $intC = .00047337278106508946;\n $intRes = $intA + $intB * $intFinal + $intC * $intFinal * $intFinal;\n return max(round($intRes), 0);\n}",
"public function evaluateWealth() : float;",
"public function getE()\n {\n $es = $this->getES();\n\n return sqrt($es);\n }"
] | [
"0.6490454",
"0.6201972",
"0.6160381",
"0.6133771",
"0.60785586",
"0.6018784",
"0.6006412",
"0.59337264",
"0.59232515",
"0.59186137",
"0.5848588",
"0.58387154",
"0.5792689",
"0.5772175",
"0.5746004",
"0.5744475",
"0.5688037",
"0.5672046",
"0.5667053",
"0.5666641",
"0.5665748",
"0.5640119",
"0.5625299",
"0.561516",
"0.561429",
"0.56098884",
"0.5608553",
"0.5601882",
"0.55947405",
"0.5566069",
"0.55659693",
"0.55579054",
"0.55515546",
"0.5537883",
"0.5533727",
"0.5533096",
"0.5533096",
"0.5531955",
"0.5509639",
"0.5503382",
"0.55028856",
"0.54948926",
"0.54920137",
"0.5489736",
"0.5487594",
"0.54833174",
"0.5477",
"0.54762423",
"0.5470001",
"0.54687136",
"0.5464086",
"0.5443253",
"0.5438314",
"0.5404538",
"0.54045326",
"0.53964007",
"0.5393352",
"0.53895366",
"0.5382844",
"0.53796417",
"0.53756535",
"0.536738",
"0.5367307",
"0.53615487",
"0.5349933",
"0.5348668",
"0.534649",
"0.53368986",
"0.5336445",
"0.5331511",
"0.5328864",
"0.5323759",
"0.5314917",
"0.5313033",
"0.5310064",
"0.53078634",
"0.53068507",
"0.5304808",
"0.5304752",
"0.5297657",
"0.5295757",
"0.52938515",
"0.5293391",
"0.5290453",
"0.5287239",
"0.5280262",
"0.5272214",
"0.52675986",
"0.5260392",
"0.5251634",
"0.52512366",
"0.5250846",
"0.52503955",
"0.5248376",
"0.524546",
"0.5239845",
"0.52394485",
"0.523836",
"0.52377325",
"0.5236044",
"0.52296543"
] | 0.0 | -1 |
Complete the password grant | public function completeFlow()
{
$app = app();
// Get the required params
$clientId = $this->server->getRequest()->request->get('client_id', $this->server->getRequest()->getUser());
if (is_null($clientId)) {
throw new Exception\InvalidRequestException('client_id');
}
$clientSecret = $this->server->getRequest()->request->get('client_secret',
$this->server->getRequest()->getPassword());
if (is_null($clientSecret)) {
throw new Exception\InvalidRequestException('client_secret');
}
// Validate client ID and client secret
$client = $this->server->getClientStorage()->get(
$clientId,
$clientSecret,
null,
$this->getIdentifier()
);
if (($client instanceof ClientEntity) === false) {
$this->server->getEventEmitter()->emit(new Event\ClientAuthenticationFailedEvent($this->server->getRequest()));
throw new Exception\InvalidClientException();
}
$code = $this->server->getRequest()->request->get('code', null);
if (is_null($code)) {
throw new Exception\InvalidRequestException('code');
}
// Query the database.
$users = $app['mandango']->getRepository('Byryby\\Model\\User')
->createQuery()
->criteria([
'emails.verificationCode' => $code
])
->all();
if (count($users) < 1) {
throw new Exception\InvalidCredentialsException();
}
if (count($users) > 1) {
$msg = 'More than one user is associated with the same e-mail verification code: ' . $code;
$app['log']->alert($msg);
throw new Exception\ServerErrorException($msg);
}
// ...so there's exactly one user with that verification code
$user = array_pop($users);
$userId = (string)$user->getId();
/* @var \Byryby\Model\User $user */
if($user->getPendingInvitation()) {
throw new PendingInvitationException();
}
if($user->getDeleted()) {
throw new DeletedException();
}
if($user->getSuspended()) {
throw new SuspendedException();
}
// Set the e-mail to verified
foreach ($user->getEmails() as $email) {
if ($email->getVerificationCode() == $code) {
$email->setVerificationCode(null);
$email->setVerified(1);
$user->save();
break;
}
}
// Validate any scopes that are in the request
$scopeParam = $this->server->getRequest()->request->get('scope', '');
$scopes = $this->validateScopes($scopeParam, $client);
// Create a new session
$session = new SessionEntity($this->server);
$session->setOwner('user', $userId);
$session->associateClient($client);
// Generate an access token
$accessToken = new AccessTokenEntity($this->server);
$accessToken->setId(SecureKey::generate());
$accessToken->setExpireTime($this->getAccessTokenTTL() + time());
// Associate scopes with the session and access token
foreach ($scopes as $scope) {
$session->associateScope($scope);
}
foreach ($session->getScopes() as $scope) {
$accessToken->associateScope($scope);
}
$this->server->getTokenType()->setSession($session);
$this->server->getTokenType()->setParam('access_token', $accessToken->getId());
$this->server->getTokenType()->setParam('expires_in', $this->getAccessTokenTTL());
// Associate a refresh token if set
if ($this->server->hasGrantType('refresh_token')) {
$refreshToken = new RefreshTokenEntity($this->server);
$refreshToken->setId(SecureKey::generate());
$refreshToken->setExpireTime($this->server->getGrantType('refresh_token')->getRefreshTokenTTL() + time());
$this->server->getTokenType()->setParam('refresh_token', $refreshToken->getId());
}
// Save everything
$session->save();
$accessToken->setSession($session);
$accessToken->save();
if ($this->server->hasGrantType('refresh_token')) {
$refreshToken->setAccessToken($accessToken);
$refreshToken->save();
}
return $this->server->getTokenType()->generateResponse();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function grant() {\r\n\t\t\r\n\t\t$this->OAuth2->handleGrantRequest();\r\n\t\t\r\n\t}",
"public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}",
"protected function changePassword() {}",
"public function setPasswordAction()\n {\n $userId = $this->params()->fromRoute('userId', null);\n $token = $this->params()->fromRoute('token', null);\n\n if ($userId === null || $token === null) {\n return $this->notFoundAction();\n }\n\n $user = $this->getUserMapper()->findById($userId);\n\n if (!$user) {\n return $this->notFoundAction();\n }\n\n $record = $this->getUserRegistrationMapper()->findByUser($user);\n\n if (!$record || !$this->userRegistrationService->isTokenValid($user, $token, $record)) {\n // Invalid Token, Lets surprise the attacker\n return $this->notFoundAction();\n }\n\n if ($record->isResponded()) {\n // old link, password is already set by the user\n return $this->redirectToPostVerificationRoute();\n }\n\n $form = $this->getServiceLocator()->get('HtUserRegistration\\SetPasswordForm');\n\n if ($this->getRequest()->isPost()) {\n $form->setData($this->getRequest()->getPost());\n if ($form->isValid()) {\n $this->userRegistrationService->setPassword($form->getData(), $record);\n\n return $this->redirectToPostVerificationRoute();\n }\n }\n\n return array(\n 'user' => $user,\n 'form' => $form\n );\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 setPassword(){\n\t}",
"public function passwordResetAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $userKey = $this->_getParam('key', null);\n\n if (is_null($userKey)) {\n throw new Ot_Exception_Input('msg-error-noKeyFound');\n }\n\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n $string = pack(\"H*\", $userKey);\n\n $decryptKey = trim(mcrypt_decrypt($cipher, $key, $string, MCRYPT_MODE_CBC, $iv));\n\n if (!preg_match('/[^@]*@[^-]*-[0-9]*/', $decryptKey)) {\n throw new Ot_Exception_Input('msg-error-invalidKey');\n }\n\n $userId = preg_replace('/\\-.*/', '', $decryptKey);\n $ts = preg_replace('/^[^-]*-/', '', $decryptKey);\n\n $timestamp = new Zend_Date($ts);\n\n $now = new Zend_Date();\n\n $now->subMinute((int)$loginOptions['forgotpassword']['numberMinutesKeyIsActive']);\n\n if ($timestamp->getTimestamp() < $now->getTimestamp()) {\n throw new Ot_Exception_Input('msg-error-keyExpired');\n }\n\n $realm = preg_replace('/^[^@]*@/', '', $userId);\n $username = preg_replace('/@.*/', '', $userId);\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $account = new Ot_Model_DbTable_Account();\n $thisAccount = $account->getByUsername($username, $realm);\n\n if (is_null($thisAccount)) {\n throw new Ot_Exception_Data('msg-error-userAccountNotFound');\n }\n\n $form = new Ot_Form_PasswordReset();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n if ($form->getValue('password') == $form->getValue('passwordConf')) {\n\n $data = array(\n 'accountId' => $thisAccount->accountId,\n 'password' => md5($form->getValue('password')),\n );\n\n $account->update($data, null);\n\n $this->_helper->messenger->addSuccess('msg-info-passwordReset');\n\n $loggerOptions = array(\n 'attributeName' => 'accountId',\n 'attributeId' => $data['accountId'],\n );\n\n $this->_helper->log(Zend_Log::INFO, 'User reset their password', $loggerOptions);\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-passwordsNotMatch');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->view->headScript()->appendFile($this->view->baseUrl() . '/public/scripts/ot/jquery.plugin.passStrength.js');\n\n $this->_helper->pageTitle('ot-login-passwordReset:title');\n\n $this->view->assign(array(\n 'form' => $form,\n ));\n\n }",
"public function askPassword()\n {\n $this->ask('What is your password?', function (Answer $answer) {\n $this->user->password = bcrypt($answer->getText());\n\n $this->askBalance();\n });\n }",
"public function actionPassword()\n {\n if (is_null($this->password)) {\n self::log('Password required ! (Hint -p=)');\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->email) && is_null($this->id)) {\n self::log('User ID or Email required ! (Hint -e= or -i=)');\n return ExitCode::DATAERR;\n }\n\n $model = User::find()->where([\n 'OR',\n [\n 'email' => $this->email\n ],\n [\n 'id' => $this->id\n ]\n ])->one();\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n $validator = new TPasswordValidator();\n\n $model->password = $this->password;\n\n $validator->validateAttribute($model, \"password\");\n\n if ($model->errors) {\n\n self::log($model->errorsString);\n\n return ExitCode::DATAERR;\n }\n\n $model->setPassword($this->password);\n\n if (! $model->save()) {\n\n self::log('Password not changed ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Password successfully changed !');\n\n return ExitCode::OK;\n }",
"public function execute() {\n\t\ttry {\n\t\t\t// Get input data\n\t\t\t$userUid = $GLOBALS['BE_USER']->user['uid'];\n\t\t\t$groupUid = $GLOBALS['moduleData']['groupUid'];\n\t\t\t$newMemberUid = $GLOBALS['moduleData']['groupMemberUid'];\n\t\t\t$rights = $GLOBALS['moduleData']['groupMemberRights'];\n\t\t\t$passphrase = $GLOBALS['moduleData']['passphrase'];\n\n\t\t\t// Check if user has admin rights in group\n\t\t\ttx_passwordmgr_helper::checkMemberRights( $userUid, $groupUid, 2 );\n\n\t\t\t// Check if new member is not already member of group\n\t\t\ttx_passwordmgr_helper::checkUserNotMemberOfGroup( $newMemberUid, $groupUid );\n\n\t\t\t// Check if rights are within valid range\n\t\t\ttx_passwordmgr_helper::checkRightsWithinRange($rights);\n\n\t\t\t// Initialize current user object for decryption of passwords\n\t\t\t$user = t3lib_div::makeInstance('tx_passwordmgr_model_user');\n\t\t\t$user->init($userUid);\n\t\t\t$user['publicKey'] = tx_passwordmgr_openssl::extractPublicKeyFromCertificate($user['certificate']);\n\n\t\t\t// Initialize new member object\n\t\t\t$newMember = t3lib_div::makeInstance('tx_passwordmgr_model_groupmember');\n\t\t\t$newMember['groupUid'] = $groupUid;\n\t\t\t$newMember['beUserUid'] = $newMemberUid;\n\t\t\t$newMember['rights'] = $rights;\n\n\t\t\t// Add new member to group\n\t\t\t$newMember->add();\n\n\t\t\t// Re init new member to get his public key for encryption\n\t\t\t$newMember->init($newMemberUid, $groupUid);\n\n\t\t\t// Get list of passwords of this group\n\t\t\t$group = t3lib_div::makeInstance('tx_passwordmgr_model_group');\n\t\t\t$group['uid'] = $groupUid;\n\t\t\t$passwordList = $group->getPasswordList();\n\n\t\t\t// Add ssl data for each password of new user\n\t\t\tforeach ( $passwordList as $password ) {\n\t\t\t\t// Decrypt ssl data of password of current user\n\t\t\t\t$sslData = t3lib_div::makeInstance('tx_passwordmgr_model_sslData');\n\t\t\t\t$sslData->init($password['uid'], $user['uid']);\n\t\t\t\t$plaintextData = tx_passwordmgr_openssl::decrypt($user['privateKey'], $passphrase, $sslData['key'], $sslData['data']);\n\t\t\t\tunset($sslData);\n\n\t\t\t\t// Encrypt data for new member\n\t\t\t\t$newMemberKeyAndData = tx_passwordmgr_openssl::encrypt($newMember['publicKey'], $plaintextData);\n\t\t\t\tunset($plaintextData);\n\n\t\t\t\t// Add ssl data for new member\n\t\t\t\t$sslDataNewMember = t3lib_div::makeInstance('tx_passwordmgr_model_sslData');\n\t\t\t\t$sslDataNewMember['passwordUid'] = $password['uid'];\n\t\t\t\t$sslDataNewMember['beUserUid'] = $newMemberUid;\n\t\t\t\t$sslDataNewMember['timeStamp'] = time();\n\t\t\t\t$sslDataNewMember['createDate'] = time();\n\t\t\t\t$sslDataNewMember['key'] = $newMemberKeyAndData['key'];\n\t\t\t\t$sslDataNewMember['data'] = $newMemberKeyAndData['data'];\n\t\t\t\t$sslDataNewMember->add();\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\ttx_passwordmgr_helper::addLogEntry(2, 'addGroupMember', $e->getMessage());\n\t\t}\n\n\t\t$this->defaultView();\n\t}",
"public function complete($account, $row) {\n // User save tries to convert the password into hash.\n // Plain password save https://www.drupal.org/node/1349758.\n db_update('users')\n ->fields(array('pass' => '$N$'.$row->password))\n ->condition('uid', $account->uid)\n ->execute();\n }",
"public function modifpassword($user,$passwd){\n \n }",
"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}",
"function update_password()\n {\n }",
"public function passwordAction()\n {\n $token = $this->get('request')->get('token');\n if (!$token) {\n return $this->render('FOMUserBundle:Login:error-notoken.html.twig');\n }\n\n $user = $this->getDoctrine()->getRepository(\"FOMUserBundle:User\")->findOneByResetToken($token);\n if (!$user) {\n $mail = $this->container->getParameter('fom_user.mail_from_address');\n return $this->render('FOMUserBundle:Login:error-notoken.html.twig', array(\n 'site_email' => $mail));\n }\n\n $max_token_age = $this->container->getParameter(\"fom_user.max_reset_time\");\n if (!$this->checkTimeInterval($user->getResetTime(), $max_token_age)) {\n $form = $this->createForm('form');\n return $this->render('FOMUserBundle:Login:error-tokenexpired.html.twig', array(\n 'user' => $user,\n 'form' => $form->createView()\n ));\n }\n\n $form = $this->createForm(new UserResetPassType(), $user);\n $form->bind($this->get('request'));\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $user->setResetToken(null);\n\n $helper = new UserHelper($this->container);\n $helper->setPassword($user, $user->getPassword());\n\n $em->flush();\n\n return $this->redirect($this->generateUrl('fom_user_password_done'));\n }\n\n return array(\n 'user' => $user,\n 'form' => $form->createView());\n }",
"protected function sendAuthRequest() : void\n {\n $message = \"PASSWORD \" . $this->id . \" \" . $this->password;\n $this->sendRequest($message);\n }",
"public function reset_complete($key,$newpass) {\r\n\t\t// Set the users new password and clears their reset status.\r\n\t\t$udata = db::get_array(\"users\",array(\"passresetkey\"=>$key));\r\n\t}",
"public function savepasswordAction(){\n\t\t$request = $this->_request->getParams();\n\t\t\n\t\t$error = false;\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\tif(!$oValidationHelper->ifPasswordMatch($request['user_password'],$request['password2'])){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('Passwords entered do not match','error','user_password');\n\t\t}\t\n\t\t\n\t\tif($this->_validator->validate('passreset_form',$request) && !$error){\n\t\t\t$this->_auth->user_password = md5($request['user_password']);\n\t\t\t$this->_auth->save();\n\t\t\t$this->_messages->setMessage('Password has been updated');\t\t\t\n\t\t\t$this->_redirect('/usermanagement/profile/passwordform');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/passwordform/?error=1');\n\t\t}\n\t}",
"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 successPassword() {\n $this->loadFrontView('profile/after_password_reset');\n }",
"public function setPassword() {\n\t\ttry {\n\t\t\t$data = json_decode(file_get_contents('php://input'), true);\n\t\t\t\n\t\t\tif (!isset($data['password'])) {\n\t\t\t\t$this->respondError('Missing input', 400);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$user = $this->getUserFromAccessToken($_GET['access_token']);\n\t\t\tif ($user == null) {\n\t\t\t\tthrow new Exception(\"Invalid access token.\");\n\t\t\t}\n\t\t\t\n\t\t\t$user->setPassword($data['password']);\n\t\t\t$this->dm->persist($user);\n\t\t\t$this->dm->flush();\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->respondError($e->getMessage() . \" in \" . $e->getFile() . \" on line \" . $e->getLine() . \"\\n\" . $e->getTraceAsString());\n\t\t}\n\t}",
"public function setPassword($newPassword);",
"public function clobberPassword()\n\t{\n\t\tif( empty($this->myAuthID) && empty($this->myAccountID) )\n\t\t\tthrow PasswordResetException::toss( $this, 'NO_ACCOUNT_OR_AUTH_ID' ) ;\n\t\tif( empty($this->myNewToken) )\n\t\t\tthrow PasswordResetException::toss( $this, 'REENTRY_AUTH_FAILED' ) ;\n\t\t$theAuthFilter = $this->chooseIdentifierForSearch() ;\n\t\t$theSql = SqlBuilder::withModel( $this->model )\n\t\t\t->startWith( 'UPDATE ' )->add( $this->model->tnAuth )\n\t\t\t->setParamPrefix( ' SET ' )\n\t\t\t->mustAddParam( 'pwhash',\n\t\t\t\t\tStrings::hasher( $this->getRandomCharsFromToken() ) )\n\t\t\t->startWhereClause()\n\t\t\t->mustAddParam( $theAuthFilter['col'], $theAuthFilter['val'] )\n\t\t\t->endWhereClause()\n\t\t\t;\n//\t\t$this->debugLog( $theSql->mySql ) ;\n\t\ttry { $theSql->execDML() ; }\n\t\tcatch( PDOException $pdox )\n\t\t{\n\t\t\t$this->errorLog( __METHOD__ . ': ' . $pdox->getMessage() ) ;\n\t\t\tthrow PasswordResetException::toss( $this,\n\t\t\t\t\t'DANG_PASSWORD_YOU_SCARY' ) ;\n\t\t}\n\t}",
"public function newPassword(){\n\t\t// Load helpers and libraries\n helper(['form', 'url']);\n $M_User = new M_User();\n\n\t\t// Default return\n\t\t$ret = redirect()->to(base_url());\n\n $options = [\n\t\t\t'action' => ROUTE_NEW_PWD_ACCOUNT, // Route\n\t\t\t'script' => self::ENCRYPTION_URL // Script URL for SHA256 encryption\n ];\n\n $request = $this->request;\n\n\t\t$token = $request->getGetPost('token');\n\t\t// Checking if a corresponding token exists in the DB\n\t\tif ($token != null){\n\t\t\t$options['token'] = $token;\n\t\t\tif ($M_User->findOneBy('securityToken', $token) != null) {\n\t\t\t\t// Displaying password creation form\n\t\t\t\t$ret = render(FORM_NEW_PWD, $options);\n }\n }\n\t\telseif (session()->has('logged_in')){\n\t\t\t$options['token'] = null;\n\t\t\t$ret = render(FORM_NEW_PWD, $options);\n\t\t}\n\n\t\t$postData = $request->getPostGet('newPwd');\n\t\t// Second step of the process (processing form data)\n\t\tif (is_array($postData)){\n\t\t\t// Something went wrong : displaying an alert\n\t\t\tif ($M_User->resetPassword($postData['token'],$postData['password']) != SC_SUCCESS){\n\t\t\t\t$options['token'] = $postData['token'];\n\t\t\t\t$options['alert'] = 'Une erreur interne est survenue';\n $options['type'] = 'danger';\n\t\t\t\t$ret = render(FORM_NEW_PWD, $options);\n }\n\t\t\t// Everything went well : redirecting to base url\n\t\t\telse{\n\t\t\t\t$ret = redirect()->to(base_url());\n\t\t\t\t// TODO - Display an alert to notify the user that everything is OK\n }\n }\n\n return $ret;\n\t}",
"function password_recovery()\n\t{\n\n\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 setpasswordAction(){\n $req=$this->getRequest();\n $cu=$this->aaac->getCurrentUser();\n $password=$this->getRequest()->getParam('password');\n $record=Doctrine_Query::create()->from('Users')->addWhere('ID=?')->fetchOne(array($req->getParam('id'))); \n $record->password=md5($password);\n if(!$record->trySave()){\n $this->errors->addValidationErrors($record);\n }\n $this->emitSaveData(); \n }",
"public function restPassword(){\n\t}",
"public function ActualizarPassword()\n\t{\n\t\tif(empty($_POST[\"cedula\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\tself::SetNames();\n\t\t$sql = \" update usuarios set \"\n\t\t\t .\" usuario = ?, \"\n\t\t\t .\" password = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codigo = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $usuario);\n\t\t$stmt->bindParam(2, $password);\n\t\t$stmt->bindParam(3, $codigo);\t\n\t\t\t\n\t\t$usuario = strip_tags($_POST[\"usuario\"]);\n\t\t$password = sha1(md5($_POST[\"password\"]));\n\t\t$codigo = strip_tags($_SESSION[\"codigo\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> SU CLAVE DE ACCESO FUE ACTUALIZADA EXITOSAMENTE, SERÁ EXPULSADO DE SU SESIÓN Y DEBERÁ DE ACCEDER NUEVAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\t?>\n\t\t<script>\n\t\t\tfunction redireccionar(){location.href=\"logout.php\";}\n\t\t\tsetTimeout (\"redireccionar()\", 3000);\n\t\t</script>\n\t\t<?php\n\t\texit;\n\t}",
"function submitpassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\tif ($_POST['pass1']=== $_POST['pass2'])\n\t\t{\n\t\t\tUserModel::Create()->ChangePassword($_POST['hash'], $_POST['pass1']);\n\t\t\tif (User::IsLoggedIn())\n\t\t\t{\n\t\t\t\tUser::setpassword($_POST['pass1']);\n\t\t\t\t$this->renderWithTemplate('admin/index', 'AdminPageBaseTemplate');\n\t\t\t}\n\t\t\telse\n\t\t\t{$this->renderWithTemplate('admin/login', 'AdminPageBaseTemplate');}\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$this->viewData['message'] =\"Passwords Don't Match. Try Again\";\n\t\t\t$this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n\t\t}\n }",
"public function forgotPass()\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 password()\n {\n }",
"public function reset_password_complete()\n {\n $this->_render();\n }",
"public function setPasswordAction()\n {\n $token = $this->params()->fromQuery('token', null);\n $email = $this->params()->fromQuery('email', null);\n\n // Validate token length\n if ($token !== null && (!is_string($token) || strlen($token) !== 32)) {\n $this->addMessage('Invalid token', FlashMessenger::NAMESPACE_ERROR);\n return $this->redirect()->toRoute('auth', ['action' => 'resetPassword']);\n }\n\n /** @var User $user */\n $user = $this->getEntityManager()->getRepository(User::class)->findOneByEmail($email);\n if ($user === null) {\n $this->addMessage(sprintf('User with email \"%s\" not found', $this->escapeHtml($email)), FlashMessenger::NAMESPACE_ERROR);\n return $this->redirect()->toRoute('auth', ['action' => 'resetPassword']);\n }\n /** @var UserManager $userManager */\n $userManager = $this->getServiceManager()->get(UserManager::class);\n\n if ($token === null || !$userManager->validatePasswordResetToken($user, $token)) {\n $this->addMessage('The url has been expired. Please try again.', FlashMessenger::NAMESPACE_ERROR);\n return $this->redirect()->toRoute('auth', ['action' => 'resetPassword']);\n }\n\n // Create form\n /** @var UserPasswordChange $form */\n $form = $this->getServiceManager()->get(UserPasswordSet::class);\n $form->createForm();\n // Check if user has submitted the form\n if ($this->getRequest()->isPost()) {\n // Fill in the form with POST data\n $data = $this->params()->fromPost();\n $form->setData($data);\n // Validate form\n if ($form->isValid()) {\n $data = $this->postValidateFormData($data, $user);\n $user->setPassword($data['password']);\n $user->setPasswordResetToken(null);\n $user->setPasswordResetTokenCreationDate(null);\n $user->setChanged(new DateTime());\n $user->setChangeId($user->getId());\n\n $this->getEntityManager()->flush($user);\n $this->addMessage('The pasword has been set', FlashMessenger::NAMESPACE_SUCCESS);\n return $this->redirect()->toRoute('auth', ['action' => 'login']);\n }\n }\n return new ViewModel([\n 'form' => $form\n ]);\n }",
"public function setPassword($newPassword){\n\t}",
"public function forgotAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $realm = $this->_getParam('realm', null);\n\n if (is_null($realm)) {\n throw new Ot_Exception_Input('msg-error-realmNotFound');\n }\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $form = new Ot_Form_ForgotPassword();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n $account = new Ot_Model_DbTable_Account();\n\n $userAccount = $account->getByUsername($form->getValue('username'), $realm);\n\n if (!is_null($userAccount)) {\n $loginOptions = array();\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n // Generate key\n $text = $userAccount->username . '@' . $userAccount->realm . '-' . time();\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n\n $code = bin2hex(mcrypt_encrypt($cipher, $key, $text, MCRYPT_MODE_CBC, $iv));\n\n $this->_helper->messenger->addSuccess('msg-info-passwordResetRequest');\n\n $loggerOptions = array('attributeName' => 'accountId', 'attributeId' => $userAccount->accountId);\n\n $this->_helper->log(Zend_Log::INFO, 'User ' . $userAccount->username . ' sent a password reset request.', $loggerOptions);\n\n $dt = new Ot_Trigger_Dispatcher();\n $dt->setVariables(array(\n 'firstName' => $userAccount->firstName,\n 'lastName' => $userAccount->lastName,\n 'emailAddress' => $userAccount->emailAddress,\n 'username' => $userAccount->username,\n 'resetUrl' => Zend_Registry::get('siteUrl') . '/login/password-reset/?key=' . $code,\n 'loginMethod' => $userAccount->realm,\n ));\n\n $dt->dispatch('Login_Index_Forgot');\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-userAccountNotFound');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->_helper->pageTitle('ot-login-forgot:title');\n $this->view->assign(array(\n 'form' => $form,\n ));\n }",
"public function action()\n {\n $user = $this->user();\n $data = $this->validated();\n \n $user->forceFill([\n 'password' => Hash::make($data['password']),\n ])->save();\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 completeResetPassword() {\n $validator = new ResetPasswordValidator(\\Input::all());\n if (!$validator->passes()) {\n return $this->json(array('status' => 'error',\n 'errors' => $validator->getValidator()->messages()->all()));\n }\n $data = $validator->getData();\n try {\n // Find the user using the user id\n $user = Sentry::findUserById($data['id']);\n\n // Check if the reset password code is valid\n if ($user->checkResetPasswordCode($data['reset_code'])) {\n // Attempt to reset the user password\n if ($user->attemptResetPassword($data['reset_code'], $data['new_password'])) {\n return $this->json(array(\"status\" => \"success\", \"message\" => \"Password reset successful\"));\n } else {\n return $this->json(array('status' => 'error',\n 'errors' => array('Password reset failed')));\n }\n } else {\n return $this->json(array('status' => 'error',\n 'errors' => array('The provided password reset code is Invalid')));\n }\n } catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n return $this->json(array('status' => 'error',\n 'errors' => array('User not found')));\n }\n }",
"public function changepassAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n\n $token = $this->params()->fromRoute('token');\n $em = EntityManagerSingleton::getInstance();\n $user = null;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost()->toArray();\n $user = $em->getRepository('Library\\Model\\User\\User')->findOneByToken($token);\n\n if (!($user instanceof User))\n {\n throw new \\Exception(\"The user cannot be found by the incoming token\");\n }\n\n $user_service->changePassword($data, $user);\n $em->flush();\n }\n\n return ['user' => $user];\n }",
"private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"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 setPassword($password);",
"public function setPassword($password);",
"public function setPassword($password);",
"function callback_password(array $args)\n {\n }",
"public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }",
"public function resetPassword();",
"public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }",
"public function dialogRetypePassword(Application $app) {\n $form = $app['request']->get('form');\n\n if ($form['password']['first'] != $form['password']['second']) {\n // the passwords does not match\n $message = $app['translator']->trans('<p>The both passwords you have typed in does not match, please try again!</p>');\n }\n elseif ($app['utils']->passwordStrength($form['password']['first']) < 3) {\n // the password is not strength enough\n $message = $app['translator']->trans('<p>The password you have typed in is not strength enough.</p><p>Please choose a password at minimun 8 characters long, containing lower and uppercase characters, numbers and special chars. Spaces are not allowed.</p>');\n }\n else {\n // change the password and prompt info\n $passwordEncoder = new manufakturPasswordEncoder($app);\n // we don't use \"salt\"\n $password = $passwordEncoder->encodePassword($form['password']['first'], '');\n\n // update the user data\n $Users = new Users($app);\n $Users->updateUser($form['username'], array('password' => $password));\n // return a info message and leave the dialog\n return $app['twig']->render($app['utils']->getTemplateFile(\n '@phpManufaktur/Basic/Template',\n 'framework/body.message.twig'),\n array('title' => 'Password changed',\n 'message' => $app['translator']->trans(\n '<p>The password for the kitFramework was successfull changed.</p><p>You can now <a href=\"%login%\">login using the new password</a>.</p>',\n array('%login%' => FRAMEWORK_URL.'/login'))\n ));\n }\n\n // changing the password was not successfull, show again the dialog\n $form = $app['form.factory']->createBuilder('form')\n ->add('password', 'repeated', array(\n 'type' => 'password',\n 'required' => true,\n 'first_options' => array('label' => 'Password'),\n 'second_options' => array('label' => 'Repeat Password'),\n ))\n ->add('username', 'hidden', array(\n 'data' => $form['username']\n ))\n ->getForm();\n\n return $app['twig']->render(\n $app['utils']->getTemplateFile(\n '@phpManufaktur/Basic/Template',\n 'framework/password.set.twig'),\n array(\n 'form' => $form->createView(),\n 'message' => $message\n )\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 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 changePasswordAction()\n {\n $message = array();\n $message['success'] = \"\";\n $message['verify'] = $this->customerVerify($_SESSION['userName'], $_POST['currentPass']);\n if (!$message['verify']) {\n $message['confirm'] = $this->checkConfirm($_POST['newPass'], $_POST['confirmPass']);\n if (!$message['confirm']) {\n $this->model->chagePass($_SESSION['userName'], password_hash($_POST['newPass'], PASSWORD_DEFAULT));\n $message['success'] = \"Your password has been changed\";\n }\n }\n echo json_encode($message);\n }",
"public function change_pass()\n\t{\n\t\t$form = array();\n\n\t\t$form['validation']['params'] = array('password_old', 'password', 'password_confirm');\n\n\t\t$form['submit'] = function ($params) {\n\t\t\treturn $this->_change_pass_submit();\n\n\n\t\t};\n\n\t\t$form['form'] = function () {\n\t\t\tpage_info('title', lang('title_change_pass'));\n\n\t\t\t$this->_display();\n\t\t};\n\n\t\t$this->_form($form);\n\t}",
"public function route_chpasswd(array $args) {\n\t\treturn self::$core::pj(\n\t\t\tself::$ctrl->change_password($args['post'], true));\n\t}",
"public function setPassword($value);",
"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 reset_complete()\n\t{\n\t\t//if user is logged in they don't need to be here. and should use profile options\n\t\tif ($this->ion_auth->logged_in())\n\t\t{\n\t\t\t$this->session->set_flashdata('error', $this->lang->line('user_already_logged_in'));\n\t\t\tredirect('my-profile');\n\t\t}\n\n\t\t//set page title\n\t\t$this->template->title($this->lang->line('user_password_reset_title'));\n\n\t\t//build and render the output\n\t\t$this->template->build('reset_pass_complete', $this->data);\n\t}",
"public function action_password($unused = null) {\n\t\tif (!Auth::instance()->has_permission('update_profile', $this->_model_name)) {\n\t\t\tthrow new Oxygen_Access_Exception;\n\t\t}\n\n\t\tOHooks::instance()\n\t\t\t->add(get_class($this).'.password.model_post_save', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'password_model_post_save'\n\t\t\t));\n\n\t\tparent::action_password(true);\n\n\t\t$title = __('Change Password');\n\t\t$this->template->title = $title;\n\t\t$this->favorites->title($title);\n\t\t$this->breadcrumbs->delete('Edit '.$this->_model->meta('one_text'));\n\t}",
"public function setPassword($p) {\n $this->_password = $p;\n }",
"public function reset_complete()\n\t{\n\t\t//if user is logged in they don't need to be here. and should use profile options\n\t\tif ($this->ion_auth->logged_in())\n\t\t{\n\t\t\t$this->session->set_flashdata('error', $this->lang->line('user_already_logged_in'));\n\t\t\tredirect('users/profile');\n\t\t}\n\n\t\t//set page title\n\t\t$this->template->title($this->lang->line('user_password_reset_title'));\n\n\t\t//build and render the output\n\t\t$this->template->build('reset_pass_complete', $this->data);\n\t}",
"static function password_forgot() {\n parent::password_forgot();\n view_var('user', globals('user'));\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}",
"function recoverPassword(){\n\t\tglobal $recoverPasswordInputs, $pdo;\n\t\ttry{\n\t\t\t$recoverPassword = $pdo->prepare('SELECT hash FROM USER WHERE email = :email AND firstName = :firstName AND lastName = :lastName');\n\t\t\t$recoverPassword->bindValue(':email', $recoverPasswordInputs['email']);\n\t\t\t$recoverPassword->bindValue(':firstName', $recoverPasswordInputs['fname']);\n\t\t\t$recoverPassword->bindValue(':lastName', $recoverPasswordInputs['lname']);\n\t\t\t$recoverPassword->execute();\n\t\t\t$result = $recoverPassword -> fetch();\n\n\t\t\tif ($result != null) {\n\t\t\t\tsendEmail(updatePassword());\n\t\t \theader('Location: ../signin.php#recoverPassword=success');\n\t\t\t exit();\n\t\t\t}else {\n\t\t\t header('Location: ../recoverPassword.php#recoverPassword=warning');\n\t\t\t exit();\n\t\t\t}\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t\t{echo $e->getMessage();}\n\t}",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n {\n }",
"public function getPassword() {}",
"function the_post_password()\n {\n }",
"public function do_reset_password()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::action('UserController@reset_password', array('token'=>$input['token']))\n ->withInput()\n ->with( 'error', $error_msg );\n }\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}",
"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 activatenewpasswordAction()\n {\n $newKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME, null);\n $userId = $this->getRequest()->getParam(User::COLUMN_USERID, null);\n\n $user = $this->_getUserFromIdAndKey($userId, $newKey);\n if(!$user){\n Globals::getLogger()->info(\"New password activation: user retrieval failed - userId=$userId, key=$newKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_SUCH_USER));\n }\n\n $user->{User::COLUMN_PASSWORD} = $user->newPassword;\n $user->newPassword = '';\n $user->activationKey = '';\n\n $id = $user->save();\n if($id != $user->{User::COLUMN_USERID}){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NEWPASSWORD_ACTIVATION_FAILED));\n }\n\n Utils::deleteCookie(User::COOKIE_MD5);\n Utils::deleteCookie(User::COOKIE_USERNAME);\n Utils::deleteCookie(User::COOKIE_REMEMBER);\n\n $this->_savePendingUserIdentity($userId);\n\n $this->_helper->redirectToRoute('userupdate',array('newPassword'=>true));\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 function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}",
"public function necesitaCambiarPassword();",
"public function ga_password_callback()\n {\n printf(\n '<input type=\"password\" id=\"ga_password\" name=\"bpp_setting_options[ga_password]\" value=\"%s\" />',\n isset( $this->options['ga_password'] ) ? esc_attr( $this->options['ga_password']) : ''\n );\n }",
"public function testUpdatePasswordNotGiven(): void { }",
"public function passwordformAction(){\n\t\t/*if($this->_request->getParam('error')){\n\t\t\t$this->view->assign('messages',$this->_messages->getMessages());\n\t\t}*/\n\t\t\t\t\n\t\t$form = new Bel_Forms_Builder('passreset_form','/usermanagement/profile/savepassword');\n\t\t$this->view->assign('form',$form);\n\t\t$this->view->display('forms/ajax.tpl');\t\t\n\t}",
"public function passwordAction(){\r\n $this->view->password = '';\r\n }",
"public function ResetPassword() {\n\t\t\t$strPassword = strtolower(substr(md5(microtime()), 4, 8));\n\t\t\t$this->SetPassword($strPassword);\n\t\t\t$this->PasswordResetFlag = true;\n\t\t\t$this->Save();\n\n\t\t\t// Setup Token Array\n\t\t\t$strTokenArray = array(\n\t\t\t\t'NAME' => $this->strFirstName . ' ' . $this->strLastName,\n\t\t\t\t'USERNAME' => $this->strUsername,\n\t\t\t\t'PASSWORD' => $strPassword\n\t\t\t);\n\n\t\t\t// Send Message\n\t\t\tQApplication::SendEmailUsingTemplate('forgot_password', 'Qcodo.com Credentials', QCODO_EMAILER,\n\t\t\t\t$this->SmtpEmailAddress, $strTokenArray, true);\n\t\t}",
"public function usePassword($password)\n {\n // CODE...\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 }",
"protected function actionNewPassword() {\n\t\t$this->content = $this->parser->parseTemplate(CMT_TEMPLATE.'app_welcome/cmt_new_password.tpl');\n\t}",
"public function setPassword(string $password): void\n {\n }",
"function onEndShowPasswordsettings($action) { }",
"public function setNewPassword()\n {\n PasswordResetModel::setNewPassword(\n Request::post('user_name'), Request::post('user_password_reset_hash'),\n Request::post('user_password_new'), Request::post('user_password_repeat')\n );\n Redirect::to('index');\n }",
"public function testUpdatePassword_passwordSpecChars()\n {\n $oRealInputValidator = \\OxidEsales\\Eshop\\Core\\Registry::getInputValidator();\n\n $sPass = '""\"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 forgotpasswordAction() {\n $form = new Admin_Form_ResendPassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n //check user is registered\n $values = $form->getValues();\n $siteUsersMapper = new Application_Model_Table_AdminUsers();\n $exists = $siteUsersMapper->fetchByUsername($values['email_address']);\n if($exists){\n //user exists\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoveryEmail = $recoveryEmailsMapper->createRow();\n $recoveryEmail->admin_user_id = $exists->admin_user_id;\n $recoveryEmail->email_address = $exists->username;\n $recoveryEmail->hashActivationKey();\n $recoveryEmail->save();\n }\n $this->_helper->FlashMessenger->addMessage('You password has been reset, please check your email' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n }",
"public function processpasswordrequest ()\n {\n if ($_POST)\n {\n try\n {\n // first verify requestID is valid\n $user = $this->welcome->getPasswordResetUser($_POST['requestID']);\n\n if (empty($user)) $this->functions->jsonReturn('ALERT', \"Unable to find a valid password reset request based upon that password request ID\");\n\n // first reset password\n $this->welcome->updateUserPassword($user, $_POST['password']);\n\n // deactivates all password reset requests for that user - they need to fill out the form again to reset their password again\n $this->welcome->deactivatePasswordRequests($user);\n \n $this->functions->jsonReturn('SUCCESS', \"Password has been reset\");\n }\n catch(Exception $e)\n {\n $this->functions->sendStackTrace($e);\n $this->functions->jsonReturn('ERROR', $e->getMessage());\n }\n }\n }",
"public function confirmRegistration(Users $entity, $password)\n {\n }",
"public function getPasswordAdapter();",
"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 }",
"private function writePassword(): void\n {\n // Exit unless sheet protection and password have been specified\n if ($this->phpSheet->getProtection()->getSheet() !== true || !$this->phpSheet->getProtection()->getPassword() || $this->phpSheet->getProtection()->getAlgorithm() !== '') {\n return;\n }\n\n $record = 0x0013; // Record identifier\n $length = 0x0002; // Bytes to follow\n\n $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password\n\n $header = pack('vv', $record, $length);\n $data = pack('v', $wPassword);\n\n $this->append($header . $data);\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 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 static function do_reset_password() {\n\t\tif ( ! self::is_global_reset_password_page_set() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] && isset( $_REQUEST[ 'rp_key' ] ) && isset( $_REQUEST[ 'rp_login' ] ) ) {\n\t\t\t$rp_key = sanitize_text_field( $_REQUEST['rp_key'] );\n\t\t\t$rp_login = sanitize_text_field( $_REQUEST['rp_login'] );\n\n\t\t\t$user = check_password_reset_key( $rp_key, $rp_login );\n\n\t\t\tif ( ! $user || is_wp_error( $user ) ) {\n\t\t\t\t$query_args = self::get_reset_password_query_args_from_user( $user );\n\t\t\t\tFrmRegLoginController::redirect_to_selected_login_page( $query_args );\n\n\t\t\t} elseif ( isset( $_POST[ 'pass1' ] ) ) {\n\n\t\t\t\tself::redirect_if_passwords_not_equal( $rp_key, $rp_login );\n\t\t\t\tself::redirect_if_empty_password( $rp_key, $rp_login );\n\t\t\t\tself::reset_password_and_redirect( $user );\n\n\t\t\t} else {\n\t\t\t\tesc_html_e( 'Invalid request.', 'frmreg' );\n\t\t\t}\n\t\t}\n\t}",
"protected function startPasswordReset()\n\t{\n\t\t$token = new Token();\n\t\t$hashed_token = $token->getHash();\n\t\t$this->password_reset_token = $token->getValue();\n\t\t\n\t\t$expiry_timestamp = time() + 60 * 60 * 2; // two hours from now\n\t\t\n\t\t$sql = 'UPDATE users SET password_reset_hash = :token_hash, password_reset_expires_at = :expires_at WHERE id = :id';\n\t\t\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bindValue(':token_hash', $hashed_token, PDO::PARAM_STR);\n\t\t$stmt->bindValue(':expires_at', date('Y-m-d H:i:s', $expiry_timestamp) ,PDO::PARAM_STR );\n\t\t$stmt->bindValue(':id', $this->id, PDO::PARAM_INT);\n\t\t\n\t\treturn $stmt->execute();\n\t}",
"function psswrdhsh_activate()\n{\n\tglobal $lang, $mybb;\n\n\tif (psswrdhsh_core_edits('activate') === false) {\n\t\tpsswrdhsh_uninstall();\n\n\t\tflash_message($lang->error_pwh_activate, 'error');\n\t\tadmin_redirect('index.php?module=config-plugins');\n\t}\n\t\n\t// assume core edits succeeded\n\t\n\tif ($mybb->settings['regtype'] == \"randompass\") {\n\t\t\n\t\t// Sending the user a random password, which thus becomes _their_ password\n\t\t// for at least some amount of time, in plain text across media that may or\n\t\t// may not be secure and/or confidential is just an absolutely braindamaged\n\t\t// idea that should never, ever be used on a modern site. </endrant>\n\n\t\t$decent_regtype_optionscode = \"select\ninstant=Instant Activation\nverify=Send Email Verification\nadmin=Administrator Activation\nboth=Email Verification & Administrator Activation\";\n\t\t\n\t\t\n\t\t$db->update_query(\"settings\", [\"value\" => \"verify\"], \"name = 'regtype'\");\n\t\t$db->update_query(\"settings\", [\"optionscode\" => $decent_regtype_optionscode], \"name = 'regtype'\");\n\t\trebuild_settings();\n\t}\n\t\n\tif (!$mybb->settings[\"requirecomplexpasswords\"]) {\n\t\t$db->update_query(\"settings\", [\"value\" => 1], \"name = 'requirecomplexpasswords'\");\n\t\trebuild_settings();\n\t}\n\t\n\t// Since we're requiring complex passwords, the min length should already be\n\t// considered 8 in the core, so that part is alright. But let's remove the unnecessary\n\t// ceiling to the password length, since bcrypt will work with the first 72\n\t// characters of input and 72 bytes really isn't all that much data to send.\n\t\n\tif ($mybb->settings[\"maxpasswordlength\"] < 72) {\n\t\t$db->update_query(\"settings\", [\"value\" => 72], \"name = 'maxpasswordlength'\");\n\t\trebuild_settings();\n\t}\n\t\n\t// redirect back informing the admin of any settings we changed\n\tflash_message($lang->pwh_activate_regtype_changed, 'error');\n\tadmin_redirect('index.php?module=config-plugins');\n}",
"public function getAuthPassword()\n {\n return '*';\n }"
] | [
"0.6438145",
"0.64218736",
"0.62794644",
"0.60153645",
"0.59932023",
"0.5979064",
"0.5963596",
"0.59288883",
"0.58523136",
"0.58102155",
"0.58082896",
"0.58004934",
"0.57927346",
"0.57895255",
"0.5770633",
"0.5758352",
"0.5735433",
"0.5727354",
"0.572296",
"0.5637568",
"0.5635937",
"0.5634795",
"0.56343925",
"0.5631295",
"0.56198716",
"0.5615278",
"0.5583036",
"0.5583036",
"0.55787915",
"0.5557695",
"0.5554651",
"0.55540776",
"0.5550724",
"0.5550241",
"0.5549886",
"0.5549839",
"0.55439067",
"0.554096",
"0.55310273",
"0.553095",
"0.5518666",
"0.55098575",
"0.54888755",
"0.5481248",
"0.5481248",
"0.5481248",
"0.5477274",
"0.5467801",
"0.54651755",
"0.5455988",
"0.5451143",
"0.5449357",
"0.5448812",
"0.5448322",
"0.54263264",
"0.5424901",
"0.54115593",
"0.54104125",
"0.5409441",
"0.540057",
"0.5399076",
"0.53958035",
"0.53921634",
"0.53867173",
"0.5385528",
"0.53808844",
"0.53808844",
"0.53808844",
"0.5380552",
"0.5378698",
"0.53784156",
"0.53730524",
"0.53667814",
"0.53659725",
"0.53640836",
"0.53516036",
"0.53501934",
"0.5336458",
"0.533388",
"0.5333532",
"0.53282243",
"0.5317107",
"0.53011596",
"0.53009385",
"0.529907",
"0.52899015",
"0.5282028",
"0.52814615",
"0.5281408",
"0.52805954",
"0.5279048",
"0.52656054",
"0.5261439",
"0.52594155",
"0.5257199",
"0.52558076",
"0.52532727",
"0.5253125",
"0.525144",
"0.525055",
"0.5249317"
] | 0.0 | -1 |
Construct new TypeSpec from binary data. | public function __construct(DataStream $data)
{
$this->type = $data->readShort();
switch ($this->type) {
case self::CUSTOM:
$this->customTypename = $data->readString();
break;
case self::COLLECTION_LIST:
case self::COLLECTION_SET:
$this->valueType = new TypeSpec($data);
break;
case self::COLLECTION_MAP:
$this->keyType = new TypeSpec($data);
$this->valueType = new TypeSpec($data);
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_from_binary_data($data);",
"public static function createFromBuffer($raw_binary_data, $name = null)\n {\n // TODO: Convert to \"is_buffer\" or \"is_binary\" once available (PHP 6)\n if (!is_string($raw_binary_data)) {\n throw new InvalidArgumentException('Expected a raw binary string');\n }\n\n // Create a temporary file name if none was given\n $name = $name ?: static::DEFAULT_NAME;\n\n // Set a default MIME-type. \"octet-stream\" is generic and RFC safe\n $mime_type = 'application/octet-stream';\n\n // Try and auto-detect the MIME-type\n try {\n $mime_type = static::detectMimeTypeFromBuffer($raw_binary_data);\n } catch (RuntimeException $e) {\n // Must have the fileinfo extension loaded to automatically detect the MIME type\n }\n\n // Only convert binary to hex if its not plain text\n if (strpos($mime_type, 'text') !== 0 || static::isBase64String($raw_binary_data)) {\n $raw_binary_data = bin2hex($raw_binary_data);\n }\n\n // Wrap our binary data in a SplFileObject compatible data stream\n $stream_wrapped = 'data://'. $mime_type .','. rawurlencode($raw_binary_data);\n\n $object = new static($stream_wrapped, 'r');\n $object->setName($name);\n $object->setMimeType($mime_type);\n\n return $object;\n }",
"public function convertToObject(\\SetaPDF_Core_Type_Raw $data) {}",
"public function decode($binary, array $tagMap = []): AbstractType;",
"abstract protected function initDataTypes();",
"public function initFromBinary($data): InterventionImage\n {\n return $this->initFromVips(VipsImage::newFromBuffer($data));\n }",
"public static function fromDER(string $data): self\n {\n return self::fromASN1(UnspecifiedType::fromDER($data)->asSequence());\n }",
"public static function fromDER(string $data): self\n {\n return self::fromASN1(UnspecifiedType::fromDER($data)->asSequence());\n }",
"public function __construct($spec);",
"public static function data($data, $type = null)\n {\n $type === null && $type = MongoBinData::BYTE_ARRAY;\n\n return new MongoBinData($data, $type);\n }",
"public static function createSelf()\n {\n $dataTypeFactory = new self();\n\n $dataTypeFactory->addFactoryTypeHandler('bit', new BitTypeFactory());\n // Integer type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyint', new TinyIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('smallint', new SmallIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumint', new MediumIntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('int', new IntTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('bigint', new BigIntTypeFactory());\n // Numeric-point type mappers.\n $dataTypeFactory->addFactoryTypeHandler('double', new DoubleTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('float', new FloatTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('decimal', new DecimalTypeFactory());\n // Date and time mappers.\n $dataTypeFactory->addFactoryTypeHandler('date', new DateTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('time', new TimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('timestamp', new TimestampTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('datetime', new DateTimeTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('year', new YearTypeFactory());\n // Char type mappers.\n $dataTypeFactory->addFactoryTypeHandler('char', new CharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varchar', new VarCharTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('binary', new BinaryTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('varbinary', new VarBinaryTypeFactory());\n // Blob type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinyblob', new TinyBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('blob', new BlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumblob', new MediumBlobTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longblob', new LongBlobTypeFactory());\n // Text type mappers.\n $dataTypeFactory->addFactoryTypeHandler('tinytext', new TinyTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('text', new TextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('mediumtext', new MediumTextTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('longtext', new LongTextTypeFactory());\n // Option type mappers.\n $dataTypeFactory->addFactoryTypeHandler('enum', new EnumTypeFactory());\n $dataTypeFactory->addFactoryTypeHandler('set', new SetTypeFactory());\n // Other type mappers.\n $dataTypeFactory->addFactoryTypeHandler('json', new JsonTypeFactory());\n\n return $dataTypeFactory;\n }",
"public static function fromString($data)\n {\n return new static(Reader::fromString($data));\n }",
"public static function fromData(array $data);",
"protected function _parseStructure($data)\n {\n $ob = new Horde_Mime_Part();\n\n $ob->setType(strtolower($data->type) . '/' . strtolower($data->subType));\n\n // Optional for multipart-parts, required for all others\n if (isset($data->parameters)) {\n $params = array();\n foreach ($data->parameters as $key => $value) {\n $params[strtolower($key)] = $value;\n }\n\n $params = Horde_Mime::decodeParam('content-type', $params, 'UTF-8');\n foreach ($params['params'] as $key => $value) {\n $ob->setContentTypeParameter($key, $value);\n }\n }\n\n // Optional entries. 'location' and 'language' not supported\n if (isset($data->disposition)) {\n $ob->setDisposition($data->disposition);\n if (isset($data->dparameters)) {\n $dparams = array();\n foreach ($data->dparameters as $key => $value) {\n $dparams[strtolower($key)] = $value;\n }\n\n $dparams = Horde_Mime::decodeParam('content-disposition', $dparams, 'UTF-8');\n foreach ($dparams['params'] as $key => $value) {\n $ob->setDispositionParameter($key, $value);\n }\n }\n }\n\n if ($ob->getPrimaryType() == 'multipart') {\n // multipart/* specific entries\n foreach ($data->subParts as $val) {\n $ob->addPart($this->_parseStructure($val));\n }\n } else {\n // Required options\n if (isset($data->partID)) {\n $ob->setContentId($data->partID);\n }\n\n $ob->setTransferEncoding(strtolower($data->encoding));\n $ob->setBytes($data->bytes);\n\n if ($ob->getType() == 'message/rfc822') {\n $ob->addPart($this->_parseStructure(reset($data->subParts)));\n }\n }\n\n return $ob;\n }",
"protected function createType($data)\n {\n $type = new AddressType();\n foreach ($data as $attribute => $value) {\n $type->{$attribute} = $value;\n }\n $type->save();\n\n return $type;\n }",
"public function FromBytes($stream)\r\n\t{\r\n\t\t//file_put_contents(\"/tmp/stream-dump.txt\", $stream);\r\n\t\t$used = 0;\r\n\t\twhile ($used < strlen($stream))\r\n\t\t{\r\n\t\t\t$f = new ProtoBuf_Field();\r\n\t\t\t$used += $parsed = $f->FromBytes($stream, $used);\r\n\t\t\tif ($parsed > 0)\r\n\t\t\t\t$this->fields[] = $f;\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public static function create($data)\n {\n $name = $data['name'];\n $language = $data['language'];\n $columnOption = $data['columnOption'];\n $specificColumns = $data['specificColumns'];\n return new TableType(self::generateId($name), $name, $language, $columnOption, $specificColumns);\n }",
"public function fromArray(array $data)\n {\n parent::fromArray($data);\n $this->parseDynamicProperties($data);\n }",
"final public function createdDataTypeInstanceHasCorrectProperties(): void\n {\n $dataType = new DataTypeMock();\n $this->assertEquals(PHP_INT_SIZE << 3, $dataType->getSystemMaxBits());\n $this->assertNull($dataType->getValue());\n $this->assertEquals('object', $dataType->getPrimitiveType());\n }",
"public function fromArray(array $data) : DataContainerInterface;",
"public static function createFromArray($name, array $data = [])\n {\n $type = parent::createFromArray($name, $data);\n \\assert($type instanceof self);\n\n return $type;\n }",
"public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Spec\",$param) and $param[\"Spec\"] !== null) {\n $this->Spec = $param[\"Spec\"];\n }\n\n if (array_key_exists(\"SpecName\",$param) and $param[\"SpecName\"] !== null) {\n $this->SpecName = $param[\"SpecName\"];\n }\n\n if (array_key_exists(\"StorageType\",$param) and $param[\"StorageType\"] !== null) {\n $this->StorageType = $param[\"StorageType\"];\n }\n\n if (array_key_exists(\"DiskType\",$param) and $param[\"DiskType\"] !== null) {\n $this->DiskType = $param[\"DiskType\"];\n }\n\n if (array_key_exists(\"RootSize\",$param) and $param[\"RootSize\"] !== null) {\n $this->RootSize = $param[\"RootSize\"];\n }\n\n if (array_key_exists(\"MemSize\",$param) and $param[\"MemSize\"] !== null) {\n $this->MemSize = $param[\"MemSize\"];\n }\n\n if (array_key_exists(\"Cpu\",$param) and $param[\"Cpu\"] !== null) {\n $this->Cpu = $param[\"Cpu\"];\n }\n\n if (array_key_exists(\"DiskSize\",$param) and $param[\"DiskSize\"] !== null) {\n $this->DiskSize = $param[\"DiskSize\"];\n }\n\n if (array_key_exists(\"InstanceType\",$param) and $param[\"InstanceType\"] !== null) {\n $this->InstanceType = $param[\"InstanceType\"];\n }\n }",
"public function decode(string $data): Package\n {\n $cmd = '';\n $ext = [];\n $map = (array)unserialize($data, ['allowed_classes' => false]);\n\n // Find message route\n if (isset($map['cmd'])) {\n $cmd = (string)$map['cmd'];\n unset($map['cmd']);\n }\n\n if (isset($map['data'])) {\n $body = $map['data'];\n $ext = $map['ext'] ?? [];\n } else {\n $body = $map;\n }\n\n return Package::new($cmd, $body, $ext);\n }",
"public static function unpack($data, $parentBemSelector = '', $workingDirectory = './')\n {\n if (isset($data['bem-type'], $data['definition'], $data['inner'], $data['name']) === false) {\n return null;\n }\n\n $bemSelector = static::nameEntity($data['name'], $data['bem-type'], $parentBemSelector);\n $instance = static::retrieveInstance($bemSelector);\n\n $mergeInstructions = true;\n\n if ($instance === null) {\n $mergeInstructions = false;\n\n switch ($data['bem-type']) {\n case 'element':\n $instance = new BemElement([\n 'name' => $data['name'],\n 'definition' => $data['definition'],\n 'inner' => $data['inner'],\n 'parentBemSelector' => $parentBemSelector,\n ]);\n break;\n case 'modifier':\n $instance = new BemModifier([\n 'name' => $data['name'],\n 'definition' => $data['definition'],\n 'inner' => $data['inner'],\n 'parentBemSelector' => $parentBemSelector,\n ]);\n break;\n case 'block':\n default:\n $instance = new BemBlock([\n 'name' => $data['name'],\n 'definition' => $data['definition'],\n 'inner' => $data['inner'],\n ]);\n break;\n }\n\n $instance->bemSelector = $bemSelector;\n }\n\n $instance->workingDirectory = $workingDirectory;\n $instance->unpackAdditionalAttributes($data, $mergeInstructions);\n\n static::$globalIdentityMap[$bemSelector] = $instance;\n\n return $instance;\n }",
"public static function fromXML($xml)\n {\n $nuspec = new SimpleXMLElement($xml);\n\n if ($nuspec === null || empty($nuspec->metadata)) {\n return null;\n }\n\n $spec = new NuspecFile;\n\n $spec->id = (string)$nuspec->metadata->id;\n $spec->version = (string)$nuspec->metadata->version;\n $spec->title = (string)$nuspec->metadata->title;\n $spec->authors = (string)$nuspec->metadata->authors;\n $spec->owners = (string)$nuspec->metadata->owners;\n $spec->licenseUrl = (string)$nuspec->metadata->licenseUrl;\n $spec->projectUrl = (string)$nuspec->metadata->projectUrl;\n $spec->iconUrl = (string)$nuspec->metadata->iconUrl;\n $spec->requireLicenseAcceptance = (string)$nuspec->metadata->requireLicenseAcceptance;\n $spec->developmentDependency = (string)$nuspec->metadata->developmentDependency;\n $spec->description = (string)$nuspec->metadata->description;\n $spec->summary = (string)$nuspec->metadata->summary;\n $spec->releaseNotes = (string)$nuspec->metadata->releaseNotes;\n $spec->copyright = (string)$nuspec->metadata->copyright;\n $spec->tags = (string)$nuspec->metadata->tags;\n// $spec->minClientVersion = $nuspec->metadata->minClientVersion;\n $spec->language = $nuspec->metadata->language;\n\n // dependencies processor\n $dependenciesElement = $nuspec->metadata->dependencies;\n\n if ($dependenciesElement) {\n $dependencies = [];\n\n // process v1 types\n $v1Dependencies = is_array($dependenciesElement->dependency)\n ? $dependenciesElement->dependency\n : [$dependenciesElement->dependency];\n\n foreach ($v1Dependencies as $dep) {\n if (!isset($dep['id'])) continue;\n array_push($dependencies, [\n 'id' => (string)$dep['id'],\n 'targetFramework' => null,\n 'version' => isset($dep['version'])\n ? (string)$dep['version']\n : null\n ]);\n }\n\n $v2DepGroups = is_array($dependenciesElement->group)\n ? $dependenciesElement->group\n : [$dependenciesElement->group];\n\n foreach ($v2DepGroups as $depGroup) {\n $targetFramework = isset($dep['targetFramework'])\n ? (string)$dep['targetFramework']\n : null;\n\n $v2Dependencies = is_array($depGroup->dependency)\n ? $depGroup->dependency\n : [$depGroup->dependency];\n\n foreach ($v2Dependencies as $dep) {\n if (!isset($dep['id'])) continue;\n array_push($dependencies, [\n 'id' => (string)$dep['id'],\n 'targetFramework' => $targetFramework,\n 'version' => isset($dep['version'])\n ? (string)$dep['version']\n : null\n ]);\n }\n }\n\n $dependenciesString = implode('|', array_map(function ($dependency) {\n return \"{$dependency['id']}:{$dependency['version']}:{$dependency['targetFramework']}\";\n }, $dependencies));\n\n $spec->dependencies = $dependenciesString;\n }\n\n return empty($spec->id) || empty($spec->version) ? null : $spec;\n }",
"public function buildClass($data)\n {\n $classDescriptor = new ClassDescriptor();\n\n $classDescriptor->setFullyQualifiedStructuralElementName($data->getName());\n $classDescriptor->setName($data->getShortName());\n\n $this->buildDocBlock($data, $classDescriptor);\n\n $classDescriptor->setParentClass($data->getParentClass());\n\n $classDescriptor->setLocation('', $data->getLinenumber());\n $classDescriptor->setAbstract($data->isAbstract());\n $classDescriptor->setFinal($data->isFinal());\n\n foreach ($data->getInterfaces() as $interfaceClassName) {\n $classDescriptor->getInterfaces()->set($interfaceClassName, $interfaceClassName);\n }\n foreach ($data->getConstants() as $constant) {\n $this->buildConstant($constant, $classDescriptor);\n }\n foreach ($data->getProperties() as $property) {\n $this->buildProperty($property, $classDescriptor);\n }\n foreach ($data->getMethods() as $method) {\n $this->buildMethod($method, $classDescriptor);\n }\n\n $fqcn = $classDescriptor->getFullyQualifiedStructuralElementName();\n $namespace = substr($fqcn, 0, strrpos($fqcn, '\\\\'));\n\n $classDescriptor->setNamespace($namespace);\n\n return $classDescriptor;\n }",
"public static function decodeSingle($parsedType, $data, $dataBin, $offset)\n {\n if (is_string($parsedType)) {\n $parsedType = self::parseType($parsedType);\n }\n\n $size = null;\n $num = null;\n $ret = null;\n $i = null;\n\n if ($parsedType->name === 'address') {\n return self::decodeSingle($parsedType->rawType, $data, $dataBin, $offset); //.toArrayLike(Buffer, 'be', 20).toString('hex')\n } else if ($parsedType->name === 'bool') {\n return (string)self::decodeSingle($parsedType->rawType, $data, $dataBin, $offset) . toString() === '1';\n } else if ($parsedType->name === 'string') {\n $bytes = self::decodeSingle($parsedType->rawType, $data, $dataBin, $offset);\n return $bytes; //new Buffer(bytes, 'utf8').toString()\n } else if ($parsedType->isArray) {\n // this part handles fixed-length arrays ([2]) and variable length ([]) arrays\n // NOTE: we catch here all calls to arrays, that simplifies the rest\n $ret = [];\n $size = $parsedType->size;\n\n if ($parsedType->size === 'dynamic') {\n $offset = (int)self::decodeSingle('uint256', $data, $dataBin, $offset);\n $size = self::decodeSingle('uint256', $data, $dataBin, $offset);\n $offset = $offset + 32;\n }\n for ($i = 0; $i < $size; $i++) {\n $decoded = self::decodeSingle($parsedType->subArray, $data, $dataBin, $offset);\n $ret[] = $decoded;\n $offset += $parsedType->subArray->memoryUsage;\n }\n return $ret;\n } else if ($parsedType->name === 'bytes') {\n $offset = (int)self::decodeSingle('uint256', $data, $dataBin, $offset);\n $size = (int)self::decodeSingle('uint256', $data, $dataBin, $offset);\n return bin2hex(substr($dataBin, $offset + 32, ($offset + 32 + $size) - ($offset + 32)));\n } else if (strpos($parsedType->name, 'bytes') === 0) {\n return bin2hex(substr($dataBin, $offset, ($offset + $parsedType->size) - $offset));\n } else if (strpos($parsedType->name, 'uint') === 0) {\n $num = bin2hex(substr($dataBin, $offset, $offset + 32 - $offset));\n\n if (strlen(bin2hex($num)) / 2 > $parsedType->size) {\n throw new Exception('Decoded int exceeds width: ' . $parsedType->size . ' vs ' . strlen(bin2hex($num)) / 2);\n }\n\n// if (num.bitLength() > parsedType.size) {\n// throw new Error('Decoded int exceeds width: ' + parsedType.size + ' vs ' + num.bitLength())\n// }\n return $num;\n } else if (strpos($parsedType->name, 'int') === 0) {\n $num = bin2hex(substr($dataBin, $offset, $offset + 32 - $offset));\n\n// new BN(data.slice(offset, offset + 32), 16, 'be').fromTwos(256)\n\n if (strlen(bin2hex($num)) / 2 > $parsedType->size) {\n throw new Exception('Decoded int exceeds width: ' . $parsedType->size . ' vs ' . strlen(bin2hex($num)) / 2);\n }\n\n return $num;\n } else if (strpos($parsedType->name, 'ufixed') === 0) {\n $size = pow(2, $parsedType->size[1]);\n $num = self::decodeSingle('uint256', $data, $dataBin, $offset);\n if (!($num % $size === 0)) {\n throw new Exception('Decimals not supported yet');\n }\n return $num / $size;\n } else if (strpos($parsedType->name, 'fixed') === 0) {\n $size = pow(2, $parsedType->size[1]);\n $num = self::decodeSingle('int256', $data, $dataBin, $offset);\n if (!($num % $size === 0)) {\n throw new Exception('Decimals not supported yet');\n }\n return $num / $size;\n }\n throw new Exception('Unsupported or invalid type: ' . $parsedType->name);\n }",
"public static function fromBase64($data)\n {\n return Base64Serializer::deserialize($data, get_class());\n }",
"public function deserialize($data);",
"public function unpack(string $data): Package\n {\n [$head, $body] = $this->unpackData($data);\n\n return $this->getPacker((string)$head['type'])->decode($body);\n }",
"public function createFromArray(string $class, array $data);",
"protected function parseData($data) {\n switch (strtolower($this::$type)) {\n case 'nt_image':\n $node = $this->install_nt_image($data);\n break;\n case 'image':\n $node = $this->install_image($data);\n break;\n case 'rich_media':\n $node = $this->install_rich_media($data);\n break;\n case 'video':\n $node = $this->install_video($data);\n break;\n case 'nt_video':\n $node = $this->install_nt_video($data);\n break;\n default:\n $node = new \\stdClass();\n }\n return $node;\n }",
"public static function create_from_raw_data($data) {\n $parts = array(); \n $result = preg_match(self::$property_regex, $data, $parts);\n if($result != 1) {\n throw new Exception(\"VCard: Line does not match vCard-property pattern: $data\");\n }\n $key = $parts['key'];\n $class = self::get_classname_from_key($key);\n if(class_exists($class)) {\n $property = $class::create();\n } else {\n $property = VCardProperty::create();\n }\n $property->RawData = $data;\n $property->Group = $parts['group'];\n $property->Key = strtolower($parts['key']);\n $property->RawAttributes = $parts['attrib'];\n $property->RawValue = $parts['value'];\n return $property; \n }",
"public static function create($type = null, $data = null, $base64 = true)\n {\n $ob = new self();\n\n if (!is_null($type)) {\n $ob->type = $type;\n }\n\n if (!is_null($data)) {\n $ob->data = $data;\n }\n\n $ob->base64 = (bool)$base64;\n\n return $ob;\n }",
"protected function createStructure( array $data )\n {\n $structure = clone $this->structurePrototype;\n $structure->setOptions( $data );\n\n if ( $structure instanceof MapperAwareInterface )\n {\n $structure->setMapper( $this );\n }\n\n return $structure;\n }",
"protected function getContenTypeCreateStructFixture()\n {\n // Taken from example DB\n $struct = new CreateStruct();\n $struct->name = array(\n 'always-available' => 'eng-US',\n 'eng-US' => 'Folder',\n );\n $struct->status = 0;\n $struct->description = array(\n 0 => '',\n 'always-available' => false,\n );\n $struct->identifier = 'folder';\n $struct->created = 1024392098;\n $struct->modified = 1082454875;\n $struct->creatorId = 14;\n $struct->modifierId = 14;\n $struct->remoteId = 'a3d405b81be900468eb153d774f4f0d2';\n $struct->urlAliasSchema = '';\n $struct->nameSchema = '<short_name|name>';\n $struct->isContainer = true;\n $struct->initialLanguageId = 2;\n $struct->sortField = Location::SORT_FIELD_MODIFIED_SUBNODE;\n $struct->sortOrder = Location::SORT_ORDER_ASC;\n $struct->defaultAlwaysAvailable = true;\n\n $struct->groupIds = array(\n 1,\n );\n\n $fieldDefName = new FieldDefinition();\n\n $fieldDefShortDescription = new FieldDefinition();\n\n $struct->fieldDefinitions = array(\n $fieldDefName,\n $fieldDefShortDescription\n );\n\n return $struct;\n }",
"abstract public function parse($data, $type);",
"public function decode ()\n {\n $magicBytes = $this->nextBytes(4);\n if (Utils::byteArray2String($magicBytes) === \"meta\") {\n $this->version = hexdec(Utils::bytesToHex($this->nextBytes(1)));\n if (!empty($this->metadataVersion[$this->version])) {\n $metadata[\"metadata\"] = $this->process($this->metadataVersion[$this->version]);\n $metadata[\"magicNumber\"] = $this->process(\"u32\", new ScaleBytes($magicBytes));\n $metadata[\"metadata_version\"] = $this->version;\n return $metadata;\n } else {\n throw new InvalidArgumentException(sprintf('only support metadata v12,v13,14'));\n }\n } else {\n throw new InvalidArgumentException(sprintf('decode runtime metadata fail'));\n }\n }",
"public function create(array $data)\n {\n return $this->type->create($data);\n }",
"function mimetype_from_binary($binary)\n{\n return (new \\finfo(FILEINFO_MIME_TYPE))->buffer($binary);\n}",
"public function fromArray(array $data);",
"public function fromArray(array $data);",
"public static function createFromString($raw)\n {\n $message = new self(array('raw' => $raw));\n return $message;\n }",
"static function decodeSmall(Decoder $etf, string $data, int &$pos): BaseObject {\n $length = \\ord($data[$pos]);\n \n $tuple = array();\n for(; $length > 0; $length--) {\n $pos++;\n $tuple[] = $etf->parseAny($data[$pos], $data, $pos);\n }\n \n return (new static($tuple));\n }",
"public function decode($binary, $offset=0, $length=NULL)\n {\n // get value tag\n $this->valueTag = unpack('cTag', $binary, $offset)['Tag'];\n $offset += 1;\n // get name length\n $this->nameLength = (new \\obray\\ipp\\types\\basic\\SignedShort())->decode($binary, $offset);\n $offset += $this->nameLength->getLength();\n // get value length\n $this->valueLength = (new \\obray\\ipp\\types\\basic\\SignedShort())->decode($binary, $offset);\n $offset += $this->valueLength->getLength();\n // get value (in this case the value is the key)\n $this->value = (new \\obray\\ipp\\types\\NameWithoutLanguage())->decode($binary, $offset, $this->valueLength->getValue());\n $offset += $this->value->getLength();\n // get value tag\n $this->memberValueTag = unpack('cTag', $binary, $offset)['Tag'];\n $offset += 1;\n // get name length\n $this->nameLength = (new \\obray\\ipp\\types\\basic\\SignedShort())->decode($binary, $offset);\n $offset += $this->nameLength->getLength();\n // member value\n $this->memberValueLength = (new \\obray\\ipp\\types\\basic\\SignedShort())->decode($binary, $offset);\n $offset += $this->memberValueLength->getLength();\n // get the correct value type and decode\n $this->memberValue = \\obray\\ipp\\enums\\Types::getType($this->memberValueTag);\n $this->memberValue->decode($binary, $offset, $this->memberValueLength->getValue());\n $offset += $this->valueLength->getValue();\n return $this;\n }",
"public function __construct(array $data)\n {\n foreach($this->attributes() as $property => $type) {\n if (!isset($data[$property])) {\n continue;\n }\n\n if ($type === Type::STRING || $type === Type::ANY) {\n $this->_properties[$property] = $data[$property];\n } elseif ($type === Type::BOOLEAN) {\n if (!\\is_bool($data[$property])) {\n $this->_errors[] = \"property '$property' must be boolean, but \" . gettype($data[$property]) . \" given.\";\n continue;\n }\n $this->_properties[$property] = (bool) $data[$property];\n } elseif (\\is_array($type)) {\n if (!\\is_array($data[$property])) {\n $this->_errors[] = \"property '$property' must be array, but \" . gettype($data[$property]) . \" given.\";\n continue;\n }\n switch (\\count($type)) {\n case 1:\n // array\n $this->_properties[$property] = [];\n foreach($data[$property] as $item) {\n if ($type[0] === Type::STRING) {\n if (!is_string($item)) {\n $this->_errors[] = \"property '$property' must be array of strings, but array has \" . gettype($item) . \" element.\";\n }\n $this->_properties[$property][] = $item;\n } elseif ($type[0] === Type::ANY || $type[0] === Type::BOOLEAN || $type[0] === Type::INTEGER) { // TODO simplify handling of scalar types\n $this->_properties[$property][] = $item;\n } else {\n // TODO implement reference objects\n $this->_properties[$property][] = new $type[0]($item);\n }\n }\n break;\n case 2:\n // map\n if ($type[0] !== Type::STRING) {\n throw new \\Exception('Invalid map key type: ' . $type[0]);\n }\n $this->_properties[$property] = [];\n foreach($data[$property] as $key => $item) {\n if ($type[1] === 'string') {\n if (!is_string($item)) {\n $this->_errors[] = \"property '$property' must be map<string, string>, but entry '$key' is of type \" . \\gettype($item) . '.';\n }\n $this->_properties[$property][$key] = $item;\n } elseif ($type[1] === Type::ANY || $type[1] === Type::BOOLEAN || $type[1] === Type::INTEGER) { // TODO simplify handling of scalar types\n $this->_properties[$property][$key] = $item;\n } else {\n // TODO implement reference objects\n $this->_properties[$property][$key] = new $type[1]($item);\n }\n }\n break;\n }\n } else {\n $this->_properties[$property] = new $type($data[$property]);\n }\n unset($data[$property]);\n }\n foreach($data as $additionalProperty => $value) {\n $this->_properties[$additionalProperty] = $value;\n }\n }",
"public function fromBitrixData($data){\r\n $this->map->initialize($this,$data);\r\n return $this;\r\n }",
"public static function fromString(string $rangeSet): self\n {\n $regEx = '{^' . Rfc7233::BYTE_RANGES_SPECIFIER_CAPTURE . '$}';\n if (utf8_decode($rangeSet) !== $rangeSet || preg_match($regEx, $rangeSet, $matches) !== 1) {\n throw new InvalidArgumentException('Invalid set of ranges: ' . $rangeSet);\n }\n\n $rangeRegEx = '{(?<BYTE_RANGE_SPEC>' . Rfc7233::BYTE_RANGE_SPEC . '|' . Rfc7233::SUFFIX_BYTE_RANGE_SPEC . ')}';\n preg_match_all($rangeRegEx, $matches['BYTE_RANGE_SET'], $rangeMatches);\n\n $ranges = [];\n foreach ($rangeMatches['BYTE_RANGE_SPEC'] as $range) {\n $ranges[] = ByteRange::fromString($range);\n }\n\n return new self(...$ranges);\n }",
"public function unpack($raw);",
"public function __construct(array $data = [])\n {\n // String data\n $this->name = (array_key_exists('name', $data) ? $data['name'] : '');\n $this->version = (array_key_exists('version', $data) ? $data['version'] : '');\n $this->type = (array_key_exists('type', $data) ? $data['type'] : '');\n $this->notificationUrl = (array_key_exists('notification-url', $data) ? $data['notification-url'] : '');\n $this->description = (array_key_exists('description', $data) ? $data['description'] : '');\n $this->time = (array_key_exists('time', $data) ? $data['time'] : '');\n\n // Array data\n $this->extra = (array_key_exists('extra', $data) ? $data['extra'] : []);\n $this->keywords = (array_key_exists('keywords', $data) ? $data['keywords'] : []);\n\n // Recursive data\n $this->source = (array_key_exists('source', $data) ? new Source($data['source']) : new Source());\n $this->dist = (array_key_exists('dist', $data) ? new Dist($data['dist']) : new Dist());\n\n // Mapped data\n $this->require = (array_key_exists('require', $data) ? new PackageMap($data['require']) : new PackageMap());\n $this->requireDev = (array_key_exists('require-dev', $data) ? new PackageMap($data['require-dev']) : new PackageMap());\n\n // Special cases\n if (array_key_exists('license', $data)) {\n $license = $data['license'];\n\n if (is_string($license)) {\n $license = [$license];\n }\n\n $this->license = $license;\n } else {\n $this->license = [];\n }\n\n $this->authors = [];\n if (array_key_exists('authors', $data)) {\n foreach ($data['authors'] as $author) {\n $this->authors[] = new Author($author);\n }\n }\n }",
"private function fromArray(array $data)\n {\n $this->provideDefaults($data);\n\n if (array_key_exists('ime', $data))\n $this->setIme($data['ime']);\n unset($data['ime']);\n if (array_key_exists('format', $data))\n $this->setFormat($data['format']);\n unset($data['format']);\n if (array_key_exists('width', $data))\n $this->setWidth($data['width']);\n unset($data['width']);\n if (array_key_exists('height', $data))\n $this->setHeight($data['height']);\n unset($data['height']);\n if (array_key_exists('size', $data))\n $this->setSize($data['size']);\n unset($data['size']);\n if (isset($data['filename']))\n $this->filename = \\NGS\\Converter\\PrimitiveConverter::toString($data['filename']);\n unset($data['filename']);\n\n if (count($data) !== 0 && \\NGS\\Utils::WarningsAsErrors())\n throw new \\InvalidArgumentException('Superflous array keys found in \"Resursi\\PodaciSlike\" constructor: '.implode(', ', array_keys($data)));\n }",
"public function loadForRegistry($spec)\n {\n if( false !== strpos($spec, '-') ) {\n list($type, $profile) = explode('-', $spec, 2);\n } else {\n $type = $spec;\n $profile = null;\n }\n \n return $this->factory($type, $profile);\n }",
"public function __construct($data)\r\n {\r\n $this->_name = $data->name;\r\n $this->_option = ($data->optional == '1') ? true : false;\r\n $data = (array) $data;\r\n $this->_description = $data['$t'];\r\n }",
"public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}",
"public function getBaseSpec();",
"public function loadEntity($data)\n {\n return new BillingType($this->apiToFriendly($data, static::MAP));\n }",
"function __construct($data, stdClass $structure, bool $validateFull = false)\n\t{\n\t\tif(!is_array($data) && !$data instanceof stdClass) {\n\t\t\tthrow new \\RuntimeException('TypeStruct Error: Data must be of type stdClass or array');\n\t\t}\n\t\t$this->structure \t= $structure;\n\t\t$data \t\t\t\t= is_array($data)? arrayToObject($data, $this->structure): $data;\n\t\t$this->validateFull = $validateFull;\n\t\t$struct \t\t\t= new Structure($this->structure);\n\t\t$struct->setValidateFull($this->validateFull);\n\t\t$this->response \t= $struct->validate($data);\n\t\tif($this->response['isValid']) {\n\t\t\t$this->data \t= DataType::childToStruct($data, $this->structure, false, $this->validateFull);\n\t\t} else {\n\t\t\tif(!$this->validateFull) {\n\t\t\t\t$message = \"Structure must be of type '\".get_called_class().\"'\\n\";\n\t\t\t\t$message .= \"\\nError: \".$this->response['message'];\n\t\t\t\tthrow new \\RuntimeException($message);\n\t\t\t}\n\t\t}\n\t}",
"function _civicrm_api3_configexport_create_spec(array &$spec) {\n $spec['entity_type']['api.required'] = 1;\n $spec['entity_id']['api.required'] = 1;\n}",
"public function __construct($data)\r\n {\r\n if (\\preg_match('/^([A-D])(.+?)([A-D])$/', $data, $match)) {\r\n $this->start = $match[1];\r\n $this->stop = $match[3];\r\n $data = $match[2];\r\n }\r\n else {\r\n $this->start = 'A';\r\n $this->stop = 'B';\r\n }\r\n parent::__construct($data);\r\n }",
"public function __construct($data = Array()){\n\n if(is_object($data)){\n $data = (array) $data;\n }//if\n\n if(count($data)){\n $this->data = array_merge( array_intersect_key($data, array_flip(array_keys($this->definition) ) ) );\n }//if\n\n }",
"public function from_wire($serialdata)\n {\n # decode json\n if (($this->data = json_decode($serialdata, true)) === NULL)\n throw new Exception(\"Unable to decode data '\" . $serialdata . \"' as \" . get_class($this) . \"!\");\n\n # check message type\n if (!isset($this->data['messagetype']) || $this->data['messagetype'] != get_class($this))\n throw new UnexpectedValueException(\"Unexpected message type '\" . isset($this->data['messagetype']) ? $this->data['messagetype'] : \"\" . \"' for \" . get_class($this));\n }",
"public static function decode($data) {\n $version = ((ord($data[0]) >> 6) & 192);\n $header = ((ord($data[0])) & 63);\n $size = (((( ord($data[1]) << 8) & 65280) | (ord($data[2]) & 255)) & 65535);\n //echo '<br>'.$header.' '.$size;\n return array(\"header\"=>$header,\"size\"=>$size);\n }",
"public function unmarshal($type, $data) {\n if (NULL === $type || $type->equals(Type::$VAR)) { // No conversion\n return $data;\n } else if (NULL === $data) { // Valid for any type\n return NULL;\n } else if ($type->equals(XPClass::forName('lang.types.String'))) {\n return new String($this->valueOf($data));\n } else if ($type->equals(XPClass::forName('util.Date'))) {\n return $type->newInstance($data);\n } else if ($type instanceof XPClass) {\n foreach ($this->marshallers->keys() as $t) {\n if ($t->isAssignableFrom($type)) return $this->marshallers[$t]->unmarshal($type, $data, $this);\n }\n\n // Check if a public static one-arg valueOf() method exists\n // E.g.: Assuming the target type has a valueOf(string $id) and the\n // given payload data is either a map or an array with one element, or\n // a primitive, then pass that as value. Examples: { \"id\" : \"4711\" }, \n // [ \"4711\" ] or \"4711\" - in all cases pass just \"4711\".\n if ($type->hasMethod('valueOf')) {\n $m= $type->getMethod('valueOf');\n if (Modifiers::isStatic($m->getModifiers()) && Modifiers::isPublic($m->getModifiers()) && 1 === $m->numParameters()) {\n if (NULL !== ($arg= $this->keyOf($data))) {\n return $m->invoke(NULL, array($this->unmarshal($m->getParameter(0)->getType(), $arg[0])));\n }\n }\n }\n\n // Generic approach\n $return= $type->newInstance();\n if (NULL === $data) {\n $iter= array();\n } else if (is_array($data) || $data instanceof Traversable) {\n $iter= $data;\n } else {\n $iter= array($data);\n }\n foreach ($iter as $name => $value) {\n foreach ($this->variantsOf($name) as $variant) {\n if ($type->hasField($variant)) {\n $field= $type->getField($variant);\n $m= $field->getModifiers();\n if ($m & MODIFIER_STATIC) {\n continue;\n } else if ($m & MODIFIER_PUBLIC) {\n if (NULL !== ($fType= $field->getType())) {\n $field->set($return, $this->unmarshal($fType, $value));\n } else {\n $field->set($return, $value);\n }\n continue 2;\n }\n }\n if ($type->hasMethod('set'.$variant)) {\n $method= $type->getMethod('set'.$variant);\n if ($method->getModifiers() & MODIFIER_PUBLIC) {\n if (NULL !== ($param= $method->getParameter(0))) {\n $method->invoke($return, array($this->unmarshal($param->getType(), $value)));\n } else {\n $method->invoke($return, array($value));\n }\n continue 2;\n }\n }\n }\n }\n return $return;\n } else if ($type instanceof ArrayType) {\n $return= array();\n foreach ($data as $element) {\n $return[]= $this->unmarshal($type->componentType(), $element);\n }\n return $return;\n } else if ($type instanceof MapType) {\n $return= array();\n foreach ($data as $key => $element) {\n $return[$key]= $this->unmarshal($type->componentType(), $element);\n }\n return $return;\n } else if ($type->equals(Primitive::$STRING)) {\n return (string)$this->valueOf($data);\n } else if ($type->equals(Primitive::$INT)) {\n return (int)$this->valueOf($data);\n } else if ($type->equals(Primitive::$DOUBLE)) {\n return (double)$this->valueOf($data);\n } else if ($type->equals(Primitive::$BOOL)) {\n return (bool)$this->valueOf($data);\n } else {\n throw new FormatException('Cannot convert to '.xp::stringOf($type));\n }\n }",
"public function deserialize($data)\n {\n }",
"protected abstract function newFixture($str= '');",
"public function __construct($data = null) {\n $this->fs = get_file_storage();\n\n if (is_null($data)) {\n return;\n }\n\n $this->set_data($data);\n $this->adjust_field_types();\n }",
"protected function getInstanceFromData($type, $data)\n {\n $class = null;\n $description = null;\n\n if (is_array($data)) {\n if (isset($data['class'])) {\n $class = $data['class'];\n } else {\n $class = $this->getDefaultClass();\n }\n $description = $data['description'];\n } else if (is_string($data)) {\n $class = $data;\n $description = $type;\n } else {\n throw new \\InvalidArgumentException(sprintf(\n \"Invalid data given for type '%s' does not exist\", $type));\n }\n\n if (null === $class) {\n throw new \\LogicException(sprintf(\n \"Could not find a class for type '%s'\", $type));\n }\n if (!class_exists($class)) {\n throw new \\LogicException(sprintf(\n \"Class '%s' does not exist for type '%s'\", $class, $type));\n }\n\n return new $class(\n $type,\n $description,\n isset($data['group']) ? $data['group'] : null);\n }",
"public function deserialize($stream) {\n throw new FormatUnsupported('Cannot deserialize '.($this->mime ? 'from '.$this->mime : 'without mime type'));\n }",
"public function fromArray($data)\n {\n $this->setName(array_key_exists('name', $data) ? $data['name'] : null);\n $this->setActive(array_key_exists('active', $data) ? $data['active'] : false);\n $this->setUrl(array_key_exists('url', $data) ? $data['url'] : null);\n $this->setDescription(array_key_exists('description', $data) ? $data['description'] : null);\n $this->setLogo(array_key_exists('logo', $data) ? $data['logo'] : null);\n $this->setAbstract(array_key_exists('abstract', $data) ? $data['abstract'] : null);\n \n return $this;\n }",
"public function prepareDataTypes($inputData) {\n\t\t\t$data = array();\n\n\t\t\t$typesCollection = umiObjectTypesCollection::getInstance();\n\t\t\t$types = array();\n\t\t\t$sz = count($inputData);\n\t\t\tfor($i = 0; $i < $sz; $i++) {\n\t\t\t\t$type_id = $inputData[$i];\n\t\t\t\t$type = $typesCollection->getType($type_id);\n\t\t\t\tif($type instanceof umiObjectType) {\n\t\t\t\t\t$types[] = $type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['nodes:type'] = $types;\n\t\t\treturn $data;\n\t\t}",
"public static function createFromBase64Encoded($base64_encoded_data, $name = null)\n {\n if (!is_string($base64_encoded_data)) {\n throw new InvalidArgumentException('Expected a base64 encoded string');\n }\n\n $decoded = static::base64Decode($base64_encoded_data);\n\n return static::createFromBuffer($decoded, $name);\n }",
"public function create(TypeDefinitionManager $typeDefinitionManager = null, bool $allowTrailingData = true): Decoder\n {\n $typeBuilder = new TypeBuilder(new TypeFactory);\n\n return new Decoder(\n new PacketFactory,\n new MessageFactory(new RecordCollectionFactory),\n new QuestionFactory,\n new ResourceBuilder(\n new ResourceFactory,\n new RDataBuilder(\n new RDataFactory,\n $typeBuilder\n ),\n $typeDefinitionManager ?: new TypeDefinitionManager(\n new TypeDefinitionFactory,\n new FieldDefinitionFactory\n )\n ),\n $typeBuilder,\n new DecodingContextFactory,\n $allowTrailingData\n );\n }",
"public static function create($mime, $data)\n {\n $data = array(\n $mime,\n $data,\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?' . '>'\n . '<office:document-meta '\n . 'xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" '\n . 'xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\" '\n . 'office:version=\"1.0\">'\n . '<office:meta>'\n . '<meta:generator>phpMyAdmin ' . PMA_VERSION . '</meta:generator>'\n . '<meta:initial-creator>phpMyAdmin ' . PMA_VERSION\n . '</meta:initial-creator>'\n . '<meta:creation-date>' . strftime('%Y-%m-%dT%H:%M:%S')\n . '</meta:creation-date>'\n . '</office:meta>'\n . '</office:document-meta>',\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?' . '>'\n . '<office:document-styles ' . OpenDocument::NS\n . ' office:version=\"1.0\">'\n . '<office:font-face-decls>'\n . '<style:font-face style:name=\"Arial Unicode MS\"'\n . ' svg:font-family=\"\\'Arial Unicode MS\\'\" style:font-pitch=\"variable\"/>'\n . '<style:font-face style:name=\"DejaVu Sans1\"'\n . ' svg:font-family=\"\\'DejaVu Sans\\'\" style:font-pitch=\"variable\"/>'\n . '<style:font-face style:name=\"HG Mincho Light J\"'\n . ' svg:font-family=\"\\'HG Mincho Light J\\'\" style:font-pitch=\"variable\"/>'\n . '<style:font-face style:name=\"DejaVu Serif\"'\n . ' svg:font-family=\"\\'DejaVu Serif\\'\" style:font-family-generic=\"roman\"'\n . ' style:font-pitch=\"variable\"/>'\n . '<style:font-face style:name=\"Thorndale\"'\n . ' svg:font-family=\"Thorndale\" style:font-family-generic=\"roman\"'\n . ' style:font-pitch=\"variable\"/>'\n . '<style:font-face style:name=\"DejaVu Sans\"'\n . ' svg:font-family=\"\\'DejaVu Sans\\'\" style:font-family-generic=\"swiss\"'\n . ' style:font-pitch=\"variable\"/>'\n . '</office:font-face-decls>'\n . '<office:styles>'\n . '<style:default-style style:family=\"paragraph\">'\n . '<style:paragraph-properties fo:hyphenation-ladder-count=\"no-limit\"'\n . ' style:text-autospace=\"ideograph-alpha\" style:punctuation-wrap=\"hanging\"'\n . ' style:line-break=\"strict\" style:tab-stop-distance=\"0.4925in\"'\n . ' style:writing-mode=\"page\"/>'\n . '<style:text-properties style:use-window-font-color=\"true\"'\n . ' style:font-name=\"DejaVu Serif\" fo:font-size=\"12pt\" fo:language=\"en\"'\n . ' fo:country=\"US\" style:font-name-asian=\"DejaVu Sans1\"'\n . ' style:font-size-asian=\"12pt\" style:language-asian=\"none\"'\n . ' style:country-asian=\"none\" style:font-name-complex=\"DejaVu Sans1\"'\n . ' style:font-size-complex=\"12pt\" style:language-complex=\"none\"'\n . ' style:country-complex=\"none\" fo:hyphenate=\"false\"'\n . ' fo:hyphenation-remain-char-count=\"2\"'\n . ' fo:hyphenation-push-char-count=\"2\"/>'\n . '</style:default-style>'\n . '<style:style style:name=\"Standard\" style:family=\"paragraph\"'\n . ' style:class=\"text\"/>'\n . '<style:style style:name=\"Text_body\" style:display-name=\"Text body\"'\n . ' style:family=\"paragraph\" style:parent-style-name=\"Standard\"'\n . ' style:class=\"text\">'\n . '<style:paragraph-properties fo:margin-top=\"0in\"'\n . ' fo:margin-bottom=\"0.0835in\"/>'\n . '</style:style>'\n . '<style:style style:name=\"Heading\" style:family=\"paragraph\"'\n . ' style:parent-style-name=\"Standard\" style:next-style-name=\"Text_body\"'\n . ' style:class=\"text\">'\n . '<style:paragraph-properties fo:margin-top=\"0.1665in\"'\n . ' fo:margin-bottom=\"0.0835in\" fo:keep-with-next=\"always\"/>'\n . '<style:text-properties style:font-name=\"DejaVu Sans\" fo:font-size=\"14pt\"'\n . ' style:font-name-asian=\"DejaVu Sans1\" style:font-size-asian=\"14pt\"'\n . ' style:font-name-complex=\"DejaVu Sans1\" style:font-size-complex=\"14pt\"/>'\n . '</style:style>'\n . '<style:style style:name=\"Heading_1\" style:display-name=\"Heading 1\"'\n . ' style:family=\"paragraph\" style:parent-style-name=\"Heading\"'\n . ' style:next-style-name=\"Text_body\" style:class=\"text\"'\n . ' style:default-outline-level=\"1\">'\n . '<style:text-properties style:font-name=\"Thorndale\" fo:font-size=\"24pt\"'\n . ' fo:font-weight=\"bold\" style:font-name-asian=\"HG Mincho Light J\"'\n . ' style:font-size-asian=\"24pt\" style:font-weight-asian=\"bold\"'\n . ' style:font-name-complex=\"Arial Unicode MS\"'\n . ' style:font-size-complex=\"24pt\" style:font-weight-complex=\"bold\"/>'\n . '</style:style>'\n . '<style:style style:name=\"Heading_2\" style:display-name=\"Heading 2\"'\n . ' style:family=\"paragraph\" style:parent-style-name=\"Heading\"'\n . ' style:next-style-name=\"Text_body\" style:class=\"text\"'\n . ' style:default-outline-level=\"2\">'\n . '<style:text-properties style:font-name=\"DejaVu Serif\"'\n . ' fo:font-size=\"18pt\" fo:font-weight=\"bold\"'\n . ' style:font-name-asian=\"DejaVu Sans1\" style:font-size-asian=\"18pt\"'\n . ' style:font-weight-asian=\"bold\" style:font-name-complex=\"DejaVu Sans1\"'\n . ' style:font-size-complex=\"18pt\" style:font-weight-complex=\"bold\"/>'\n . '</style:style>'\n . '</office:styles>'\n . '<office:automatic-styles>'\n . '<style:page-layout style:name=\"pm1\">'\n . '<style:page-layout-properties fo:page-width=\"8.2673in\"'\n . ' fo:page-height=\"11.6925in\" style:num-format=\"1\"'\n . ' style:print-orientation=\"portrait\" fo:margin-top=\"1in\"'\n . ' fo:margin-bottom=\"1in\" fo:margin-left=\"1.25in\"'\n . ' fo:margin-right=\"1.25in\" style:writing-mode=\"lr-tb\"'\n . ' style:footnote-max-height=\"0in\">'\n . '<style:footnote-sep style:width=\"0.0071in\"'\n . ' style:distance-before-sep=\"0.0398in\"'\n . ' style:distance-after-sep=\"0.0398in\" style:adjustment=\"left\"'\n . ' style:rel-width=\"25%\" style:color=\"#000000\"/>'\n . '</style:page-layout-properties>'\n . '<style:header-style/>'\n . '<style:footer-style/>'\n . '</style:page-layout>'\n . '</office:automatic-styles>'\n . '<office:master-styles>'\n . '<style:master-page style:name=\"Standard\" style:page-layout-name=\"pm1\"/>'\n . '</office:master-styles>'\n . '</office:document-styles>',\n '<?xml version=\"1.0\" encoding=\"UTF-8\"?' . '>'\n . '<manifest:manifest'\n . ' xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\">'\n . '<manifest:file-entry manifest:media-type=\"' . $mime\n . '\" manifest:full-path=\"/\"/>'\n . '<manifest:file-entry manifest:media-type=\"text/xml\"'\n . ' manifest:full-path=\"content.xml\"/>'\n . '<manifest:file-entry manifest:media-type=\"text/xml\"'\n . ' manifest:full-path=\"meta.xml\"/>'\n . '<manifest:file-entry manifest:media-type=\"text/xml\"'\n . ' manifest:full-path=\"styles.xml\"/>'\n . '</manifest:manifest>'\n );\n\n $name = array(\n 'mimetype',\n 'content.xml',\n 'meta.xml',\n 'styles.xml',\n 'META-INF/manifest.xml'\n );\n\n $zipExtension = new ZipExtension();\n return $zipExtension->createFile($data, $name);\n }",
"public static function fromArray(array $data);",
"public function fromArray($data)\n {\n $this->data = $data;\n\n\n }",
"public function decode ($raw);",
"protected function init( $data )\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t/** @var Sequence */\r\n\t\t\t$this->_tlv = ( new \\lyquidity\\Asn1\\Der\\Decoder() )->decodeElement( $data );\r\n\r\n\t\t\t$tbsResponseData = $this->_tlv->first()->asSequence();\r\n\t\t\t$dateTime = \\lyquidity\\Asn1\\asGeneralizedTime( $tbsResponseData->getFirstChildOfType( UniversalTagID::GENERALIZEDTIME ) );\r\n\t\t\t// $this->producedAt = $this->DateTimefromString( $dateTime );\r\n\t\t\t$this->producedAt = $dateTime->getValue();\r\n\r\n\t\t\t$this->responses = asSequence( $tbsResponseData->getFirstChildOfType( UniversalTagID::SEQUENCE ) );\r\n\r\n\t\t\t/* We care only about the first SingleResponse */\r\n\t\t\t$this->singleResponse = new SingleResponse( $this->responses->first() );\r\n\t\t}\r\n\t\tcatch (\\lyquidity\\Asn1\\Exception\\Asn1DecodingException $e) \r\n\t\t{\r\n\t\t\tthrow new ResponseException (\"Malformed request\", \\lyquidity\\OCSP\\Ocsp::ERR_MALFORMED_ASN1);\r\n\t\t} \r\n\t\tcatch (\\lyquidity\\Asn1\\Exception\\InvalidAsn1Value $e)\r\n\t\t{\r\n\t\t\tthrow new ResponseException (\"Malformed request\", \\lyquidity\\OCSP\\Ocsp::ERR_MALFORMED_ASN1);\r\n\t\t}\r\n\t}",
"public function fromArray(array $arrayData);",
"function register_core_block_types_from_metadata()\n {\n }",
"public static function fromString(string $type) : self\n {\n if (!Validators::isTypeDeclaration($type)) {\n throw new Nette\\InvalidArgumentException(\"Invalid type '{$type}'.\");\n }\n if ($type[0] === '?') {\n return new self([\\substr($type, 1), 'null']);\n }\n $unions = [];\n foreach (\\explode('|', $type) as $part) {\n $part = \\explode('&', \\trim($part, '()'));\n $unions[] = \\count($part) === 1 ? $part[0] : new self($part, '&');\n }\n return \\count($unions) === 1 && $unions[0] instanceof self ? $unions[0] : new self($unions);\n }",
"public function loadObject($resource, $type = null)\n {\n $data = $this->load($resource, $type);\n $processor = new Processor();\n $configuration = new \\derhasi\\boxfile\\Config\\Definition\\BoxfileConfiguration();\n $processedData = $processor->processConfiguration($configuration, $data);\n\n return new Boxfile($processedData);\n\n }",
"public function __construct($datatype)\n {\n $this->dataType = $datatype;\n }",
"public function buildDescriptor(object $data): ExampleDescriptor\n {\n Assert::isInstanceOf($data, Example::class);\n $descriptor = new ExampleDescriptor($data->getName());\n $descriptor->setFilePath($data->getFilePath());\n $descriptor->setStartingLine($data->getStartingLine());\n $descriptor->setLineCount($data->getLineCount());\n $descriptor->setDescription(new DescriptionDescriptor(new Description($data->getDescription() ?? ''), []));\n $descriptor->setExample($this->finder->find($data));\n\n return $descriptor;\n }",
"public function deserializeAll(string $data);",
"#[@test]\n public function byteType() {\n $this->testType(new Byte(0), 0, 0.0);\n }",
"public function parseType()\n {\n if ( ! $this->type ) {\n $this->stream->resetPointer();\n\n switch ( $this->stream->read(2) ) {\n case \"BM\":\n return $this->type = 'bmp';\n case \"GI\":\n return $this->type = 'gif';\n case chr(0xFF) . chr(0xd8):\n return $this->type = 'jpeg';\n case \"\\0\\0\":\n switch ( $this->readByte($this->stream->peek(1)) ) {\n case 1:\n return $this->type = 'ico';\n case 2:\n return $this->type = 'cur';\n }\n\n return false;\n\n case chr(0x89) . 'P':\n return $this->type = 'png';\n case \"RI\":\n if ( substr($this->stream->read(10), 6, 4) == 'WEBP' ) {\n return $this->type = 'webp';\n }\n\n return false;\n case'8B':\n return $this->type = 'psd';\n case \"II\":\n case \"MM\":\n return $this->type = 'tiff';\n default:\n $this->stream->resetPointer();\n\n // Keep reading bytes until we find '<svg'.\n while ( true ) {\n $byte = $this->stream->read( 1 );\n if ( '<' === $byte && 'svg' === $this->stream->peek( 3 ) ) {\n $this->type = 'svg';\n return $this->type;\n }\n }\n return false;\n }\n }\n\n return $this->type;\n }",
"public static function construct_from_array($data)\n {\n $album = new Album(0);\n foreach ($data as $key=>$value) {\n $album->$key = $value;\n }\n\n // Make sure that we tell em it's fake\n $album->_fake = true;\n\n return $album;\n\n }",
"public function decode($data) {}",
"public function decode($data) {}",
"public function decode($data) {}",
"public function decode($data) {}",
"public function decode($data) {}",
"abstract public function decode($data);",
"private function field_declaration_builder_from_data( $env, $field_data ) {\n\t\t$field_name = $field_data['name'];\n\t\t$field_builder = $env->field( $field_name );\n\t\t$default_value = isset( $field_data['std'] ) ? $field_data['std'] : $this->default_for_attribute( $field_data, 'std' );\n\t\t$label = isset( $field_data['label'] ) ? $field_data['label'] : $field_name;\n\t\t$description = isset( $field_data['desc'] ) ? $field_data['desc'] : $label;\n\t\t$setting_type = isset( $field_data['type'] ) ? $field_data['type'] : null;\n\t\t$choices = isset( $field_data['options'] ) ? array_keys( $field_data['options'] ) : null;\n\t\t$field_type = 'string';\n\n\t\tif ( 'checkbox' === $setting_type ) {\n\t\t\t$field_type = 'boolean';\n\t\t\tif ( $default_value ) {\n\t\t\t\t// convert our default value as well.\n\t\t\t\t$default_value = $this->bit_to_bool( $default_value );\n\t\t\t}\n\t\t\t$field_builder\n\t\t\t\t->with_serializer( array( $this, 'bool_to_bit' ) )\n\t\t\t\t->with_deserializer( array( $this, 'bit_to_bool' ) );\n\n\t\t} elseif ( 'select' === $setting_type ) {\n\t\t\t$field_type = 'string';\n\t\t} else {\n\t\t\t// try to guess numeric fields, although this is not perfect.\n\t\t\tif ( is_numeric( $default_value ) ) {\n\t\t\t\t$field_type = is_float( $default_value ) ? 'float' : 'integer';\n\t\t\t}\n\t\t}\n\n\t\tif ( $default_value ) {\n\t\t\t$field_builder->with_default( $default_value );\n\t\t}\n\t\t$field_builder\n\t\t\t->with_description( $description )\n\t\t\t->with_dto_name( $field_name )\n\t\t\t->with_type( $env->type( $field_type ) );\n\t\tif ( $choices ) {\n\t\t\t$field_builder->with_choices( $choices );\n\t\t}\n\n\t\t$this->on_field_setup( $field_name, $field_builder, $field_data, $env );\n\n\t\treturn $field_builder;\n\t}",
"function deserialise(string $data): void;",
"protected function readHeader($binaryData) {\r\n\t\tif (strlen($binaryData) != 512) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$header = [];\r\n\t\t$checksum = 0;\r\n\t\t// First part of the header\r\n\t\tfor ($i = 0; $i < 148; $i++) {\r\n\t\t\t$checksum += ord(substr($binaryData, $i, 1));\r\n\t\t}\r\n\t\t// Calculate the checksum\r\n\t\t// Ignore the checksum value and replace it by ' ' (space)\r\n\t\tfor ($i = 148; $i < 156; $i++) {\r\n\t\t\t$checksum += ord(' ');\r\n\t\t}\r\n\t\t// Last part of the header\r\n\t\tfor ($i = 156; $i < 512; $i++) {\r\n\t\t\t$checksum += ord(substr($binaryData, $i, 1));\r\n\t\t}\r\n\t\t\r\n\t\t// extract values\r\n\t\t$format = 'Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/Z32uname/Z32gname/Z8devmajor/Z8devminor/Z155prefix';\r\n\t\t\r\n\t\t$data = unpack($format, $binaryData);\r\n\t\t\r\n\t\t// Extract the properties\r\n\t\t$header['checksum'] = octdec(trim($data['checksum']));\r\n\t\tif ($header['checksum'] == $checksum) {\r\n\t\t\t$header['filename'] = trim($data['filename']);\r\n\t\t\t$header['mode'] = octdec(trim($data['mode']));\r\n\t\t\t$header['uid'] = octdec(trim($data['uid']));\r\n\t\t\t$header['gid'] = octdec(trim($data['gid']));\r\n\t\t\t$header['size'] = octdec(trim($data['size']));\r\n\t\t\t$header['mtime'] = octdec(trim($data['mtime']));\r\n\t\t\t$header['prefix'] = trim($data['prefix']);\r\n\t\t\tif ($header['prefix']) {\r\n\t\t\t\t$header['filename'] = $header['prefix'].'/'.$header['filename'];\r\n\t\t\t}\r\n\t\t\tif (($header['typeflag'] = $data['typeflag']) == '5') {\r\n\t\t\t\t$header['size'] = 0;\r\n\t\t\t\t$header['type'] = 'folder';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$header['type'] = 'file';\r\n\t\t\t}\r\n\t\t\t$header['offset'] = $this->file->tell();\r\n\t\t\t\r\n\t\t\treturn $header;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function decode($raw);",
"public static function new(): static\n {\n $data = API::ffi()->ts_parser_new();\n\n return new static(API::ffi(), $data);\n }",
"public function parseType(&$strPart){\n\t\t$strPart = trim($strPart);\t\t\n\t\tswitch($strPart[0]){\n\t\t\tcase self::getTypeClosure(bnf::PART_OPTION):\n\t\t\t\t$strPart = trim(substr($strPart,1));\n\t\t\t\treturn bnf::PART_OPTION;\n\t\t\tcase self::getTypeClosure(bnf::PART_RULE):\n\t\t\t\t$strPart = trim(substr($strPart,1));\n\t\t\t\treturn bnf::PART_RULE;\n\t\t\tcase self::getTypeClosure(bnf::PART_SET):\n\t\t\t\t$strPart = trim(substr($strPart,1));\n\t\t\t\treturn bnf::PART_SET;\n\t\t\tcase self::getTypeClosure(bnf::PART_WORD_QUOTED):\n\t\t\t\t$strPart = trim(substr($strPart,1));\n\t\t\t\treturn bnf::PART_WORD_QUOTED;\n\t\t\tcase self::getTypeClosure(bnf::PART_WORD_SIMPLE_QUOTED):\n\t\t\t\t$strPart = trim(substr($strPart,1));\n\t\t\t\treturn bnf::PART_WORD_SIMPLE_QUOTED;\n\t\t\tcase self::getTypeClosure(bnf::PART_REPETITION):\n\t\t\t\t$strPart = trim(substr($strPart,1));\n\t\t\t\treturn bnf::PART_REPETITION;\n\t\t\tdefault :\treturn bnf::PART_WORD;\n\t\t}\n\t}",
"public function addBinary(string $name, $type = \\MongoDB\\BSON\\Binary::TYPE_GENERIC) : Binary {\n\t\t$field = new Binary($name, $type);\n\t\t$this->fields[$name] = $field;\n\t\treturn $field;\n\t}"
] | [
"0.63814074",
"0.5564252",
"0.5224507",
"0.5201576",
"0.50803155",
"0.5019443",
"0.4960203",
"0.4960203",
"0.48229623",
"0.48113853",
"0.47528282",
"0.4749227",
"0.47139454",
"0.4708914",
"0.46942207",
"0.45897645",
"0.4503111",
"0.4495447",
"0.44623482",
"0.44459543",
"0.44147334",
"0.44084543",
"0.438873",
"0.4382264",
"0.437827",
"0.4375548",
"0.43749082",
"0.43674165",
"0.43563923",
"0.43403897",
"0.43276253",
"0.43215242",
"0.43171406",
"0.43126932",
"0.42747325",
"0.42685717",
"0.42663994",
"0.42555392",
"0.42160878",
"0.42041907",
"0.42014703",
"0.42014703",
"0.41895905",
"0.41871032",
"0.41763264",
"0.41639063",
"0.41637835",
"0.41529053",
"0.4149306",
"0.41422948",
"0.41410562",
"0.41299835",
"0.41271627",
"0.41221654",
"0.41202146",
"0.41124424",
"0.4104545",
"0.40986547",
"0.4090618",
"0.40889147",
"0.408179",
"0.40777883",
"0.40747094",
"0.40740013",
"0.40724614",
"0.40594772",
"0.4059316",
"0.40566573",
"0.405039",
"0.4046853",
"0.4041257",
"0.40396887",
"0.40392697",
"0.40360484",
"0.4020065",
"0.40178937",
"0.401306",
"0.40077394",
"0.4003827",
"0.40006378",
"0.39938572",
"0.39935392",
"0.39923403",
"0.39917266",
"0.3980389",
"0.39793178",
"0.39754042",
"0.397428",
"0.397428",
"0.397428",
"0.397428",
"0.397428",
"0.39701423",
"0.39688268",
"0.39667594",
"0.395811",
"0.39553618",
"0.39530668",
"0.39401972",
"0.3938356"
] | 0.5771705 | 1 |
Get binary representation for type. | public function getType()
{
return $this->type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBinary()\n {\n return $this->get(self::_BINARY);\n }",
"public function getBinary();",
"function getBinaryType() {return $this->_binarytype;}",
"public function encode(AbstractType $type): string;",
"public function getRawType(): string\n {\n return $this->rawType;\n }",
"public function binarySerialize();",
"function getBinary() {return $this->_binary;}",
"public function toBinary()\n {\n /**\n * @todo There is no documentation on the reserved data, but this is how it seems to act. May need to change this.\n */\n if (!$this->tsPropertyArray && !$this->dialInData) {\n $binary = $this->encodeReservedData('');\n } elseif ($this->tsPropertyArray && $this->dialInData) {\n $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['NPS_RDS']);\n } elseif ($this->dialInData) {\n $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['NPS']);\n } else {\n $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['RDS']);\n }\n \n $binary .= $this->dialInData ? $this->dialInData->toBinary() : hex2bin(str_pad('', 52, '20'));\n if ($this->tsPropertyArray) {\n $binary .= $this->tsPropertyArray->toBinary();\n }\n\n return $binary.$this->postBinary;\n }",
"public static function getBinary(): string\n {\n return PHP_BINARY;\n }",
"public function dump($type);",
"public function toBin()\n {\n if (!$this->internalBin) return false;\n return $this->internalBin;\n }",
"abstract function typeAsString();",
"public function getDatatype() {}",
"public function __toString ()\r\n\t{\r\n\t\tif ($this->type != self::IMAGESHOW_TYPE) {\r\n\t\t\t// TODO: add a byte (or bit) somewhere to force redownload\r\n\t\t\t$binary = pack('cccV', $this->type, $this->duration, 0,\r\n\t\t\t$this->media_id);\r\n\t\t\tif ($this->type == self::IMAGE_TYPE ||\r\n\t\t\t $this->type == self::VIDEO_TYPE ||\r\n\t\t\t $this->type == self::POWERPOINT_TYPE) {\r\n\t\t\t\t// 11 for the item/type headers and 5 for the extension\r\n\t\t\t\t$binary .= pack('Va5', 11 + 5,\r\n\t\t\t\tpathinfo($this->filename, PATHINFO_EXTENSION));\r\n\t\t\t}\r\n\t\t\treturn $binary;\r\n\t\t}\r\n\t}",
"public function getTypeStr() {\n return self::getTypes()[$this->type];\n }",
"public function toBinary()\n {\n try {\n return\n $this->getBinaryCommand().\n $this->getBinaryIdentifier().\n $this->getBinaryExpiry().\n $this->getBinaryDeviceToken().\n $this->getBinaryPayload()\n ;\n } catch (\\Exception $e) {\n throw new ConvertException('Unable to convert to binary', null, $e);\n }\n }",
"protected function typeBinary(Fluent $column)\n {\n return 'blob';\n }",
"public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"public function typeAsString()\n {\n switch ($this->_type) {\n case self::TYPE_INTEGER:\n $str = 'INTEGER';\n break;\n\n case self::TYPE_FLOAT:\n $str = 'FLOAT';\n break;\n\n case self::TYPE_VARCHAR:\n $str = 'VARCHAR';\n break;\n\n case self::TYPE_BLOB:\n $str = 'BLOB';\n break;\n\n case self::TYPE_BOOLEAN:\n $str = 'BOOLEAN';\n break;\n\n case self::TYPE_DATETIME:\n $str = 'DATETIME';\n break;\n\n case self::TYPE_TEXT:\n default:\n $str = 'TEXT';\n }\n return $str;\n }",
"private static function typeToString($type)\n {\n if ($type instanceof Schema) {\n return $type->toArray();\n }\n\n if ($type instanceof NumberType) {\n return 'number';\n }\n\n if ($type instanceof BooleanType) {\n return 'boolean';\n }\n\n if ($type instanceof StringType) {\n return 'string';\n }\n\n return null;\n }",
"protected function dumpToString()\n {\n if ($this->_type == self::NODE_ROOT) {\n return 'root';\n }\n return (string)$this->_type;\n }",
"public function getType():string { return $this->type; }",
"public static function get_bin() {\n\t\t\treturn self::$bin;\n\t\t}",
"public function getBinaryValue()\n {\n return $this->readOneof(2);\n }",
"public function getBytesField()\n {\n $value = $this->get(self::BYTES_FIELD);\n return $value === null ? (string)$value : $value;\n }",
"function readType() { return $this->_type; }",
"public function type(): string\n {\n return $this->type;\n }",
"public function type(): string\n {\n return $this->type;\n }",
"public function __toString()\n {\n if (empty($this->types)) {\n return TypeHint::NULL_TYPE;\n }\n\n return join(TypeHint::TYPE_SEPARATOR, array_map(function (Type $type) {\n return (string)$type;\n }, $this->types));\n }",
"public function getBin()\n\t{\n\t\treturn $this->bin;\n\t}",
"public function get_type();",
"public function getDataType() {}",
"function getType() { return $this->readType(); }",
"public function __toString(): string\n {\n $type = static::class;\n $position = strrpos($type, '\\\\');\n\n if ($position !== false) {\n $type = substr($type, $position);\n }\n\n return str_replace('Type', '', $type);\n }",
"public function getType() : string{\n return $this->type;\n }",
"public function getType() : string {\n return $this->type;\n }",
"function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}",
"public function toBinary(): string\n {\n switch ($this->version) {\n case 1:\n $pack = new Pack\\AssociationV1();\n break;\n case 3:\n $pack = new Pack\\AssociationV3();\n break;\n default:\n throw new \\UnexpectedValueException(\"Unsupported association tx version $this->version\");\n }\n\n return $pack($this);\n }",
"public function serialize($type = null)\n {\n $data = new Parser;\n $data->writeInt(4, $this->getVersion(), true);\n $data->writeBytes(32, $this->getPrevBlock(), true);\n $data->writeBytes(32, $this->getMerkleRoot(), true);\n $data->writeInt(4, $this->getTimestamp(), true);\n $data->writeBytes(4, $this->getBits(), true);\n $data->writeInt(4, $this->getNonce(), true);\n\n return $data->getBuffer()->serialize($type);\n }",
"public function get_type(): string {\n\t\treturn $this->type;\n\t}",
"public function bytes();",
"public function get_type(): string;",
"public function getDataType($type)\n\t{\n\t\tstatic $types = array\n\t\t(\n\t\t\t'blob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '65535'),\n\t\t\t'bool' => array('type' => 'bool'),\n\t\t\t'bigint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '18446744073709551615'),\n\t\t\t'datetime' => array('type' => 'string'),\n\t\t\t'decimal unsigned' => array('type' => 'float', 'exact' => TRUE, 'min' => '0'),\n\t\t\t'double' => array('type' => 'float'),\n\t\t\t'double precision unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'double unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'enum' => array('type' => 'string'),\n\t\t\t'fixed' => array('type' => 'float', 'exact' => TRUE),\n\t\t\t'fixed unsigned' => array('type' => 'float', 'exact' => TRUE, 'min' => '0'),\n\t\t\t'float unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'geometry' => array('type' => 'string', 'binary' => TRUE),\n\t\t\t'int unsigned' => array('type' => 'int', 'min' => '0', 'max' => '4294967295'),\n\t\t\t'integer unsigned' => array('type' => 'int', 'min' => '0', 'max' => '4294967295'),\n\t\t\t'longblob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '4294967295'),\n\t\t\t'longtext' => array('type' => 'string', 'character_maximum_length' => '4294967295'),\n\t\t\t'mediumblob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '16777215'),\n\t\t\t'mediumint' => array('type' => 'int', 'min' => '-8388608', 'max' => '8388607'),\n\t\t\t'mediumint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '16777215'),\n\t\t\t'mediumtext' => array('type' => 'string', 'character_maximum_length' => '16777215'),\n\t\t\t'national varchar' => array('type' => 'string'),\n\t\t\t'numeric unsigned' => array('type' => 'float', 'exact' => TRUE, 'min' => '0'),\n\t\t\t'nvarchar' => array('type' => 'string'),\n\t\t\t'point' => array('type' => 'string', 'binary' => TRUE),\n\t\t\t'real unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'set' => array('type' => 'string'),\n\t\t\t'smallint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '65535'),\n\t\t\t'text' => array('type' => 'string', 'character_maximum_length' => '65535'),\n\t\t\t'tinyblob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '255'),\n\t\t\t'tinyint' => array('type' => 'int', 'min' => '-128', 'max' => '127'),\n\t\t\t'tinyint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '255'),\n\t\t\t'tinytext' => array('type' => 'string', 'character_maximum_length' => '255'),\n\t\t\t'year' => array('type' => 'string'),\n\t\t);\n\n\t\t$type = str_replace(' zerofill', '', $type);\n\n\t\tif (isset($types[$type]))\n\t\t\treturn $types[$type];\n\n\t\treturn parent::getDataType($type);\n\t}",
"public function getType() : string\n {\n return $this->type;\n }",
"public function getType() : string\n {\n return $this->type;\n }",
"public function getType() : string\n {\n return $this->type;\n }",
"public function getType(): string {\n return $this->type;\n }",
"abstract protected function get_typestring();",
"public function type();",
"public function type();",
"public function type();",
"public function type();",
"public function getBinaryContent();",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"private static function getPropertyTypeAsByte($typeChar) {\n if ($typeChar === 's') {\n return Mobi_Mtld_DA_DataType::STRING;\n }\n if ($typeChar === 'b') {\n return Mobi_Mtld_DA_DataType::BOOLEAN;\n }\n if ($typeChar === 'i') {\n return Mobi_Mtld_DA_DataType::INTEGER;\n }\n if ($typeChar === 'd') {\n return Mobi_Mtld_DA_DataType::DOUBLE;\n }\n return Mobi_Mtld_DA_DataType::UNKNOWN;\n }",
"public function getType(): string {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType()\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"public function __toString(): string\n {\n return $this->fullTypeString;\n }",
"public function type()\n\t{\n\t\treturn Ar::type($this->attributes);\n\t}",
"public function getType() {\n return 'A0';\n }",
"public function GetType(){\r\n\t\treturn $this->type;\r\n\t}",
"public function __toString()\n {\n $type = gettype($this->value);\n\n switch ($type) {\n case 'boolean':\n return $this->boolean($this->value);\n break;\n case 'integer':\n return $this->int($this->value);\n break;\n case 'double':\n return $this->float($this->value);\n break;\n case 'string':\n return $this->string($this->value);\n break;\n case 'array':\n return $this->array($this->value);\n break;\n case 'object':\n return $this->object($this->value);\n break;\n case 'resource':\n return $this->resource($this->value);\n break;\n case 'NULL':\n return 'NULL';\n break;\n default:\n return '(unknown type)';\n break;\n };\n }",
"protected function raw_value( $value, $type ) {\n\t\tif ( 'bytes' == $type ) {\n\t\t\t$value = $this->let_to_num( $value );\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function getDataType(): string;",
"public function getDataType(): string;",
"public function __toString() {\n\t\treturn __CLASS__ . '(' . $this->type . ')';\n\t}",
"function getTypeConverter() ;",
"public static function data($data, $type = null)\n {\n $type === null && $type = MongoBinData::BYTE_ARRAY;\n\n return new MongoBinData($data, $type);\n }",
"public function getType() :string\n {\n return $this->types[$this->type];\n }",
"public static function getType(): string\n {\n return self::TYPE;\n }",
"public function getType(): string\n {\n return self::TYPE_STRING;\n }",
"public function getType(): string\n {\n return self::TYPE_STRING;\n }",
"function getType() { return $this->_type; }",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();"
] | [
"0.71028745",
"0.69462323",
"0.6941539",
"0.6628479",
"0.6428427",
"0.6384725",
"0.63289857",
"0.629773",
"0.62261975",
"0.6174196",
"0.6139619",
"0.6031414",
"0.599707",
"0.59877485",
"0.58817524",
"0.587844",
"0.5865317",
"0.5830405",
"0.5829734",
"0.5820817",
"0.5819362",
"0.5801318",
"0.57983655",
"0.57550293",
"0.57115555",
"0.57049865",
"0.5692236",
"0.5692236",
"0.56822765",
"0.5681629",
"0.56788415",
"0.56755143",
"0.5655732",
"0.56504476",
"0.5634152",
"0.5629949",
"0.5627723",
"0.5624008",
"0.5623183",
"0.5619431",
"0.56114",
"0.5607047",
"0.56050783",
"0.5593283",
"0.5593283",
"0.5593283",
"0.55712086",
"0.5569195",
"0.55615944",
"0.55615944",
"0.55615944",
"0.55615944",
"0.5557116",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55515873",
"0.55420035",
"0.55363214",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.552656",
"0.5522779",
"0.5518302",
"0.55080956",
"0.5505668",
"0.54879254",
"0.548707",
"0.5483065",
"0.548047",
"0.548047",
"0.54747385",
"0.5466834",
"0.5453638",
"0.5448885",
"0.5439616",
"0.5435575",
"0.5435575",
"0.5431058",
"0.5430935",
"0.5430935",
"0.5430935",
"0.5430935",
"0.5430935",
"0.5430935"
] | 0.0 | -1 |
Get key type (applies for maps). | public function getKeyType()
{
return $this->keyType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_key_type() {\n return 0;\n }",
"public function getKeyType();",
"public function keyType(): ?string;",
"public function getKeyType(): string\n {\n return 'string';\n }",
"public function getKeyType()\n {\n return 'string';\n }",
"public function getKeyType()\n {\n return 'string';\n }",
"public function getKeyType()\n {\n return 'string';\n }",
"function keyTypes()\n {\n return array('pattern' => 'K');\n }",
"public static function getKey($type) {\n\t\t$type = strtolower(str_replace('drop', '', $type));\n\n\t\tif ($type === 'primary') return 'PRIMARY KEY';\n\t\tif ($type === 'index') return 'INDEX';\n\t\tif ($type === 'unique') return 'UNIQUE';\n\n\t\treturn 'FOREIGN KEY';\n\t}",
"public function type(string $key)\n {\n return $this->redis->type($key);\n }",
"function monsterinsights_get_license_key_type() {\n\t$type = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) ) {\n\t\tif ( in_array( $license['type'], array( 'master', 'pro', 'plus', 'basic' ) ) ) {\n\t\t\t$type = $license['type'];\n\t\t}\n\t}\n\treturn $type;\n}",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n\t{\n\t\t$types = $this->getValidTypes();\n\n\t\treturn $types[$this->type];\n\t}",
"public function get_type();",
"public function keyTypeParameter(): Parameter\\KeyTypeParameter\n {\n return self::_checkType($this->get(Parameter\\JWKParameter::P_KTY),\n Parameter\\KeyTypeParameter::class);\n }",
"public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n return $this->_propDict[\"type\"];\n } else {\n return null;\n }\n }",
"public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n return $this->_propDict[\"type\"];\n } else {\n return null;\n }\n }",
"public function getTypeText()\n {\n return ($this->isPending() ? 'Key Request' : 'Key');\n }",
"abstract protected function _getKeyClassName();",
"public function getType()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'type'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'type'];\n\t\t}\n\t}",
"public function setKeyType($type);",
"public static function getKey();",
"public static function getKey();",
"protected function _getKeyClassName() {}",
"protected function _getKeyClassName() {}",
"public function getFieldType($key)\n {\n $field = $this->customFields->where(\"field_name\",$key)->first();\n\n if(isset($field->field_type))\n return $field->field_type;\n else\n return \"not_found\";\n }",
"public function getType()\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"private function getKey()\n {\n if ('rs\\GaufretteBrowserBundle\\Entity\\File' == $this->getClassName()) {\n return 'keys';\n } elseif ('rs\\GaufretteBrowserBundle\\Entity\\Directory' == $this->getClassName()) {\n return 'dirs';\n }\n\n throw new \\InvalidArgumentException('unknown type '.$this->getClassName());\n }",
"public function getTypeId()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typeid'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typeid'];\n\t\t}\n\t}",
"protected function getKeyType($constraintType)\n {\n switch ($constraintType) {\n case 'PRIMARY KEY':\n return ObjectModel::PRIMARY_KEY;\n case 'UNIQUE':\n return ObjectModel::UNIQUE_KEY;\n case 'FOREIGN KEY':\n return ObjectModel::FOREIGN_KEY;\n default:\n return ObjectModel::KEY;\n }\n }",
"public function getType()\n\t{\n\t\treturn empty($this->type) ? $this->guessType() : $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}",
"function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}",
"public function cKey($type, $key) {\n\t\t// Local cache for cKeys\n\t\tstatic $cKeys;\n\t\tif (isset($cKeys[$type.','.$key])) {\n\t\t\treturn $cKeys[$type.','.$key];\n\t\t}\n\n\t\t$cKey = $this->_config['app'] .\n\t\t\t$this->_config['delimiter'] .\n\t\t\t$type .\n\t\t\t$this->_config['delimiter'] .\n\t\t\t$this->sane($key);\n\n\t\t// http://groups.google.com/group/memcached/browse_thread/thread/4c9e28eb9e71620a\n\t\t// From: Brian Moon <[email protected]>\n\t\t// Date: Sun, 26 Apr 2009 22:59:29 -0500\n\t\t// Local: Mon, Apr 27 2009 5:59 am\n\t\t// Subject: Re: what is the maximum of memcached key size now ?\n\t\t//\n\t\t// pecl/memcache will handle your keys being too long. I forget what it\n\t\t// does (md5 maybe) but it silently deals with it.\n\n//\t\tif (strlen($cKey) > 250) {\n//\t\t\t$cKey = md5($cKey);\n//\t\t}\n\n\t\t$cKeys[$type.','.$key] = $cKey;\n\t\treturn $cKey;\n\t}",
"public function get_type(): string;",
"public function getTypeId()\n {\n return $this->get(self::_TYPE_ID);\n }",
"function getAssocType() {\n\t\treturn $this->getData('assocType');\n\t}",
"private function get_type() {\n\n\t}",
"function getType(): string;",
"function getType(): string;",
"public function get_post_type() {\n\t\treturn $this->post_type_key;\n\t}",
"protected function get_key( $lock_type ) {\n\t\treturn sprintf( 'action_scheduler_lock_%s', $lock_type );\n\t}",
"public function getPublicKeyType()\n {\n return $this->public_key_type;\n }",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"public function getKey();",
"function getDataType($key=false) {\n\t\t\n\t\t$output = $this->getDataTypes();\n\t\t\n\t\tif (!$key) {\n \t\treturn $output;\n \t} else {\n \t\treturn $output[$key];\n \t}\n\t\t\n\t}",
"public function getType()\n {\n return self::TYPE;\n }",
"public function getType() {\n\t\treturn self::$_type;\n\t}",
"function _get_type() {\n\t\treturn $this->type();\n\n\t}",
"function getType();",
"function getType();",
"function getType();",
"function getType();",
"function getType();",
"public function getType() :string\n {\n return $this->types[$this->type];\n }",
"public static function get_contract_type( $key ) {\n $contract_options = self::contract_options();\n return $contract_options[ $key ];\n }",
"public function get_type(): string {\n\t\treturn $this->type;\n\t}",
"function generateKey($id, $type);",
"function getType() ;",
"function getType() ;",
"function getType() ;",
"public function getType()\n {\n return isset($this->type) ? $this->type : 0;\n }",
"abstract protected function get_typeid();",
"public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"public static function getAuthKey($userType)\n {\n return isset(self::$_auth_keys[$userType]) ?\n self::$_auth_keys[$userType] : false;\n }",
"abstract public function getKey();",
"abstract public function getKey();",
"public static function getType(): string\n {\n return self::TYPE;\n }",
"function getPKType($table)\n{\n $field_list = getTableFields($table);\n foreach($field_list as $f) {\n if ($f['Key' == 'PRI']) {\n return $f['Type'];\n }\n }\n return \"\";\n}",
"public function getType()\n {\n return $this->getProperty('type');\n }"
] | [
"0.81791925",
"0.7667091",
"0.7639854",
"0.71320474",
"0.6989893",
"0.6989893",
"0.6989893",
"0.67017",
"0.6682409",
"0.66455775",
"0.6620695",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.65567243",
"0.6555001",
"0.6555001",
"0.6555001",
"0.6482562",
"0.6448722",
"0.63949466",
"0.6372232",
"0.6372232",
"0.63717407",
"0.63257533",
"0.6314759",
"0.6266231",
"0.6246219",
"0.6246219",
"0.62397593",
"0.62397593",
"0.6224176",
"0.6218132",
"0.6214329",
"0.617925",
"0.6151826",
"0.6146531",
"0.61417854",
"0.61356324",
"0.6133997",
"0.6126945",
"0.60690194",
"0.60431325",
"0.60326284",
"0.60212487",
"0.60212487",
"0.6015613",
"0.60079354",
"0.6000812",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5955061",
"0.5948031",
"0.5933501",
"0.59250444",
"0.5902922",
"0.58980995",
"0.58980995",
"0.58980995",
"0.58980995",
"0.58980995",
"0.589345",
"0.5891556",
"0.58833736",
"0.5877398",
"0.5877253",
"0.58767956",
"0.5876696",
"0.58716106",
"0.5870705",
"0.58692324",
"0.5847758",
"0.5846413",
"0.5846413",
"0.5834201",
"0.58317477",
"0.58166337"
] | 0.81701165 | 1 |
Get value type (applies for collections). | public function getValueType()
{
return $this->valueType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getType()\n {\n return $this->_value->getType();\n }",
"public function getValueType();",
"protected static function getType($value) {\n\t\t\tif ($value === NULL) {\n\t\t\t\t$result = 'NULL';\n\t\t\t} elseif (is_array($value)) {\n\t\t\t\t$result = 'array';\n\t\t\t} elseif (is_scalar($value)) {\n\t\t\t\t$scalarType = gettype($value);\n\t\t\t\t$result = $scalarType;\n\t\t\t} else {\n\t\t\t\t$valueClassType = get_class($value);\n\t\t\t\t$result = $valueClassType;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}",
"abstract public function getValueType();",
"public static function typeOfValue($value)\n {\n if (is_null($value)) {\n return self::TYPE_NULL;\n }\n if (is_int($value)) {\n return self::TYPE_INT;\n }\n if (is_bool($value)) {\n return self::TYPE_BOOL;\n }\n return self::TYPE_STR;\n }",
"public function getType()\n {\n $value = $this->get(self::TYPE);\n return $value === null ? (integer)$value : $value;\n }",
"public function getType()\n {\n return $this->fields['Type']['FieldValue'];\n }",
"public function getValue() {\n return $this->type;\n }",
"public static function getType($value)\n {\n $type = \\strtolower(\\gettype($value));\n if ($type == 'object') {\n if ($value instanceof \\Imperium\\JSON\\ArrayObject) {\n return 'array';\n } elseif ($value instanceof \\Imperium\\JSON\\Undefined) {\n return 'undefined';\n }\n } elseif ($type == 'array') {\n if (!empty($value) && (array_keys($value) !== range(0, count($value) - 1))) {\n return 'object';\n }\n } elseif ($type == 'integer' || $type == 'double') {\n return 'number';\n }\n return $type;\n }",
"public static function getType($value): string\n\t{\n\t\tif(is_string($value)) {\n\t\t\treturn 'string';\n\t\t} else if(is_int($value)) {\n\t\t\treturn 'integer';\n\t\t} else if(is_float($value)) {\n\t\t\treturn 'float';\n\t\t} else if(is_array($value)) {\n\t\t\treturn 'array';\n\t\t} else if(is_bool($value)) {\n\t\t\treturn 'boolean';\n\t\t} else if(is_object($value)) {\n\t\t\treturn 'object';\n\t\t}\n\t\treturn 'different';\n\t}",
"public function getValueType($valueName);",
"public function getType()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'type'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'type'];\n\t\t}\n\t}",
"public static function getTypeFromValue($value)\n {\n switch (gettype($value)) {\n case 'boolean':\n return Type::getBool();\n\n case 'integer':\n return Type::getInt();\n\n case 'double':\n return Type::getFloat();\n\n case 'string':\n return Type::getString();\n\n case 'array':\n return Type::getArray();\n\n case 'NULL':\n return Type::getNull();\n\n default:\n return Type::getMixed();\n }\n }",
"public function getType()\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"public function get_type()\n {\n return $this->get_default_property(self::PROPERTY_TYPE);\n }",
"public function getType()\n {\n return parent::getValue('type');\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function type($value = null){\n return $this->attr(ATTR_TYPE, $value);\n }",
"private function GetType($value){\n\t\tswitch (true) {\n\t\t\tcase is_int($value):\n\t\t\t\t$type = PDO::PARAM_INT;\n\t\t\t\tbreak;\n\t\t\tcase is_bool($value):\n\t\t\t\t$type = PDO::PARAM_BOOL;\n\t\t\t\tbreak;\n\t\t\tcase is_null($value):\n\t\t\t\t$type = PDO::PARAM_NULL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$type = PDO::PARAM_STR;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $type;\n\t}",
"protected function getType(&$value)\n {\n return self::T_FIELD;\n }",
"public function getType()\n\t{\n\t\t$types = $this->getValidTypes();\n\n\t\treturn $types[$this->type];\n\t}",
"public function getSettingValueType()\n {\n if (array_key_exists(\"settingValueType\", $this->_propDict)) {\n return $this->_propDict[\"settingValueType\"];\n } else {\n return null;\n }\n }",
"public function getType()\n\t{\n\t\treturn empty($this->type) ? $this->guessType() : $this->type;\n\t}",
"public function get_type();",
"protected function _typecast($value) {\n\t\t$type = null;\t\t\n\n\t\tif (is_string($value)) {\n\t\t\t$type = 'string';\n\t\t}\n\t\tif (is_int($value)) {\n\t\t\t$type = 'int';\n\t\t}\n\t\tif (is_float($value)) {\n\t\t\t$type = 'double';\n\t\t}\n\t\tif (is_bool($value)) {\n\t\t\t$type = 'boolean';\n\t\t}\n\t\tif (is_array($value)) {\n\t\t\t$type = 'array';\n\t\t\t\n\t\t\t$valueKeys = array_keys($value);\n\t\t\tforeach($valueKeys as $vk) {\n\t\t\t\tif (!is_numeric($vk)) {\n\t\t\t\t\t$type = 'struct';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $type;\n\t}",
"public function getTypeAttribute($value)\n {\n return self::typeToString($value);\n }",
"public function getValueElementType()\n {\n switch ($this->getAttribute()) {\n case 'country_id':\n case 'region_id':\n return 'multiselect';\n }\n\n return 'text';\n }",
"function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}",
"public static function getTypeOrClass($value)\n {\n return is_object($value) ? get_class($value) : gettype($value);\n }",
"public function getType() {\n\t\treturn $this->getDiscreteField()->getType();\n\t}",
"public function getType()\n {\n return $this->getProperty('type');\n }",
"public function getDataType()\n {\n return $this->_fields['DataType']['FieldValue'];\n }",
"public static function getValue($value)\n\t{\n\t\tif(is_string($value)) {\n\t\t\tif($value instanceof DataTypes\\TypeString) {\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\treturn new DataTypes\\TypeString($value);\n\t\t\t}\n\t\t} else if(is_int($value)) {\n\t\t\tif($value instanceof DataTypes\\TypeInt) {\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\treturn new DataTypes\\TypeInt($value);\n\t\t\t}\n\t\t} else if(is_float($value)) {\n\t\t\tif($value instanceof DataTypes\\TypeFloat) {\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\treturn new DataTypes\\TypeFloat($value);\n\t\t\t}\n\t\t} else if(is_array($value)) {\n\t\t\tif($value instanceof DataTypes\\TypeArray) {\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\treturn new DataTypes\\TypeArray($value);\n\t\t\t}\n\t\t} else if(is_bool($value)) {\n\t\t\tif($value instanceof DataTypes\\TypeBool) {\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\treturn new DataTypes\\TypeBool($value);\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}",
"protected function getValueType($value): int\n {\n if (is_int($value)) {\n return PDO::PARAM_INT;\n } else if (is_string($value)) {\n return PDO::PARAM_STR;\n } else if (is_bool($value)) {\n return PDO::PARAM_BOOL;\n } else if (is_float($value)) {\n return PDO::PARAM_INT;\n } else {\n return PDO::PARAM_STR;\n }\n }",
"public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n return $this->_propDict[\"type\"];\n } else {\n return null;\n }\n }",
"public function getType()\n {\n if (array_key_exists(\"type\", $this->_propDict)) {\n return $this->_propDict[\"type\"];\n } else {\n return null;\n }\n }",
"public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}",
"static function get_value($value, $type) {\n switch ($type) {\n case 'int':\n return (int)$value;\n break;\n case 'string':\n case 'text':\n case 'reference':\n return $value;\n break;\n case 'bool':\n return str_to_bool($value);\n break;\n case 'float':\n case 'double':\n return (float)$value;\n break;\n }\n\n return null;\n }",
"public function getType()\n {\n return isset($this->type) ? $this->type : 0;\n }",
"function rest_get_best_type_for_value($value, $types)\n {\n }",
"private static function getCustomDataType($val)\n {\n if (!is_array($val))\n {\n $type = \"date\";\n }\n else\n {\n $type = gettype($val);\n }\n\n return $type;\n }",
"public function getType() {\n\t\treturn self::$_type;\n\t}",
"public function getMimicTypeAttribute($value)\n {\n return $this->getMimicType($value);\n }",
"protected function getTypeValue($type)\n {\n return $this->typeMapping[$type] ?? self::VALUE_DYNAMIC;\n }",
"protected function getDataType($value)\n {\n if (is_bool($value))\n {\n return PDO::PARAM_BOOL;\n }\n if (is_null($value))\n {\n return PDO::PARAM_NULL;\n }\n if (is_integer($value))\n {\n return PDO::PARAM_INT;\n }\n return PDO::PARAM_STR;\n }",
"function data_type($type) {\r\n\t\t$return_value = '';\r\n\t\t$type = (string) $type;\r\n\r\n\t\tswitch (strtolower($type)) {\r\n\t\t\t// supported scalar types\r\n\t\t\tcase 'ENTITIES':\r\n\t\t\tcase 'ENTITY':\r\n\t\t\tcase 'ID':\r\n\t\t\tcase 'IDREF':\r\n\t\t\tcase 'IDREFS':\r\n\t\t\tcase 'NCName':\r\n\t\t\tcase 'NMTOKEN':\r\n\t\t\tcase 'NMTOKENS':\r\n\t\t\tcase 'Name':\r\n\t\t\tcase 'anySimpleType':\r\n\t\t\tcase 'anyType':\r\n\t\t\tcase 'base64':\r\n\t\t\tcase 'base64Binary':\r\n\t\t\tcase 'boolean':\r\n\t\t\tcase 'byte':\r\n\t\t\tcase 'date':\r\n\t\t\tcase 'dateTime':\r\n\t\t\tcase 'decimal':\r\n\t\t\tcase 'double':\r\n\t\t\tcase 'duration':\r\n\t\t\tcase 'float':\r\n\t\t\tcase 'gDay':\r\n\t\t\tcase 'gMonth':\r\n\t\t\tcase 'gMonthDay':\r\n\t\t\tcase 'gYear':\r\n\t\t\tcase 'gYearMonth':\r\n\t\t\tcase 'hexBinary':\r\n\t\t\tcase 'i4':\r\n\t\t\tcase 'int':\r\n\t\t\tcase 'integer':\r\n\t\t\tcase 'language':\r\n\t\t\tcase 'long':\r\n\t\t\tcase 'negativeInteger':\r\n\t\t\tcase 'nonNegativeInteger':\r\n\t\t\tcase 'nonPositiveInteger':\r\n\t\t\tcase 'normalizedString':\r\n\t\t\tcase 'positiveInteger':\r\n\t\t\tcase 'short':\r\n\t\t\tcase 'string':\r\n\t\t\tcase 'time':\r\n\t\t\tcase 'timeInstant':\r\n\t\t\tcase 'token':\r\n\t\t\tcase 'unsignedByte':\r\n\t\t\tcase 'unsignedInt':\r\n\t\t\tcase 'unsignedLong':\r\n\t\t\tcase 'unsignedShort':\r\n\t\t\tcase 'ur-type':\r\n\t\t\t\t$return_value = 'xsd:' . $type;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\r\n\t\t\t\tforeach ($this->types as $id => $type_definition) {\r\n\r\n\t\t\t\t\tif ($type_definition['name'] == $type) {\r\n\t\t\t\t\t\t$return_value = 'tns:' . $type;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} // end: if\r\n\t\t\t\t} // end: foreach\r\n\t\t} // end: switch\r\n\r\n\t\treturn $return_value;\r\n\t}",
"public function getType()\n\t{\n\t\treturn $this->getObject('type', null, 'type');\n\t}",
"private function filter_type( $value ) {\n\t\tif ( empty( $this->type ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tswitch ( $this->type->case() ) {\n\t\t\tcase Schema_Type::NUMBER:\n\t\t\t\treturn (int) $value;\n\n\t\t\tcase Schema_Type::BOOL:\n\t\t\t\treturn (bool) $value;\n\n\t\t\tcase Schema_Type::STRING:\n\t\t\t\treturn (string) $value;\n\n\t\t\tcase Schema_Type::ARRAY:\n\t\t\t\treturn (array) $value;\n\t\t}\n\n\t\treturn $value;\n\t}",
"function _get_type() {\n\t\treturn $this->type();\n\n\t}",
"final protected function get_type() {\n return $this->type;\n }",
"protected function _introspectType($value)\n\t{\n\t\tswitch (true) {\n\t\t\tcase (is_bool($value)):\n\t\t\t\treturn 'boolean';\n\t\t\tcase (is_float($value) || preg_match('/^\\d+\\.\\d+$/', $value)):\n\t\t\t\treturn 'float';\n\t\t\tcase (is_int($value) || preg_match('/^\\d+$/', $value)):\n\t\t\t\treturn 'integer';\n\t\t\tcase (is_string($value) && strlen($value) <= $this->_columns['string']['length']):\n\t\t\t\treturn 'string';\n\t\t\tdefault:\n\t\t\t\treturn 'text';\n\t\t}\n\t}",
"public function get_post_type($value='') {\n\t\t\treturn $this->post_type;\n\t\t}",
"public function GetType()\n {\n return ( $this->type );\n }",
"public function getType()\r\n {\r\n return $this->m_type;\r\n }",
"public function get_type() {\n\t\treturn $this->type;\n\t}",
"public function get_field_type() {\n\t\treturn $this->get_field_attr( 'type' );\n\t}",
"public static function typeMatches ($value, $type) {\n $types = array(\"string\", \"number\", \"array\", \"object\", \"date\", \"boolean\", \"null\");\n $phpType = gettype($value);\n //....?\n }",
"public function getType()\n {\n $result = \"\";\n if (preg_match('/int/',$this->type))\n $result = \"int\";\n\n if (preg_match('/year/',$this->type))\n $result = \"int\";\n\n if (preg_match('/integer/',$this->type))\n $result = \"int\";\n\n if (preg_match('/tynyint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/smallint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/mediumint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/bigint/',$this->type))\n $result = \"int\";\n\n if (preg_match('/varchar/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/text/',$this->type))\n $result = \"string\";\n\n if (preg_match('/tyntext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/mediumtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/longtext/',$this->type))\n $result = \"string\";\n\n if (preg_match('/char/',$this->type))\n $result = \"string\";\n\n if (preg_match('/enum/',$this->type))\n $result = \"enum\";\n\n if (preg_match('/set/',$this->type))\n $result = \"string\";\n\n if (preg_match('/date/',$this->type))\n $result = \"date\";\n\n if (preg_match('/time/',$this->type))\n $result = \"time\";\n\n if (preg_match('/datetime/',$this->type))\n $result = \"datetime\";\n\n if (preg_match('/decimal/',$this->type))\n $result = \"float\";\n\n if (preg_match('/float/',$this->type))\n $result = \"float\";\n\n if (preg_match('/double/',$this->type))\n $result = \"double\";\n\n if (preg_match('/real/',$this->type))\n $result = \"real\";\n\n if (preg_match('/fixed/',$this->type))\n $result = \"float\";\n\n if (preg_match('/numeric/',$this->type))\n $result = \"float\";\n\n if (empty($result)){\n // $result = $this->type;\n $result = \"string\";\n }\n\n // TODO EVALUATES BIT, TIMESTAMP, VARBINARY, BLOB MySQL data types\n return $result;\n }",
"public function getType()\n {\n return isset($this->type) ? $this->type : null;\n }",
"function getType() \n {\n return $this->getValueByFieldName( 'statevar_type' );\n }",
"public function getType()\n {\n return (string) $this->getTypesCollection();\n }",
"public function getType() {\n\t\treturn $this->type;\n\t}",
"public function getType() {\n\t\treturn $this->type;\n\t}",
"public function getType() {\n\t\treturn $this->type;\n\t}",
"public function getType() {\n\t\treturn $this->type;\n\t}",
"public function get_type() {\n return $this->type;\n }",
"public function getType()\n\t{\n\t\treturn $this->_type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->_type;\n\t}",
"public function getType()\n {\n return $this->factory->resolveType($this);\n }",
"public function getType() {\n return $this->field->type;\n }",
"public function getType() {\n return $this->field['type'] ?? '';\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n {\n return $this->_type;\n }",
"public function getType()\n\t\t{\n\t\t\treturn $this->type;\n\t\t}",
"public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"public function getType()\r\n {\r\n return $this->_type;\r\n }",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}",
"public function getType()\n\t{\n\t\treturn $this->type;\n\t}"
] | [
"0.82146835",
"0.79093343",
"0.7845173",
"0.7620993",
"0.75549376",
"0.747043",
"0.7385503",
"0.7340929",
"0.73177654",
"0.7292176",
"0.7279202",
"0.718916",
"0.7186143",
"0.71443343",
"0.708916",
"0.7086009",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7060031",
"0.7059278",
"0.7059278",
"0.7059278",
"0.7042409",
"0.70267683",
"0.696307",
"0.69568515",
"0.69554275",
"0.6940559",
"0.6930515",
"0.6921284",
"0.6917191",
"0.68543726",
"0.6849649",
"0.68156254",
"0.6799798",
"0.6797939",
"0.6777646",
"0.6735578",
"0.6699132",
"0.6698413",
"0.6698413",
"0.66934013",
"0.66915876",
"0.6683457",
"0.66760397",
"0.6649872",
"0.66333365",
"0.663061",
"0.6623497",
"0.65978724",
"0.65931594",
"0.6588036",
"0.65825516",
"0.65741885",
"0.6565903",
"0.65656644",
"0.6555184",
"0.6553265",
"0.65430653",
"0.6525801",
"0.6517608",
"0.6509403",
"0.6504816",
"0.6502801",
"0.6496117",
"0.6495154",
"0.6491068",
"0.6491068",
"0.6491068",
"0.6491068",
"0.64891934",
"0.648759",
"0.648759",
"0.64794683",
"0.64737207",
"0.6472446",
"0.6471325",
"0.6471325",
"0.6471325",
"0.6471325",
"0.6471325",
"0.6471325",
"0.6471325",
"0.646852",
"0.64620245",
"0.64563066",
"0.64556533",
"0.64556533",
"0.64556533",
"0.64556533",
"0.64556533",
"0.64556533",
"0.64556533"
] | 0.7833288 | 3 |
Get textual representation of type, as used in CQL. | public function __toString()
{
switch ($this->type) {
case self::COLLECTION_LIST:
$valueType = (string) $this->valueType;
return "list<$valueType>";
case self::COLLECTION_SET:
$valueType = (string) $this->valueType;
return "set<$valueType>";
case self::COLLECTION_MAP:
$keyType = (string) $this->keyType;
$valueType = (string) $this->valueType;
return "map<$keyType,$valueType>";
default:
return $this->getTypeName();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function typeAsString()\n {\n switch ($this->_type) {\n case self::TYPE_INTEGER:\n $str = 'INTEGER';\n break;\n\n case self::TYPE_FLOAT:\n $str = 'FLOAT';\n break;\n\n case self::TYPE_VARCHAR:\n $str = 'VARCHAR';\n break;\n\n case self::TYPE_BLOB:\n $str = 'BLOB';\n break;\n\n case self::TYPE_BOOLEAN:\n $str = 'BOOLEAN';\n break;\n\n case self::TYPE_DATETIME:\n $str = 'DATETIME';\n break;\n\n case self::TYPE_TEXT:\n default:\n $str = 'TEXT';\n }\n return $str;\n }",
"abstract function typeAsString();",
"public function getTypeStr() {\n return self::getTypes()[$this->type];\n }",
"public function typeText() {\n $params = $this->types();\n return isset($params[$this->type]) ? $params[$this->type] : '';\n }",
"public function getType() : string\n {\n $rtn = $this->data['type'];\n\n return $rtn;\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 getType() :string\n {\n return $this->types[$this->type];\n }",
"abstract protected function get_typestring();",
"public function type(): string\n {\n return $this->type;\n }",
"public function type(): string\n {\n return $this->type;\n }",
"public function __toString()\n {\n if (empty($this->types)) {\n return TypeHint::NULL_TYPE;\n }\n\n return join(TypeHint::TYPE_SEPARATOR, array_map(function (Type $type) {\n return (string)$type;\n }, $this->types));\n }",
"public function getType() : string\n {\n return $this->type;\n }",
"public function getType() : string\n {\n return $this->type;\n }",
"public function getType() : string\n {\n return $this->type;\n }",
"public function getType() : string {\n return $this->type;\n }",
"public function getType(): string\n {\n return ucfirst($this->type);\n }",
"public function __toString() {\n\t\treturn __CLASS__ . '(' . $this->type . ')';\n\t}",
"public function getType(): string\n {\n return self::TYPE_STRING;\n }",
"public function getType(): string\n {\n return self::TYPE_STRING;\n }",
"public function getTypeDesc(){\n $type = $this->type;\n $arr = self::getTypeDescArr();\n return $arr[$type] ?? \"\";\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function getType(): string\n {\n return $this->type;\n }",
"public function get_type_name() { \n\n\t\tswitch ($this->type) { \n\t\t\tcase 'xml-rpc': \n\t\t\tcase 'rpc':\n\t\t\t\treturn _('API/RPC');\n\t\t\tbreak;\n\t\t\tcase 'network':\n\t\t\t\treturn _('Local Network Definition');\n\t\t\tbreak;\n\t\t\tcase 'interface':\n\t\t\t\treturn _('Web Interface');\n\t\t\tbreak;\n\t\t\tcase 'stream':\n\t\t\tdefault: \n\t\t\t\treturn _('Stream Access');\n\t\t\tbreak;\n\t\t} // end switch\n\n\t}",
"public function getType() {\n return $this->field['type'] ?? '';\n }",
"public function getTypeLabel(){\r\n\t\t$ret = \" \";\r\n\t\tswitch ($this->type){\r\n\t\t\tcase 0 : $ret = $_LANG->get('Artikel'); break;\r\n\t\t\tcase 1 : $ret = $_LANG->get('Produkt'); break;\r\n\t\t\tcase 2 : $ret = $_LANG->get('Personalisierung'); break;\r\n\t\t\tdefault: $ret = \"n.A.\";\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}",
"public function type(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"protected function getType(): string\n {\n return join('|', $this->types);\n }",
"public function get_type(): string;",
"public function getType() : string{\n return $this->type;\n }",
"public function get_type(): string {\n\t\treturn $this->type;\n\t}",
"public static function getType(): string\n {\n return self::TYPE;\n }",
"public function getType():string { return $this->type; }",
"public function getType(): string {\n return $this->type;\n }",
"public function getTypeText()\n\t{\n\t\treturn Menus::getMenuTypeName($this->owner->type);\n\t}",
"public function toString(): string\n {\n return $this->type->typeName() . '=' . $this->value->rfc2253String();\n }",
"protected function get_formatted_type()\n\t{\n\t\t$rc = '';\n\n\t\t$type = $this->type;\n\t\t$size = $this->size;\n\n\t\tif (!$size && $type == self::TYPE_VARCHAR)\n\t\t{\n\t\t\t$size = 255;\n\t\t}\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase self::TYPE_INTEGER:\n\t\t\tcase self::TYPE_TEXT:\n\t\t\tcase self::TYPE_BLOB:\n\n\t\t\t\t$t = [\n\n\t\t\t\t\tself::TYPE_BLOB => 'BLOB',\n\t\t\t\t\tself::TYPE_INTEGER => 'INT',\n\t\t\t\t\tself::TYPE_TEXT => 'TEXT',\n\n\t\t\t\t][ $type ];\n\n\t\t\t\tif (\\is_numeric($size))\n\t\t\t\t{\n\t\t\t\t\t$rc .= \"$t( $size )\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($size) . $t;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tif ($size)\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($type) . \"( $size )\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$rc .= \\strtoupper($type);\n\t\t\t\t}\n\t\t}\n\n\t\treturn $rc;\n\t}",
"public function __toString(): string\n {\n return $this->fullTypeString;\n }",
"public function getType()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'type'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'type'];\n\t\t}\n\t}",
"public function getType():string {\n\t\t\treturn $this->type;\n\t\t}",
"public function getType(): string {\n return $this->type;\n }",
"private function getTypeDescription()\n {\n switch($this->_type)\n {\n case 'Mountain':\n return \"Mountains are peaceful places. Your ships don't do any damage here, while your tanks will do 10% less damage. Flying weapons (airplanes and helicopters) do normal damage.\" . PHP_EOL;\n case 'Water':\n return \"Water is what you drink. It's also the place where your tanks will be completely useless, but your ships will do 1000% more damage. o7\" . PHP_EOL;\n case 'Open land':\n return \"Who doesn't like the smell of grass in the morning, with a hint of blood from your enemy? Your tanks will do 1000% more damage here, while ships will do none. Good luck!\" . PHP_EOL;\n case 'Woods':\n return \"All you can do is hide, and sometimes it's the best option. Your tanks will do 40% less damage, your ships wont do any damage at all, your air vehicles will do 10% more, and your foot soldiers will do 30% more, so use them wisely. This is your chance, fella!\" . PHP_EOL;\n }\n }",
"public function getRawType(): string\n {\n return $this->rawType;\n }",
"public function getTypeString()\n {\n switch ( $this->fileStructure->type )\n {\n case self::IS_DIRECTORY:\n return \"d\";\n\n case self::IS_FILE:\n return \"-\";\n\n case self::IS_SYMBOLIC_LINK:\n return \"l\";\n\n case self::IS_LINK:\n return \"h\";\n\n default:\n return \"Z\";\n }\n }",
"public function GetTypeDesc(): string {\n\t\tswitch($this->debugType) {\n\t\t\tcase self::NONE: \treturn \"NONE\";\n\t\t\tcase self::LOG: \treturn \"LOG\";\n\t\t\tcase self::DEBUG:\treturn \"DEBUG\";\n\t\t\tcase self::DEV:\t\treturn \"DEV\";\n\t\t\tdefault: \t\t\t\t\treturn \"unknown\";\n\t\t}\n\t}",
"public static function typeToString($type)\n\t{\n\t\tswitch($type)\n\t\t{\n\t\t\tcase self::EOF:\n\t\t\t\treturn 'EOF';\n\t\t\t\tbreak;\n\n\t\t\tcase self::TEXT:\n\t\t\t\treturn 'TEXT';\n\t\t\t\tbreak;\n\n\t\t\tcase self::BLOCK_START:\n\t\t\t\treturn 'BLOCK_START';\n\t\t\t\tbreak;\n\n\t\t\tcase self::BLOCK_END:\n\t\t\t\treturn 'BLOCK_END';\n\t\t\t\tbreak;\n\n\t\t\tcase self::VAR_START:\n\t\t\t\treturn 'VAR_START';\n\t\t\t\tbreak;\n\n\t\t\tcase self::VAR_END:\n\t\t\t\treturn 'VAR_END';\n\t\t\t\tbreak;\n\n\t\t\tcase self::NAME:\n\t\t\t\treturn 'NAME';\n\t\t\t\tbreak;\n\n\t\t\tcase self::NUMBER:\n\t\t\t\treturn 'NUMBER';\n\t\t\t\tbreak;\n\n\t\t\tcase self::STRING:\n\t\t\t\treturn 'STRING';\n\t\t\t\tbreak;\n\n\t\t\tcase self::OPERATOR:\n\t\t\t\treturn 'OPERATOR';\n\t\t\t\tbreak;\n\n\t\t\tcase self::PUNCTUATION:\n\t\t\t\treturn 'PUNCTUATION';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Exception(sprintf('There is no token type \"%s\"', $type));\n\t\t}\n\t}",
"public static function typeToString(int $type): string {\n return self::$_names[$type];\n }",
"function getType(): string;",
"function getType(): string;",
"public function getType() : string;",
"public function __toString(): string\n {\n $type = static::class;\n $position = strrpos($type, '\\\\');\n\n if ($position !== false) {\n $type = substr($type, $position);\n }\n\n return str_replace('Type', '', $type);\n }",
"public function __toString()\n {\n $types = $this->types;\n\n if (count($this->types) === 1) {\n return array_pop($types);\n } else {\n $nullIndex = array_search('null', $types);\n if ($nullIndex !== false) {\n unset($types[$nullIndex]);\n return array_pop($types);\n }\n }\n\n return '';\n }",
"public function getTypeDesc () {\n return self::$typeMap[$this->type];\n }",
"public function getType()\n {\n return (string) $this->getTypesCollection();\n }",
"public function getTypeAsStr() {\n\t\t$cardtypes = array(\n\t\t\t\"race\" => 1,\n\t\t\t\"aspect\" => 2,\n\t\t\t\"power\" => 3,\n\t\t\t\"minion\" => 10,\n\t\t\t\"bane\" => 20\n\t\t);\n\t\tforeach($cardtypes as $typestr => $typeval) {\n\t\t\tif($this->cardType == $typeval) {\n\t\t\t\treturn $typestr;\n\t\t\t}\n\t\t}\n\t}",
"public function get_type_label() {\n\t\t$strings = astoundify_contentimporter_get_string( $this->get_type(), 'type_labels' );\n\t\treturn esc_attr( $strings[0] );\n\t}",
"public function getTYPE_TEXT()\n {\n return self::TYPE_TEXT;\n }",
"public function getTypeLabel()\n {\n $array = self::getTypeOptions();\n return $array[$this->type];\n }",
"public function type(): string\n {\n return $this->item['type'];\n }",
"public function getType(): string\n {\n }",
"public function getTypeNameWithFlags(): string\n {\n if ($this->exists() && $this->Type()->exists()) {\n $type = $this->Type();\n $title = $type->Name;\n\n return $title\n . ' ('\n . ($type->SingleSelect ? 'Single' : 'Multi')\n . ($type->InternalOnly ? '; Internal only' : '; Public')\n . ')';\n }\n\n return '';\n }",
"public function type() : string;",
"public function getDescription() {\n return self::getDescriptionType($this->_type);\n }",
"public function getTypeText()\n {\n return ($this->isPending() ? 'Key Request' : 'Key');\n }",
"private static function typeToString($type)\n {\n if ($type instanceof Schema) {\n return $type->toArray();\n }\n\n if ($type instanceof NumberType) {\n return 'number';\n }\n\n if ($type instanceof BooleanType) {\n return 'boolean';\n }\n\n if ($type instanceof StringType) {\n return 'string';\n }\n\n return null;\n }",
"public function getDisplayTypeName()\n {\n $type = static::TYPE;\n\n if ($this instanceof StructureItem) {\n $type = $this->structure->getStructureName();\n }\n\n if ($this->isArray) {\n return $type . '[]';\n }\n\n if ($this->isFixedValues) {\n return '{' . implode(', ', $this->validValues) . '}';\n }\n\n return $type;\n }",
"protected function dumpToString()\n {\n if ($this->_type == self::NODE_ROOT) {\n return 'root';\n }\n return (string)$this->_type;\n }",
"public function getType()\n {\n $rtn = $this->data['type'];\n\n return $rtn;\n }",
"public static function getTypeDescription(): string\n {\n $class = get_called_class()::SHAPE_TYPE;\n return <<<EOF\nType: $class\nEOF;\n }",
"public function typesAsString()\n {\n return implode(',', array_keys(self::DOCUMENT_TYPES));\n }",
"public function name() {\n\t\t\treturn $this->_name . ' ('.self::$type_name[$this->_type].')';\n\t\t}",
"public function get_type();",
"function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}",
"public function getType()\n\t{\n\t\treturn $this->getObject('type', null, 'type');\n\t}",
"public function getType()\n {\n return $this->getEntityValue('type', '');\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }",
"public function getType()\n {\n return $this->get(self::_TYPE);\n }"
] | [
"0.7935685",
"0.7934859",
"0.7860343",
"0.78304315",
"0.74473387",
"0.7297825",
"0.72775054",
"0.72467786",
"0.72267425",
"0.72267425",
"0.72253203",
"0.719396",
"0.719396",
"0.719396",
"0.7131777",
"0.7112696",
"0.71093065",
"0.70767015",
"0.70767015",
"0.7065634",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70267427",
"0.70067537",
"0.6991645",
"0.69899887",
"0.698005",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6967108",
"0.6961605",
"0.69587064",
"0.69363654",
"0.69299954",
"0.6925849",
"0.69205683",
"0.69140196",
"0.6905206",
"0.6881361",
"0.6870316",
"0.68495876",
"0.68472815",
"0.68239576",
"0.6821963",
"0.68205357",
"0.68130016",
"0.6798069",
"0.67772174",
"0.67493916",
"0.6747696",
"0.67433083",
"0.67433083",
"0.67292804",
"0.672329",
"0.6716448",
"0.67099154",
"0.66872096",
"0.6683323",
"0.66655916",
"0.6657609",
"0.6656745",
"0.6643647",
"0.6635206",
"0.6634832",
"0.6625063",
"0.66160107",
"0.66120505",
"0.66075116",
"0.6584126",
"0.6573995",
"0.6573252",
"0.65699303",
"0.6563785",
"0.6538876",
"0.65209746",
"0.65169924",
"0.6485918",
"0.6483835",
"0.648243",
"0.648243",
"0.648243",
"0.648243",
"0.648243"
] | 0.6704878 | 73 |
Run the database seeds. | public function run()
{
// $site_us = new Locale_site();
// $site_us->id = 1;
// $site_us->locale = 'en';
// $site_us->guid_title = 'Rock climbing In Georgia';
// $site_us->guid_description = 'Rock climbing in Georgia is a developing sport, but the country has a great prospect in rock climbing and in mountaineering. We constantly collect information about promising rocks, we am happy to accept your messages about new and unknown places.
// There are many ready-made regions for all kinds of climbing. Also there are many places to implement and establish new climbing routes and regions, so it is very attractive for those who are searching for new unique places and opportunities.
// If you need any additional information feel free to contact us. We will provide you with all essential details, suggest a concrete way how to get to the site of climbing or offer his services for equipment and take you to the rock climbing areas.
// Alse if you need a climbing guide you can contact us. We can accompany you to any mountaineering and rock climbing regions throughout Georgia. Tour prices depend on the complexity of the route and the size of the group. Write to us for more details. Celk here for write message.
// We are constantly updating information about all regions so that you get full information.
// Information partners. climbingingeorgia.wordpress.com
// See information about climbing areas in neighboring countries.
// Climbing in Armenia - uptherock.com
// Climbing in Turkey - climbing-europe.com/RockClimbingTurkey';
// $site_us->guid_short_description = 'Rock climbing and mountaineering in Georgia';
// $site_us->films_title = 'Rock climbing films';
// $site_us->films_description = 'Climbing movies';
// $site_us->films_short_description = 'Climbing movies';
// $site_us->forum_title = 'Georgian Climbing forum';
// $site_us->forum_description = 'Georgian climbing forum';
// $site_us->forum_short_description = 'Georgian climbing forum';
// $site_us->shop_title = 'Climbing.ge products and services';
// $site_us->shop_description = 'Climbing.ge products';
// $site_us->shop_short_description = 'Climbing.ge products';
// $site_us->other_activity_description = 'Other activity for active rest in Georgia';
// $site_us->mount_description = 'Mountaineering in Georgia';
// $site_us->outdoor_description = 'Outdoor rock climbing area in Georgia';
// $site_us->event_description = 'event_description';
// $site_us->tech_tips_description = 'Climbing tech tips';
// $site_us->news_description = 'Georgian climbing news';
// $site_us->index_gallery_description = 'Gallery';
// $site_us->indoor_description = 'Indoor climbing gyms in Georgia';
// $site_us->ice_description = 'Ice climbing in Georgia';
// $site_us->topo_description = 'Climbing topo';
// $site_us->what_we_do_description = 'Georgia rock climbing and mountaineering description';
// $site_us->products_description = 'Climbing.ge products';
// $site_us->services_description = 'Climbing.ge services';
// // $site_us->save();
// $site_ka = new Locale_site();
// $site_ka->id = 2;
// $site_ka->locale = 'ka';
// $site_ka->guid_title_ka = 'მეკლდეურობა საქართველოში';
// $site_ka->guid_description_ka = 'სერვისი climbing.ge, არის საინფორმაციო საიტი, რომელიც მიზნად ისახავს საქართველოს საცოცი და ალპინისტური მარშრუტების დეტალურ აღწერას და ამ იმფორმაციის მეტად პოპულარიზაციას, რათა ეს იმფორმაცია იყოს მეტად ხელმისაწვდომი, როგორც საქართველოს მოსახლეობისთვის, ასევე სხვა ქვეყნიდან ჩამოსული სპორცმენებისთვის. ჩვენი გუნდი მუდმივად მუსაობს ოიმისთვის, რომ იმფორმაცია ხშირად განახლდეს, დაემატოს მეტი სიახლე და ყველა საცოცი რეგიონი თუ ალპინისტური მარშრუტი იყოს რაც შეიძლება დეტალურად აღწერილი.
// საქართველოში მეკლდეურობა და სპორტული ცოცვა ჯერჯერობით არ არის განვითარებული სათანადო დონეზე, მაგრამ ჩვენ მუდამ ვცდილობთ ვიპოვოთ და შევქმნათ თქვენთვის საინტერესო საცოცი რეგიონები. აღმოვაჩინოთ ახალი, საცოცად გამოსადეგი კლდეები და ამ ადგილებში რაც შეიძლება მეტი საცოცი მარშრუტი გავაკეთოთ . სამწუხაროდ ჯერჯერობით ყვეკაფერი ეს ჩვენი პირადი ხარჯებით ხორციელდება, ამიტომაც ეს ყველაფერი საკმაოდ ნელი ტემპებით მიმდინარეობს. ჩვენ მუდმივად მზად ვართ პარტნიორობისთის, რათა სპორტის ეს სახეობა უფრო მეტად განვითარდეს. ჩვენ მოხარულები ვიქნებით ყველა ტიპის დახმარებისთვის, იქნება ეს ფინანსური, ტექნიკური თუ გამოცდილების გაზიარება.
// ასევე ჩვენს საიტზე თქვენ შეგიძლიათ იხილოთ ალპინისტური მარშრუტების არწერაც. საქართველოს უდიდესი ნაწილი მტებითაა დაფარული. აქ არის ბევრი ულამაზესი და ტექნიკურად რთული მწვერვალი. როგორიცაა: უშბა, ტეთნულდი, შხარა, მყინვარი, ჭაუხის მასივი და ბევრი სხვა. ამ მთებზე არის ბევრი მარშრუტი . სამწუხაროდ ეს მარშრუტები არ არის აღწერილი. ჩვენ ვცდილობთ შევაგროვოთ და ავღწეროთ ჩვენი თუ სხვის მიერ გავლილი მარშრუტები. თუ თქვენ გაქვთ იმფორმაცია და რომელიმე მარშრუტის აღწერა, თქვენ შეგიძლიათ გამოგვიგზავნოთ ის. ეს ჩვენ ძალიან დაგვეხმარება.
// თუ თქვენ დაგწირდათ დამატებითი იმფორმაცია ან თქვენ გინდათ გიდის აყვანა საქართველოს ნებისმიერ რეგიონში, მოგვწერეთ ქვემოთ მოყვანილი ფორმის მეშვეობით. ჩვენ მალე გიპასუხებთ
// Climbing.ge - ის გუნდი ყველას კარ ცოცვას და ვარჯიშს გისურვებთ.';
// $site_ka->guid_short_description_ka = 'საქართველოს საცოცი სეკტორების და ალპინისტური მარშრუტების აღწერა';
// $site_ka->films_title_ka = 'ცოცვის ფილმები';
// $site_ka->films_description_ka = 'ცოცვის ფილმები';
// $site_ka->films_short_description_ka = 'ცოცვის ფილმები';
// $site_ka->forum_title_ka = 'ქართული ცოცვის ფორუმი';
// $site_ka->forum_description_ka = 'ქართული ცოცვის ფორუმი';
// $site_ka->forum_short_description_ka = 'ქართული ცოცვის ფორუმი';
// $site_ka->shop_title_ka = 'Climbing.ge-ს საქონელი და მომსახურება';
// $site_ka->shop_description_ka = 'საცოცი პროდუკტები წარმოებული ჩვენი კომპანიის მიერ';
// $site_ka->shop_short_description_ka = 'საცოცი პროდუკტები წარმოებული ჩვენი კომპანიის მიერ';
// $site_ka->other_activity_description_ka = 'სხვა აკტიობები';
// $site_ka->mount_description_ka = 'ალპინისტური მარშრუტები საქართველოში(კავკასიონის ქედი)';
// $site_ka->outdoor_description_ka = 'ცოცვა ბუნებრივ კლდეზე';
// $site_ka->event_description_ka = 'ცოცვა ბუნებრივ კლდეზე';
// $site_ka->tech_tips_description_ka = 'ცოცვის ტექნიკური რჩევები';
// $site_ka->news_description_ka = 'ცოცვის სიახლეები საქართველოშე';
// $site_ka->index_gallery_description_ka = 'გალერეა';
// $site_ka->indoor_description_ka = 'საცოცი დარბაზები';
// $site_ka->ice_description_ka = 'ყინულზე ცოცვა';
// $site_ka->topo_description_ka = 'საქართველოს საცოცი მარშრუტები რუკაზე';
// $site_ka->what_we_do_description_ka = 'საქართველოს საცოცი სეკტორების და ალპინისტური მარშრუტების აღწერა';
// $site_ka->products_description_ka = 'Climbing.ge-ს პროდუქცია';
// $site_ka->services_description_ka = 'Climbing.ge-ს მომსახურება';
// // $site_ka->save();
// $site_ru = new Locale_site();
// $site_ru->id = 3;
// $site_ru->locale = 'ru';
// $site_ru->guid_title_ru = 'Скалолазание в Грузии';
// $site_ru->guid_description_ru = 'Сервис Climbing.ge – это информационный сайт цель которого детальное описание альпинистких и скалолазных маршрутов в Грузии, и эту информацию сделать более доступной как для населения Грузии так и для спортсменов приезжающих из других стран.
// Наша команда постоянно работает над обновлением информации и добавляет детальное описание во все скалолазные регионы и альпинсткие маршруты. Старается описать всё как можно подробнее.
// В Грузии спортивное лазание и скалолазание в настоящее время не развито на должном уровне и недостаточно развито по регионам. Мы постоянно стараемся найти и создать для вас интересные маршруты для лазания и разрабатываем новые регионы, стараемся обнаружить новые, пригодные для лазания, скалы и в этом месте создать как можно больше маршрутов для скалолазания.
// К сожалению, пока что, это всё происходит на наши личные средства и поэтому процесс разработки новых трасс и регионов продвигается в медленном темпе .Мы готовы к партнёрству и сотрудничеству для развития данного вида спорта. Мы будем рады помощи любого типа, будь то финансовая, техническая помощь или если вы поделитесь с нами вашим опытом.
// Также на нашем сайте вы можете найти описание альпинистких маршрутов. Большая часть Грузии покрыта горами .Здесь есть красивейшие и технически сложные вершины , такие как: Ушба, Шхара, Казбег, Чаухский массив и многое другое. На склонах этих гор множество маршрутов. К сожалению эти маршруты не описаны. Мы старались собрать и описать пройденные нами или другими альпинистами маршруты. Если у вас есть информация и описание какого-либо маршрута, вы можете прислать эту информацию нам. Нам поможет эта информация в работе.
// Если вам понадобится дополнительная информация или вам необходимо взять гида для любого региона Грузии, напишите нам ,внизу дана форма и мы ответим вам очень быстро,
// CLIMBING.GE- желает вам хороших восхождений и тренировок.';
// $site_ru->guid_short_description_ru = 'Скалолазание и альпинизм в Грузии';
// $site_ru->films_title_ru = 'Фильмы о скалолазании';
// $site_ru->films_description_ru = 'Фильмы о скалолазании';
// $site_ru->films_short_description_ru = 'Фильмы о скалолазании';
// $site_ru->forum_title_ru = 'Форум скалолазание Грузии';
// $site_ru->forum_description_ru = 'Форум скалолазание Грузии';
// $site_ru->forum_short_description_ru = 'Форум скалолазание Грузии';
// $site_ru->shop_title_ru = 'Товары и услуги Climbing.ge';
// $site_ru->shop_description_ru = 'Climbing.ge продукты';
// $site_ru->shop_short_description_ru = 'Climbing.ge продукты';
// $site_ru->other_activity_description_ru = 'Другая деятельность для активного отдыха в Грузии';
// $site_ru->mount_description_ru = 'Альпинизм в Грузии';
// $site_ru->outdoor_description_ru = 'Скалолазание на открытом воздухе в Грузии';
// $site_ru->event_description_ru = 'Скалолазание на открытом воздухе в Грузии';
// $site_ru->tech_tips_description_ru = 'Советы по альпинизму';
// $site_ru->news_description_ru = 'Новости скалолазания в Грузинского ';
// $site_ru->index_gallery_description_ru = 'Галерея';
// $site_ru->indoor_description_ru = 'Скалолазные залы в грузии';
// $site_ru->ice_description_ru = 'Ледолазание в Грузии';
// $site_ru->topo_description_ru = 'Восхождение на вершину';
// $site_ru->what_we_do_description_ru = 'Описание скалолазания и альпинизма в Грузии';
// $site_ru->products_description_ru = 'Продукция Climbing.ge';
// $site_ru->services_description_ru = 'Услуги Climbing.ge';
// $site_ru->save();
DB::table('locale_sites')->insert([
[
'id' => 1,
'locale' => 'us',
'guid_title' => 'Rock climbing In Georgia',
'guid_description' => 'Rock climbing in Georgia is a developing sport, but the country has a great prospect in rock climbing and in mountaineering. We constantly collect information about promising rocks, we am happy to accept your messages about new and unknown places.
There are many ready-made regions for all kinds of climbing. Also there are many places to implement and establish new climbing routes and regions, so it is very attractive for those who are searching for new unique places and opportunities.
If you need any additional information feel free to contact us. We will provide you with all essential details, suggest a concrete way how to get to the site of climbing or offer his services for equipment and take you to the rock climbing areas.
Alse if you need a climbing guide you can contact us. We can accompany you to any mountaineering and rock climbing regions throughout Georgia. Tour prices depend on the complexity of the route and the size of the group. Write to us for more details. Celk here for write message.
We are constantly updating information about all regions so that you get full information.
Information partners. climbingingeorgia.wordpress.com
See information about climbing areas in neighboring countries.
Climbing in Armenia - uptherock.com
Climbing in Turkey - climbing-europe.com/RockClimbingTurkey',
'guid_short_description' => 'Rock climbing and mountaineering in Georgia',
'films_title' => 'Rock climbing films',
'films_description' => 'Climbing movies',
'films_short_description' => 'Climbing movies',
'forum_title' => 'Georgian Climbing forum',
'forum_description' => 'Georgian climbing forum',
'forum_short_description' => 'Georgian climbing forum',
'shop_title' => 'Climbing.ge products and services',
'shop_description' => 'Climbing.ge products',
'shop_short_description' => 'Climbing.ge products',
'other_activity_description' => 'Other activity for active rest in Georgia',
'mount_description' => 'Mountaineering in Georgia',
'outdoor_description' => 'Outdoor rock climbing area in Georgia',
'event_description' => 'event_description',
'tech_tips_description' => 'Climbing tech tips',
'news_description' => 'Georgian climbing news',
'index_gallery_description' => 'Gallery',
'indoor_description' => 'Indoor climbing gyms in Georgia',
'ice_description' => 'Ice climbing in Georgia',
'topo_description' => 'Climbing topo',
'what_we_do_description' => 'Georgia rock climbing and mountaineering description',
'products_description' => 'Climbing.ge products',
'services_description' => 'Climbing.ge services',
],
[
'id' => 2,
'locale' => 'ka',
'guid_title_ka' => 'მეკლდეურობა საქართველოში',
'guid_description_ka' => 'სერვისი climbing.ge, არის საინფორმაციო საიტი, რომელიც მიზნად ისახავს საქართველოს საცოცი და ალპინისტური მარშრუტების დეტალურ აღწერას და ამ იმფორმაციის მეტად პოპულარიზაციას, რათა ეს იმფორმაცია იყოს მეტად ხელმისაწვდომი, როგორც საქართველოს მოსახლეობისთვის, ასევე სხვა ქვეყნიდან ჩამოსული სპორცმენებისთვის. ჩვენი გუნდი მუდმივად მუსაობს ოიმისთვის, რომ იმფორმაცია ხშირად განახლდეს, დაემატოს მეტი სიახლე და ყველა საცოცი რეგიონი თუ ალპინისტური მარშრუტი იყოს რაც შეიძლება დეტალურად აღწერილი.,
საქართველოში მეკლდეურობა და სპორტული ცოცვა ჯერჯერობით არ არის განვითარებული სათანადო დონეზე, მაგრამ ჩვენ მუდამ ვცდილობთ ვიპოვოთ და შევქმნათ თქვენთვის საინტერესო საცოცი რეგიონები. აღმოვაჩინოთ ახალი, საცოცად გამოსადეგი კლდეები და ამ ადგილებში რაც შეიძლება მეტი საცოცი მარშრუტი გავაკეთოთ . სამწუხაროდ ჯერჯერობით ყვეკაფერი ეს ჩვენი პირადი ხარჯებით ხორციელდება, ამიტომაც ეს ყველაფერი საკმაოდ ნელი ტემპებით მიმდინარეობს. ჩვენ მუდმივად მზად ვართ პარტნიორობისთის, რათა სპორტის ეს სახეობა უფრო მეტად განვითარდეს. ჩვენ მოხარულები ვიქნებით ყველა ტიპის დახმარებისთვის, იქნება ეს ფინანსური, ტექნიკური თუ გამოცდილების გაზიარება.
ასევე ჩვენს საიტზე თქვენ შეგიძლიათ იხილოთ ალპინისტური მარშრუტების არწერაც. საქართველოს უდიდესი ნაწილი მტებითაა დაფარული. აქ არის ბევრი ულამაზესი და ტექნიკურად რთული მწვერვალი. როგორიცაა: უშბა, ტეთნულდი, შხარა, მყინვარი, ჭაუხის მასივი და ბევრი სხვა. ამ მთებზე არის ბევრი მარშრუტი . სამწუხაროდ ეს მარშრუტები არ არის აღწერილი. ჩვენ ვცდილობთ შევაგროვოთ და ავღწეროთ ჩვენი თუ სხვის მიერ გავლილი მარშრუტები. თუ თქვენ გაქვთ იმფორმაცია და რომელიმე მარშრუტის აღწერა, თქვენ შეგიძლიათ გამოგვიგზავნოთ ის. ეს ჩვენ ძალიან დაგვეხმარება.
თუ თქვენ დაგწირდათ დამატებითი იმფორმაცია ან თქვენ გინდათ გიდის აყვანა საქართველოს ნებისმიერ რეგიონში, მოგვწერეთ ქვემოთ მოყვანილი ფორმის მეშვეობით. ჩვენ მალე გიპასუხებთ
Climbing.ge - ის გუნდი ყველას კარ ცოცვას და ვარჯიშს გისურვებთ.',
'guid_short_description_ka' => 'საქართველოს საცოცი სეკტორების და ალპინისტური მარშრუტების აღწერა',
'films_title_ka' => 'ცოცვის ფილმები',
'films_description_ka' => 'ცოცვის ფილმები',
'films_short_description_ka' => 'ცოცვის ფილმები',
'forum_title_ka' => 'ქართული ცოცვის ფორუმი',
'forum_description_ka' => 'ქართული ცოცვის ფორუმი',
'forum_short_description_ka' => 'ქართული ცოცვის ფორუმი',
'shop_title_ka' => 'Climbing.ge-ს საქონელი და მომსახურება',
'shop_description_ka' => 'საცოცი პროდუკტები წარმოებული ჩვენი კომპანიის მიერ',
'shop_short_description_ka' => 'საცოცი პროდუკტები წარმოებული ჩვენი კომპანიის მიერ',
'other_activity_description_ka' => 'სხვა აკტიობები',
'mount_description_ka' => 'ალპინისტური მარშრუტები საქართველოში(კავკასიონის ქედი)',
'outdoor_description_ka' => 'ცოცვა ბუნებრივ კლდეზე',
'event_description_ka' => 'ცოცვა ბუნებრივ კლდეზე',
'tech_tips_description_ka' => 'ცოცვის ტექნიკური რჩევები',
'news_description_ka' => 'ცოცვის სიახლეები საქართველოშე',
'index_gallery_description_ka' => 'გალერეა',
'indoor_description_ka' => 'საცოცი დარბაზები',
'ice_description_ka' => 'ყინულზე ცოცვა',
'topo_description_ka' => 'საქართველოს საცოცი მარშრუტები რუკაზე',
'what_we_do_description_ka' => 'საქართველოს საცოცი სეკტორების და ალპინისტური მარშრუტების აღწერა',
'products_description_ka' => 'Climbing.ge-ს პროდუქცია',
'services_description_ka' => 'Climbing.ge-ს მომსახურება',
],
[
'id' => 3,
'locale' => 'ru',
'guid_title_ru' => 'Скалолазание в Грузии',
'guid_description_ru' => 'Сервис Climbing.ge – это информационный сайт цель которого детальное описание альпинистких и скалолазных маршрутов в Грузии, и эту информацию сделать более доступной как для населения Грузии так и для спортсменов приезжающих из других стран,
Наша команда постоянно работает над обновлением информации и добавляет детальное описание во все скалолазные регионы и альпинсткие маршруты. Старается описать всё как можно подробнее.
В Грузии спортивное лазание и скалолазание в настоящее время не развито на должном уровне и недостаточно развито по регионам. Мы постоянно стараемся найти и создать для вас интересные маршруты для лазания и разрабатываем новые регионы, стараемся обнаружить новые, пригодные для лазания, скалы и в этом месте создать как можно больше маршрутов для скалолазания.
К сожалению, пока что, это всё происходит на наши личные средства и поэтому процесс разработки новых трасс и регионов продвигается в медленном темпе .Мы готовы к партнёрству и сотрудничеству для развития данного вида спорта. Мы будем рады помощи любого типа, будь то финансовая, техническая помощь или если вы поделитесь с нами вашим опытом.
Также на нашем сайте вы можете найти описание альпинистких маршрутов. Большая часть Грузии покрыта горами .Здесь есть красивейшие и технически сложные вершины , такие как: Ушба, Шхара, Казбег, Чаухский массив и многое другое. На склонах этих гор множество маршрутов. К сожалению эти маршруты не описаны. Мы старались собрать и описать пройденные нами или другими альпинистами маршруты. Если у вас есть информация и описание какого-либо маршрута, вы можете прислать эту информацию нам. Нам поможет эта информация в работе.
Если вам понадобится дополнительная информация или вам необходимо взять гида для любого региона Грузии, напишите нам ,внизу дана форма и мы ответим вам очень быстро,
CLIMBING.GE- желает вам хороших восхождений и тренировок.',
'guid_short_description_ru' => 'Скалолазание и альпинизм в Грузии',
'films_title_ru' => 'Фильмы о скалолазании',
'films_description_ru' => 'Фильмы о скалолазании',
'films_short_description_ru' => 'Фильмы о скалолазании',
'forum_title_ru' => 'Форум скалолазание Грузии',
'forum_description_ru' => 'Форум скалолазание Грузии',
'forum_short_description_ru' => 'Форум скалолазание Грузии',
'shop_title_ru' => 'Товары и услуги Climbing.ge',
'shop_description_ru' => 'Climbing.ge продукты',
'shop_short_description_ru' => 'Climbing.ge продукты',
'other_activity_description_ru' => 'Другая деятельность для активного отдыха в Грузии',
'mount_description_ru' => 'Альпинизм в Грузии',
'outdoor_description_ru' => 'Скалолазание на открытом воздухе в Грузии',
'event_description_ru' => 'Скалолазание на открытом воздухе в Грузии',
'tech_tips_description_ru' => 'Советы по альпинизму',
'news_description_ru' => 'Новости скалолазания в Грузинского ',
'index_gallery_description_ru' => 'Галерея',
'indoor_description_ru' => 'Скалолазные залы в грузии',
'ice_description_ru' => 'Ледолазание в Грузии',
'topo_description_ru' => 'Восхождение на вершину',
'what_we_do_description_ru' => 'Описание скалолазания и альпинизма в Грузии',
'products_description_ru' => 'Продукция Climbing.ge',
'services_description_ru' => 'Услуги Climbing.ge',
],
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }",
"public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }",
"public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }",
"public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }",
"public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }",
"public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }",
"public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}",
"public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }",
"public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }",
"public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }",
"public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }",
"public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }",
"public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }",
"public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}",
"public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }",
"public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }",
"public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }",
"public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }",
"public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }",
"public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }",
"public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }",
"public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}",
"public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }",
"public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }",
"public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }"
] | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.7841468",
"0.7834583",
"0.7827792",
"0.7819104",
"0.78088796",
"0.7802872",
"0.7802348",
"0.78006834",
"0.77989215",
"0.7795819",
"0.77903426",
"0.77884805",
"0.77862066",
"0.7778816",
"0.7777486",
"0.7765202",
"0.7762492",
"0.77623445",
"0.77621746",
"0.7761383",
"0.77606887",
"0.77596676",
"0.7757001",
"0.7753607",
"0.7749522",
"0.7749292",
"0.77466977",
"0.7729947",
"0.77289546",
"0.772796",
"0.77167094",
"0.7714503",
"0.77140456",
"0.77132195",
"0.771243",
"0.77122366",
"0.7711113",
"0.77109736",
"0.7710777",
"0.7710086",
"0.7705484",
"0.770464",
"0.7704354",
"0.7704061",
"0.77027386",
"0.77020216",
"0.77008796",
"0.7698617",
"0.76985973",
"0.76973504",
"0.7696405",
"0.7694293",
"0.7692694",
"0.7691264",
"0.7690576",
"0.76882726",
"0.7687433",
"0.7686844",
"0.7686498",
"0.7685065",
"0.7683827",
"0.7679184",
"0.7678287",
"0.76776296",
"0.76767945",
"0.76726556",
"0.76708084",
"0.76690495",
"0.766872",
"0.76686716",
"0.7666299",
"0.76625943",
"0.7662227",
"0.76613766",
"0.7659881",
"0.7656644",
"0.76539344",
"0.76535016",
"0.7652375",
"0.7652313",
"0.7652022"
] | 0.0 | -1 |
Get the login form | public function getLoginForm()
{
if (is_null($this->_form)) {
$this->_form = new \Foundation\Form;
$this->_form->setCSRFToken($this->_controller->getCSRFToken());
$this->_form->setAction($this->_controller->path("login"));
$field = $this->_form->newField();
$field->setLegend('Select a user');
$element = $field->newElement('TextInput', 'apiKey');
$element->setLabel('API Key');
$element->addValidator(new \Foundation\Form\Validator\NotEmpty($element));
$this->_form->newButton('submit', 'Login');
}
return $this->_form;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLoginForm();",
"public function getFormLoginPage();",
"public function get_login_form() {\n $this->do_login_form();\n return $this->c_arr_login_form;\n }",
"public function getLoginForm() {\n\t\tif($this->loginForm) return $this->loginForm;\n\t\t//si no entonces se inicializa y se retorna\n\t\treturn $this->setLoginForm()->getLoginForm();\n\t}",
"public function getLoginForm()\n {\n return '//form[@id=\"loginForm\"]';\n }",
"public function getLoginForm()\n {\n return '//form[@id=\"loginForm\"]';\n }",
"public function loginForm()\n {\n return UsernameOrEmailLoginForm::create(\n $this,\n get_class($this->authenticator),\n 'LoginForm'\n );\n }",
"public function getLoginForm()\n {\n $incorrect = \\Session::pull('login.incorrect');\n\n $this->nav('navbar.logged.out.login');\n $this->title('navbar.logged.out.login');\n\n return $this->view('auth.login', compact('incorrect'));\n }",
"public function showLoginForm()\n {\n\n /** set session refferrer */\n $this->setPreviousUrl();\n\n /** @var String $title */\n $this->title = __(\"admin.pages_login_title\");\n /** @var String $content */\n $this->template = 'Admin::Auth.login';\n\n /**render output*/\n return $this->renderOutput();\n }",
"public function getLoginForm()\n {\n if (is_null($this->_form)) {\n $this->_form = new \\Foundation\\Form;\n $this->_form->setCSRFToken($this->_controller->getCSRFToken());\n $this->_form->setAction($this->_controller->path(\"login\"));\n $field = $this->_form->newField();\n $field->setLegend('Select a user');\n $element = $field->newElement('SelectList', 'userid');\n $element->setLabel('User');\n $element->addValidator(new \\Foundation\\Form\\Validator\\NotEmpty($element));\n foreach ($this->_controller->getEntityManager()->getRepository('\\Jazzee\\Entity\\User')->findByName('%', '%') as $user) {\n if ($user->isActive()) {\n $element->newItem($user->getId(), \"{$user->getLastName()}, {$user->getFirstName()} - {$user->getEmail()}\");\n }\n }\n $this->_form->newButton('submit', 'Login');\n }\n\n return $this->_form;\n }",
"function renderLoginForm() {\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t\n\t\t// add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)\n\t\t$translate = DevblocksPlatform::getTranslationService();\n\t\t$tpl->assign('translate', $translate);\n\t\t\n\t\t@$redir_path = explode('/',urldecode(DevblocksPlatform::importGPC($_REQUEST[\"url\"],\"string\",\"\")));\n\t\t$tpl->assign('original_path', (count($redir_path)==0) ? 'login' : implode(',',$redir_path));\n\t\t\n\t\t$tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_default.tpl');\n\t}",
"function html_login_form()\n\t{\n\t\t$action = HAS_ADMIN ? ROOT_URL.'admin' : '';\n\t\tif(!isset($this->user)) return '\n\t\t<form id=\"login-form\" method=\"post\" action=\"' . $action . '\" >\n\t\t\t<input type=\"text\" name=\"login\" class=\"field field-login\" />\n\t\t\t<input type=\"password\" name=\"password\" class=\"field field-password\" />\n\t\t\t<input type=\"submit\" class=\"btn\" value=\"login\" />\n\t\t</form>';\n\n\t\treturn basename($this->user) . ' (' . dirname($this->user) . ')\n\t\t<form id=\"logout-form\" method=\"post\" action=\"\" >\n\t\t\t<input type=\"hidden\" name=\"logout\" />\n\t\t\t<input type=\"submit\" class=\"btn\" value=\"logout\" />\n\t\t</form>';\n\t}",
"public function LoginForm()\n {\n return YubikeyLoginForm::create(\n $this,\n get_class($this->authenticator),\n 'LoginForm'\n );\n }",
"function renderLoginForm() {\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t\n\t\t// add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)\n\t\t$translate = DevblocksPlatform::getTranslationService();\n\t\t$tpl->assign('translate', $translate);\n\t\t\n\t\t@$redir_path = explode('/',urldecode(DevblocksPlatform::importGPC($_REQUEST[\"url\"],\"string\",\"\")));\n\t\t$tpl->assign('original_path', (count($redir_path)==0) ? 'login' : implode(',',$redir_path));\n\n\t\t// TODO: pull this from a config area\n\t\t$server = 'localhost';\n\t\t$port = '10389';\n\t\t$default_dn = 'cn=William Bush,ou=people,o=sevenSeas';\n\t\t$tpl->assign('server', $server);\n\t\t$tpl->assign('port', $port);\n\t\t$tpl->assign('default_dn', $default_dn);\n\t\t\n\t\t// display login form\n\t\t$tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_ldap.tpl');\n\t}",
"public function LoginForm()\n {\n return BootstrapMFALoginForm::create(\n $this,\n get_class($this->authenticator),\n 'LoginForm'\n );\n }",
"private function _get_login_form() {\n\t\t$data['username_email'] = array(\n\t\t\t'name' => 'username_email',\n\t\t\t'id' => 'username_email',\n\t\t\t'type' => 'text',\n\t\t\t'value' => isset($_POST['username_email']) ? $_POST['username_email'] : ''\n\t\t);\n\t\t$data['password'] = array(\n\t\t\t'name' => 'password',\n\t\t\t'id' => 'password',\n\t\t\t'type' => 'password',\n\t\t\t'value' => isset($_POST['password']) ? $_POST['password'] : '',\n\t\t);\n\t\t$data['stay_logged_in'] = array(\n\t\t\t'name' => 'stay_logged_in',\n\t\t\t'id' => 'stay_logged_in',\n\t\t\t'type' => 'checkbox',\n\t\t);\n\t\tif(isset($_POST['stay_logged_in'])) {\n\t\t\t$data['stay_logged_in']['checked'] = 'checked';\n\t\t}\n\t\treturn $data;\n\t}",
"public function showLoginForm()\n\t{\n\t\t// Remembering Login\n\t\tif (auth()->viaRemember()) {\n\t\t\treturn redirect()->intended($this->redirectTo);\n\t\t}\n\t\t\n\t\t// Meta Tags\n\t\tMetaTag::set('title', getMetaTag('title', 'login'));\n\t\tMetaTag::set('description', strip_tags(getMetaTag('description', 'login')));\n\t\tMetaTag::set('keywords', getMetaTag('keywords', 'login'));\n\t\t\n\t\treturn appView('auth.login');\n\t}",
"public function showLoginForm()\n {\n return view('blog::admin.pages.auth.login');\n }",
"public function loginForm(){\n self::$loginEmail = $_POST['login-email'];\n self::$loginPassword = $_POST['login-password'];\n \n self::sanitize();\n $this->tryLogIn();\n }",
"public function showLoginForm()\n\t{\n\t\treturn view('auth.login');\n\t}",
"public function showLoginForm()\n {\n return view('hub::auth.login');\n }",
"public function showLoginForm()\n {\n return view('adminlte::auth.login');\n }",
"public function showLoginForm()\n {\n return $this->socialiteDriver()->redirect();\n }",
"public function showLoginForm()\n {\n return view('ui.pages.login');\n }",
"public function Form()\n {\n return LoginForm::create($this, 'Form');\n }",
"public function login()\n {\n return ['Form' => $this->Form()];\n }",
"public static function printLoginForm() {\n\t\t\tif($_GET['module'] != \"login\"){\n\t\t\t\t$cur_page = $_SERVER[\"REQUEST_URI\"];\n\t\t\t\t$cur_page = str_replace(\"/index.php\", \"\", $cur_page);\n\t\t\t\t$_SESSION['ref'] = $cur_page; \n\t\t\t}\n\t\t\t// The user is not logged in shown the login form\n\t\t\tinclude 'engine/values/site.values.php';\n\t\t\techo \"<form action=\\\"?module=handler&action=login\\\" method=\\\"post\\\">\n\t\t\t <div class=\\\"form_settings\\\" style=\\\"float:right; position:relative; left: -24%;\\\">\n\t\t\t \t<center><h2>\".strip_tags($site_title).\" - Login</h2></center>\n\t\t\t \t<br>\n\t\t\t \t<p><span>Email</span><input type=\\\"text\\\" name=\\\"user\\\" tabindex=\\\"1\\\" class=\\\"contact\\\"/></p>\n\t\t\t <p><span>Password</span><input type=\\\"password\\\" name=\\\"password\\\" tabindex=\\\"2\\\" class=\\\"contact\\\"/></p>\n\t\t\t <p style=\\\"padding-top: 15px\\\"><span> </span><input class=\\\"submit\\\" type=\\\"submit\\\" name=\\\"contact_submitted\\\" value=\\\"Submit\\\" /></p>\n\t\t\t <br><center>\";\n\t\t\t\tif($site_reg_open){\n\t \t\techo \"[<a href=\\\"?module=registration\\\">Register</a>]\";\n\t\t\t\t}\n\t\t\t echo \"[<a href=\\\"?module=handler&action=forgot\\\">Forgotten password?</a>]</center></div>\n\t\t\t</form>\";\n\t\t}",
"public function showLoginForm()\n {\n $this->data['title'] = trans('backpack::base.login'); // set the page title\n\n return view('backpack::auth.login', $this->data);\n }",
"public function showLoginForm()\n {\n return view('shopper::pages.auth.login');\n }",
"private function maybe_get_login_form() {\n\n\t\tif (!MKB_Options::option('restrict_show_login_form')) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$login_container_class = MKB_Options::option('restrict_disable_form_styles') ?\n\t\t\t'mkb-restricted-login--default' :\n\t\t\t'mkb-restricted-login--custom';\n\n\t\treturn '<br/>' .\n\t\t '<div class=\"mkb-restricted-login ' . $login_container_class . '\">' .\n\t\t (\n\t\t MKB_Options::option('restrict_disable_form_styles') ?\n\t\t\t wp_login_form( array('echo' => false) ) :\n\t\t\t $this->get_custom_login_form()\n\t\t ) . '</div>';\n\t}",
"public function showLoginForm()\n {\n return view('auth.login',[\n 'title' => 'Connexion à l\\'espace d\\'administration',\n 'loginRoute' => 'backend.login',\n 'forgotPasswordRoute' => 'backend.password.request',\n ]);\n }",
"public function showLoginForm()\n {\n return view('auth.magic-login');\n }",
"protected function createComponentLoginForm()\n\t{\n\t\t$this->instructions['message'] = 'Boli ste úspešne prihlásený.';\n\t\treturn $this->userFormsFactory->createLoginForm(ArrayHash::from($this->instructions));\n\t}",
"public function loginForm()\n {\n // If already logged in, redirect appropriately\n if ($this->custLoggedIn())\n {\n $this->redirect(\"mainPageCust.php\");\n } elseif ($this->ownerLoggedIn())\n {\n $this->redirect(\"mainPageOwner.php\");\n }\n \n // prepare errors to display if there are any\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n \n // here the login form view class is loaded and method printHtml() is called \n require_once('views/FormError.class.php');\n require_once('views/LoginForm.class.php');\n $site = new SiteContainer($this->db);\n $form = new LoginForm();\n $error_page = new FormError();\n $site->printHeader();\n $site->printNav();\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n \n }",
"public function showLoginForm()\n {\n return view('operator.login');\n }",
"public function showLoginForm()\n {\n return view('auth::login');\n }",
"public function showLoginForm()\n {\n return view('admin.auth.login');\n }",
"public function showLoginForm()\n {\n return view('admin.auth.login');\n }",
"public function showLoginForm()\n {\n return view('admin.auth.login');\n }",
"public function showLoginForm()\n {\n $this->data['title'] = trans('back-project::base.login'); // set the page title\n return view('back-project::auth.login', $this->data);\n }",
"public function showLoginForm()\n {\n \n if (\\Auth::check()) {\n return redirect()->route('eventmie.welcome');\n }\n return Eventmie::view('eventmie::auth.login');\n }",
"public function showLoginForm()\n {\n return view('estagiarios.auth.login');\n }",
"public function showLoginForm()\n {\n return view('pages.superAdmin.login');\n }",
"public function showLoginForm()\n {\n return view('admin::auth.login',[\n 'title' => 'Admin Login',\n 'loginRoute' => route('dashboard.login'),\n 'forgotPasswordRoute' => 'dashboard.password.request',\n ]);\n }",
"protected function form()\n {\n return $this->view\n ->template('Moss:Sample:login')\n ->set('method', __METHOD__)\n ->set('flash', $this->app->get('flash'))\n ->render();\n }",
"private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}",
"public function showLoginForm()\n {\n if(Agent::isTable() || Agent::isMobile()){\n return view('errors.desktop-only');\n }\n else{\n return view('auth.login');\n }\n }",
"public function formLogin() {\n $this->view->addForm();\n }",
"function loginForm () {\n\t\t$content = '\n\t\t\t<div id=\"loginform\" class=\"login\">\n\t\t\t<form action=\"\" method=\"post\">\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend>Login</legend>\n\t\t\t\t\t<label for=\"username\">Brukernavn: <input type=\"text\" max=\"20\" name=\"username\">\n\t\t\t\t\t<label for=\"password\">Passord: <input type=\"password\" name=\"password\">\n\t\t\t\t\t<input type=\"submit\" name=\"submit\" value=\"Logg inn\">\n\t\t\t\t</fieldset>\n\t\t\t</form>\n\t\t\t</div>\n\t\t\t';\n\t\treturn $content;\n\t}",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function get_authentication_page_form() {\n $this->do_authentication_page_form();\n return $this->c_authentication_page_form;\n }",
"public function showLoginForm()\n {\n return view('admin.login');\n }",
"public function showLoginForm()\n {\n return view('admin.login');\n }",
"public function showLoginForm()\n {\n return view('admin.login');\n }",
"public function showLoginForm()\n {\n return view('admin.login');\n }",
"public function showAdminLoginForm()\n {\n $title = Lang::get('admin.ca_login');\n return view('admin.login', compact('title'));\n }",
"public function qode_membership_render_login_form() {\n\t\techo qode_membership_get_widget_template_part( 'login-widget', 'login-modal-template' );\n\t}",
"public function getLogin() //El nombre de la ruta es lo que está escrito después del get. Debo tener el get porque es en la que se manda a llamar el formulario.\n {\n return render('../views/login.php');\n }",
"public function showLoginForm()\n {\n\n return view('auth.login');\n }",
"public function showLoginForm() {\n $url = url('../') . '/portal/login';\n return Redirect::to($url);\n }",
"public function loginForm()\n {\n return view('login');\n }",
"public function showLoginForm()\n {\n return view('guestAuth.login');\n }",
"public function showLoginForm()\n\t{\n\t\treturn view('auth.organizer.login');\n\t}",
"public function showLoginForm()\n {\n return view('user.login');\n }",
"public function login() {\n\t\t// the variable located outside the method.\n\t\tglobal $routing;\n\n\t\t// Start creating the form.\n\t\t$form = new Form;\n\t\t// Set the form's method attribute,\n\t\t$form->setMethod(\"POST\");\n\t\t// and the action attribute. Here we use the url() method from\n\t\t// the routing class to generate a full URL to the login route.\n\t\t$form->setAction($routing->url('login'));\n\n\t\t// Create an Email Field with the name \"login-email\",\n\t\t$email = new EmailField(\"login-email\");\n\t\t// set it's class\n\t\t$email->setClass(\"form-control\");\n\t\t// mark it as required,\n\t\t$email->setRequired(true);\n\t\t// set it's label,\n\t\t$email->setLabel(\"E-mail:\");\n\t\t// set the HTML to appear before the field,\n\t\t$email->setBeforeHtml(\"<div class=\\\"form-group\\\">\");\n\t\t// set the HTML to appear after the field,\n\t\t$email->setAfterHtml(\"</div>\");\n\t\t// and add it to the form we created earlier.\n\t\t$form->addField($email);\n\n\t\t// Create a Password Field with the name \"login-password\",\n\t\t$password = new PasswordField(\"login-password\");\n\t\t// set it's class\n\t\t$password->setClass(\"form-control\");\n\t\t// mark it as required,\n\t\t$password->setRequired(true);\n\t\t// set it's label,\n\t\t$password->setLabel(\"Password:\");\n\t\t// set the HTML to appear before the field,\n\t\t$password->setBeforeHtml(\"<div class=\\\"form-group\\\">\");\n\t\t// set the HTML to appear after the field,\n\t\t$password->setAfterHtml(\"</div>\");\n\t\t// and add it to the form we created earlier.\n\t\t$form->addField($password);\n\n\t\t// Initialise a variable to store the form submission result in.\n\t\t$result = \"\";\n\n\t\t// Check if the form has been submitted.\n\t\tif( $form->isSubmitted() && $form->isValid() ) {\n\t\t\t// Form has been submited.\n\n\t\t\t// In order to access the database instance that exists in our init.php file,\n\t\t\t// we need to define the variable as global.\n\t\t\tglobal $database;\n\n\t\t\t// Connect to the database.\n\t\t\t$database->connect();\n\t\t\t\n\t\t\t// Query the database for and select the user matching the provided email address.\n\t\t\t// We need to set the index of 0 here as we are only interested in the first result.\n\t\t\t$user = $database->select(['*'], 'users', ['email' => $email->getValue()])[0];\n\n\t\t\t// Check if the provided email address matches a user in the database.\n\t\t\tif( isset($user['email']) && $user['email'] == $email->getValue() ) {\n\t\t\t\t// It does match, lets check if the provided password is also a match.\n\t\t\t\tif( $user['password'] == $password->getValue() ) {\n\t\t\t\t\t// Password is a match, so let's change the result to \"Verified\".\n\t\t\t\t\t$result = \"Verified\";\n\t\t\t\t} else {\n\t\t\t\t\t$result = \"Incorrect E-mail and/or Password\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result = \"Incorrect E-mail and/or Password\";\n\t\t\t}\n\t\t} else if( $form->isSubmitted() && !$form->isValid() ) {\n\t\t\t$result = \"Missing Required Fields\";\n\t\t}\n\n\t\t// Render our view and pass to it the instance of our form, and the form submission result.\n\t\t$this->view('home/login', ['header-view' => 'home/header', 'footer-view' => 'home/footer', 'form' => $form, 'result' => $result]);\n\t}",
"public function showTutorLoginForm()\n {\n $title = Lang::get('admin.ca_login');\n return view('tutor.login', compact('title'));\n }",
"public function showLoginForm()\n {\n return view('auth.login');\n }",
"public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}",
"public function showLoginForm()\n {\n\n/* $routes = collect(\\Route::getRoutes())->map(function ($route) { return $route->uri(); });\n\n $previousPath = $this->getPreviousRequestedRoute();\n\n foreach ($routes as $route) {\n // dnd([$route, $previousPath]);\n if (\n $route === $previousPath\n ) {\n // dd([$route, $previousPath, \"found\"]);\n // dd([\"setting url.intended\", $previousPath]);\n Session::put(\n 'intended_request',\n $previousPath\n );\n session()->save();\n } else {\n Session::remove(\n 'intended_request'\n );\n }\n }*/\n\n return view('auth.login');\n }",
"public function showLoginForm()\n {\n return view('auth.login', ['social_types' => $this->socialTypeService->getAll()]);\n }",
"public function getForm()\n {\n if (!$this->_form) {\n $this->_form = new Auth_Form_Signin(array(\n \"action\" => $this->_action,\n \"auth\" => $this->getAuth(),\n \"authAdapter\" => $this->getAuthAdapter(),\n \"baseUrl\" => $this->getRequest()->getBaseUrl()\n ));\n $this->_form->setTempAuthAdapter($this->getTempAuthAdapter());\n $session = $this->getSession();\n if (isset($session->postLoginUrl)) {\n \n $this->_form\n ->getElement(\"return\")\n ->setValue($this->getSession()->postLoginUrl);\n \n unset($session->postLoginUrl); \n }\n }\n\n return $this->_form;\n }",
"public function getTplFormLogin() {\n if ($this->strTplFormLogin == \"\")\n $this->strTplFormLogin = FWK_HTML_ADMINPAGE . \"AdminLogin.tpl\";\n return $this->strTplFormLogin;\n }",
"public function showLoginForm()\n {\n $form = \\FormBuilder::create(LoginUserForm::class);\n\n return view('account::auth.login', compact('form'));\n }",
"private function genLogin()\n {\n ob_start(); ?>\n <form name=\"login\" action=\"./\" method=\"post\">\n <fieldset class=\"uk-fieldset\">\n <legend class=\"uk-legend\">[[legend]]</legend>\n <div class=\"uk-margin\">\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: user\"></span>\n <input class=\"uk-input\" type=\"text\" name=\"username\" value=\"[[value_username]]\"\n placeholder=\"[[placaholder_username]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"password\" placeholder=\"[[placaholder_password]]\">\n </div>\n </div>\n <div class=\"uk-margin-bottom\">\n <input type=\"hidden\" name=\"action\" value=\"login\">\n <button class=\"uk-button uk-button-default\">[[submit_text]]</button>\n </div>\n </div>\n <p>[[register_text]] <span uk-icon=\"icon: link\"></span>\n <a href=\"../registration/\">[[register_link]]</a></p>\n </fieldset>\n </form>\n <?php return ob_get_clean();\n }",
"function showLoginForm() {\n}",
"function get_vr_login_form($redirect) {\r\n if (!is_user_logged_in()) {\r\n $return = \"<form action=\\\"\\\" method=\\\"post\\\" class=\\\"vr_form vr_login\\\">\\r\\n\";\r\n $error = get_vr_error();\r\n if ($error)\r\n $return .= \"<p class=\\\"error\\\">{$error}</p>\\r\\n\";\r\n $return .= \" <p>\r\n <label for=\\\"vr_username\\\">\".__('Username','theme').\"</label>\r\n <input type=\\\"text\\\" id=\\\"vr_username\\\" name=\\\"username\\\" value=\\\"\".(isset($_POST['username'])?$_POST['username']:\"\").\"\\\"/>\r\n </p>\\r\\n\";\r\n $return .= \" <p>\r\n <label for=\\\"vr_password\\\">\".__('Password','theme').\"</label>\r\n <input type=\\\"password\\\" id=\\\"vr_password\\\" name=\\\"password\\\"/>\r\n </p>\\r\\n\";\r\n if ($redirect)\r\n $return .= \"<input type=\\\"hidden\\\" name=\\\"redirect\\\" value=\\\"{$redirect}\\\">\\r\\n\";\r\n $return .= \"<input type=\\\"submit\\\" value=\".__('Login','theme').\" />\\r\\n\";\r\n $return .= \"</form>\\r\\n\";\r\n } else {\r\n $return = \"<p><a href=\\\"\".wp_logout_url(home_url('/login/')).\"\\\">\".__('User is already logged in','theme').\"</a></p>\";\r\n }\r\n return $return;\r\n}",
"public function showLoginForm()\n { \n return view('auth.showLoginForm');\n }",
"protected function createComponentLoginForm(): Form\n {\n $form = new Form($this, 'loginForm');\n $form->addText('id', _('Login or e-mail'))\n ->addRule(\\Nette\\Forms\\Form::FILLED, _('Insert login or email address.'))\n ->getControlPrototype()->addAttributes(\n [\n 'class' => 'top form-control',\n 'autofocus' => true,\n 'placeholder' => _('Login or e-mail'),\n 'autocomplete' => 'username',\n ]\n );\n $form->addPassword('password', _('Password'))\n ->addRule(\\Nette\\Forms\\Form::FILLED, _('Type password.'))->getControlPrototype()->addAttributes(\n [\n 'class' => 'bottom mb-3 form-control',\n 'placeholder' => _('Password'),\n 'autocomplete' => 'current-password',\n ]\n );\n $form->addSubmit('send', _('Log in'));\n $form->addProtection(_('The form has expired. Please send it again.'));\n $form->onSuccess[] = fn(\\Nette\\Forms\\Form $form) => $this->loginFormSubmitted($form);\n\n return $form;\n }",
"public function showLoginForm() {\n if (Auth::guard('web')->check()) {\n return redirect()->route('user.dashboard');\n }\n\n if (Auth::guard('division')->check()) {\n return redirect()->route('division.dashboard');\n }\n return view('division.division_login');\n }",
"public function showLoginForm()\n {\n $view = 'cscms::frontend.default.auth.login';\n if (View::exists(config('cscms.coderstudios.theme').'.auth.login')) {\n $view = config('cscms.coderstudios.theme').'.auth.login';\n }\n\n return view($view);\n }",
"protected function renderLogin(){\n return '<form class=\"forms\" action=\"'.Router::urlFor('check_login').'\" method=\"post\">\n <input class=\"forms-text\" type=\"text\" name=\"username\" placeholder=\"Pseudo\">\n <input class=\"forms-text\" type=\"password\" name=\"password\" placeholder=\"Mot de passe\">\n <button class=\"forms-button\" name=\"login_button\" type=\"submit\">Se connecter</button>\n </form>';\n }",
"public function login() {\n\t\t$this->helpers[] = 'Form';\n\t}",
"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 showLoginForm()\n {\n return redirect()->route('show.app.login');\n }",
"public function showloginform()\n {\n return view('tsadmin.adminloginform');\n }",
"public function login()\n {\n if (isset($_POST['username']) && isset($_POST['password'])) {\n return $this->_check_login();\n }\n return $this->_login_form();\n }",
"public function showAdminLoginForm()\n {\n return view('admin.login');\n }",
"public function showLoginForm()\n {\n if (Auth::viaRemember()) {\n return redirect()->intended('dashboard');\n }\n return view(\"auth.login\");\n }",
"private function get_custom_login_form() {\n\t\tob_start();\n\n\t\t?>\n\t\t<form name=\"loginform\" action=\"<?php echo site_url('wp-login.php'); ?>\" method=\"post\">\n\t\t\t<p class=\"login-username\">\n\t\t\t\t<label for=\"mkb_user_login\">\n\t\t\t\t\t<?php echo esc_html(MKB_Options::option('restrict_login_username_label_text')); ?></label>\n\t\t\t\t<input type=\"text\" name=\"log\" id=\"mkb_user_login\" class=\"input\" value=\"\" />\n\t\t\t</p>\n\t\t\t<p class=\"login-password\">\n\t\t\t\t<label for=\"mkb_user_pass\">\n\t\t\t\t\t<?php echo esc_html(MKB_Options::option('restrict_login_password_label_text')); ?></label>\n\t\t\t\t<input type=\"password\" name=\"pwd\" id=\"mkb_user_pass\" class=\"input\" value=\"\" />\n\t\t\t</p>\n\t\t\t<p class=\"login-remember\">\n\t\t\t\t<label><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\"> <?php\n\t\t\t\t\techo esc_html(MKB_Options::option('restrict_login_remember_label_text')); ?></label>\n\t\t\t</p>\n\t\t\t<p class=\"login-submit\">\n\t\t\t\t<input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button button-primary\"\n\t\t\t\t value=\"<?php echo esc_attr(MKB_Options::option('restrict_login_text')); ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"redirect_to\" value=\"<?php\n\t\t\t\techo esc_attr(( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?>\" />\n\t\t\t<?php if (MKB_Options::option('restrict_show_register_link')): ?>\n\t\t\t\t<?php if (MKB_Options::option('restrict_show_or')):?>\n\t\t\t\t\t<div class=\"mkb-login-or\"><?php\n\t\t\t\t\techo esc_html(MKB_Options::option('restrict_or_text')); ?></div>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<div class=\"mkb-register-link\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url(wp_registration_url()); ?>\">\n\t\t\t\t\t\t\t<?php echo esc_html(MKB_Options::option('restrict_register_text')); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t\t</p>\n\t\t</form>\n\t\t<?php\n\n\t\treturn ob_get_clean();\n\t}",
"public function getLoginFormData() {}",
"public function getLoginFormData() {}",
"public function getLogin()\n {\n return $this->__get(\"login\");\n }",
"private function createLoginForm() {\n $form = $this->createForm(new LoginType(), new LoginFilter(), array(\n 'action' => $this->generateUrl('bitcoin_site_authenticate'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => '<span><span>Submit Review</span></span>'));\n\n return $form;\n }"
] | [
"0.90570664",
"0.8379977",
"0.8372617",
"0.8151223",
"0.8061772",
"0.8061772",
"0.8039768",
"0.7965553",
"0.7800659",
"0.77562165",
"0.77459735",
"0.7674884",
"0.7662959",
"0.76601464",
"0.7624714",
"0.759607",
"0.7593487",
"0.7530753",
"0.7530694",
"0.7513565",
"0.748988",
"0.7485773",
"0.74798656",
"0.74532884",
"0.74367905",
"0.74363387",
"0.74190956",
"0.741396",
"0.7413086",
"0.74118584",
"0.7399497",
"0.73959446",
"0.7390076",
"0.73767215",
"0.73729867",
"0.7365997",
"0.7359029",
"0.7359029",
"0.7359029",
"0.7354296",
"0.7351623",
"0.7332229",
"0.7328495",
"0.73207915",
"0.7300477",
"0.7296155",
"0.7295665",
"0.7283611",
"0.72717065",
"0.7261745",
"0.7261745",
"0.7261745",
"0.7261745",
"0.7261745",
"0.7261745",
"0.7261745",
"0.7261745",
"0.7252897",
"0.7218243",
"0.7218243",
"0.7218243",
"0.7218243",
"0.7215991",
"0.7213393",
"0.72087455",
"0.7203534",
"0.71831983",
"0.7174823",
"0.7161441",
"0.7155979",
"0.7147601",
"0.7144517",
"0.7143367",
"0.7138601",
"0.713201",
"0.71302086",
"0.7126228",
"0.7097114",
"0.7080042",
"0.70776236",
"0.7070545",
"0.7068589",
"0.70614636",
"0.70540005",
"0.70383567",
"0.70206547",
"0.7016295",
"0.70084906",
"0.7003387",
"0.69613516",
"0.6952607",
"0.694486",
"0.6935592",
"0.69264984",
"0.6917728",
"0.6907954",
"0.69061476",
"0.69061476",
"0.690347",
"0.6902362"
] | 0.77045846 | 11 |
User Account Info Page [logged in?] | public function info() {
$data = array();
if ($this->user->is_logged_in()) {
$this->user->get_user($this->user->getMyId());
$data['user'] = $this->user;
}
$this->load->view('account/account_info', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }",
"public function myAccount() {\n if ($this->_model->isLogged()) {\n $username = $_SESSION['user'];\n $email = $this->_model->getMailFromSessionUsername();\n $checked = $this->_model->getNotifsFromSessionUsername();\n $edit_success = \"<p class='flash_success'>\" . $this->_model->getFlash('edit_success') . \"</p>\";\n $edit_err = \"<p class='flash_err'>\" . $this->_model->getFlash('edit_err') . \"</p>\";\n $this->render('General.Account', compact('username', 'email', 'edit_success', 'edit_err', 'checked'));\n }\n else {\n $this->login();\n }\n }",
"public function actionUserInfo()\n {\n $data['userInfos'] = Fly::m('blog.models.BlogModel')->getUser(1);\n $this->render('user_info', $data);\n }",
"public function info()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n $userModel = new UserModel();\n\n $userInfo = $userModel->getUserByEmail(Session::get('login'));\n\n $this->data['info'] = $userInfo;\n\n $this->render('info');\n }",
"public function account() {\n if ($this->ion_auth->logged_in()) {\n // Refresh the session\n $this->ion_auth->login_remembered_user();\n $this->body_class[] = 'my_account';\n\n $this->page_title = 'My Account';\n\n $this->current_section = 'my_account';\n\n $user = $this->ion_auth->user()->row_array();\n// var_dump($user);\n\n $this->render_page('user/account', array('user' => $user));\n } else {\n redirect('login');\n }\n \n \n }",
"public function PrintAuthInfo() \n {\n if($this->IsAuthenticated())\n echo \"Du är inloggad som: <b>\" . $this->GetAcronym() . \"</b> (\" . $this->GetName() . \")\";\n else\n echo \"Du är <b>UTLOGGAD</b>.\";\n }",
"function getUserBarInfo() {\r\n if (isUserLogged()) {\r\n if (isUserAdmin()) {\r\n echo '<a href=\"user.php\">User: ' . $_SESSION['user'] . \"</a>\";\r\n } else {\r\n echo 'User: ' . $_SESSION['user'];\r\n }\r\n echo ' | <a href=\"purchase.php\">Basket</a>';\r\n } else {\r\n echo '<a href=\"login.php\">Sign in/Register</a>';\r\n }\r\n }",
"function get_info() {\n\n\n\n echo $this->username;\n echo $this->password;\n\n\n if ( ! $this->username || ! $this->password) {\n // CODE TO RELOAD SIGN-IN PAGE WITH 'ERROR' MESSAGE\n }\n\n else {\n echo $this->username;\n echo $this->password;\n\n $this->setup_page();\n\n // $this->connect_to_database();\n }\n }",
"public function information_user()\n {\n //Model\n $username = $_SESSION['username'];\n $rs = $this->Nhansu->get_information_user($username);\n if ($rs) {\n $this->view(\"master_page\", [\n \"page\" => \"information_user\",\n \"url\" => \"../\",\n \"info_user\" => $rs,\n \"phongban\" => $this->Phongban->ListAll(),\n \"chucvu\" => $this->Chucvu->ListAll(),\n\n ]);\n }\n }",
"private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }",
"function grabUserAccountInfo(){\n\t\tJSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$session = JFactory::getSession();\n\t\t$post \t = $app->input->post->getArray();\n\t\t\n\t\t$session->set('userInfo', $post, 'register');\n\t\t\n\t\t//find step 3 or 4; step 4 = normal registration; step 3 = skip plan\n\t\t$skipPlan \t= $session->get('skipPlan', 0, 'register');\n\t\t$step = ($skipPlan) ? 'step=3' : 'step=4';\n\t\t\n\t\t$link = JRoute::_('index.php?option=com_jblance&view=guest&layout=usergroupfield&'.$step, false);\n\t\t$this->setRedirect($link);\n\t\treturn false;\n\t}",
"function get_loggedin_info($info)\n{\n\t$CI = &get_instance();\n\t$user = $CI->session->userdata('user');\n\n\treturn $user[$info];\n}",
"public function profile() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\treturn $this->view->render('profile_view');\n\t\t}\n\t}",
"public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }",
"public function getMyAccountInfo()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n $user = array_pop($user);\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'Successfully retrieved user info';\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }",
"function index()\n {\n // Check if there errors from the forms, and display them.\n $this->registry->template->loginSend = Util::checkExcistInSession($this->loginError);\n $this->registry->template->registerSend = Util::checkExcistInSession($this->registerError);\n\n // If the user is loggedIn show the logout button\n if ($this->registry->userAccount->isLogedIn()) {\n $this->registry->template->show('account-loggedin');\n } else {\n $this->registry->template->show('account');\n }\n }",
"function userInfo($info){\r\n\t\t\tif(isset($_SESSION['Auth']->$info)){\r\n\t\t\t\treturn $_SESSION['Auth']->$info;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}",
"public function displayUserPage() {\n\t if(!isset($_SESSION['userID'])) {\n\t \t//redirect\n\t \theader('Location:index.php?page=home');\n\t }\t\n\t\tif(!isset($_POST['logout'])) {\n\n\t\t\t$html = '<h2 class=\"redhead\">' . $_SESSION['firstName'] .' Page <br/> Welcome to your Account!</h2>'; \n\t\t\t\t\n\t\t\t$html .= '<div class=\"left half\"><h3>Start Rating Childcare Centres Now!</h3><p>The system of rating uses averaging. The parents rates the center with 5 as the highest and 1 is the lowest. The Centre with the highest score is ranked as no. 1 and so forth. </p>';\t\n\t\t\n\t\t\t$html .= '<form method=\"POST\" action=\"'. $_SERVER['REQUEST_URI'] .'\" class=\"left\">';\n\t\t\t$html .= '<input type=\"submit\" name=\"logout\" value=\"Logout\" class=\"blue whitefont\">';\n\t\t\t$html .= '</form> </div><br/>';\t\t\t\n\n\t\t\treturn $html;\t\t \t\t\t\t\t\n\t\t} else {\n\t\t\t\t$this -> model -> processLogout();\t\t\t\t\t\n\t\t\t\theader('Location:index.php?page=login');\n\t\t}\n\t\t\t\n\t}",
"public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }",
"function LoggedIn() {\n\t\treturn $this->Get('UserDetails');\n\t}",
"function users_user_view($args)\n{\n // If has logged in, header to index.php\n if (pnUserLoggedIn()) {\n return pnRedirect(pnConfigGetVar('entrypoint', 'index.php'));\n }\n\n // create output object\n $pnRender = & pnRender::getInstance('Users');\n\n // other vars\n $pnRender->assign(pnModGetVar('Users'));\n\n return $pnRender->fetch('users_user_view.htm');\n}",
"public function accountAction()\n {\n \tif(!in_array($this->_user->{User::COLUMN_STATUS}, array(User::STATUS_BANNED, User::STATUS_PENDING, User::STATUS_GUEST))){\n \t\t$this->_forward('homepage');\n \t\treturn;\n \t}\n \t$this->view->registerForm = new User_Form_Register();\n \t$this->view->loginForm = new User_Form_Login();\n }",
"public function accountInfo(): Response\n {\n // logged in, or are logged in via a remember me cookie\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');\n\n // ...\n }",
"public function account()\n {\n if (Login::isConnected()) {\n $this->generateView(array());\n } else {\n $this->index();\n }\n\n }",
"function userLoggedIn()\n{\n\tif(Auth::check()) {\n\t\t// Log::info('');\n\t\theader('Location: /users/account?id=' . Auth::id() );\n\t\tdie();\n\t}\n}",
"public function get_user_info($info)\n {\n Session::_start();\n return Session::_get(\"user\", $info);\n }",
"function user_logged_in($user_id) {\n \n }",
"public function index()\n {\n $account = new User();\n\n $view = new View('account/overview.twig');\n return $view->setData([\n 'account' => $account->find($_SESSION['user'])\n ])->build();\n }",
"protected function isUserLoggedIn() {}",
"protected function isUserLoggedIn() {}",
"public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}",
"function account(){\n\t\tif(!$this->Session->read(\"id\") || !$this->Session->read(\"name\")){\n\t\t\t$this->redirect('/');\n\t\t}\n\t}",
"function account(){\n\t\tif(!$this->Session->read(\"id\") || !$this->Session->read(\"name\")){\n\t\t\t$this->redirect('/');\n\t\t}\n\t}",
"function account(){\n\t\tif(!$this->Session->read(\"id\") || !$this->Session->read(\"name\")){\n\t\t\t$this->redirect('/');\n\t\t}\n\t}",
"function account(){\n\t\tif(!$this->Session->read(\"id\") || !$this->Session->read(\"name\")){\n\t\t\t$this->redirect('/');\n\t\t}\n\t}",
"abstract public function getUserInfo();",
"public function showAccountPage()\n {\n $user = Auth::user();\n $questions = SecurityQuestion::all();\n\n return view('users.account', compact('user', 'questions'));\n }",
"public static function userLoggedIn()\n {\n //Hvis en bruker ikke er logget inn, vil han bli sent til login.php\n if (!isset($_SESSION['user'])) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $_SESSION['returnPage'] = $_SERVER['REQUEST_URI'];\n $alert = new Alert(Alert::ERROR, \"Du er nøtt til å være logget inn for å se den siden. Ikke prøv deg på noe.\");\n $alert->displayOnOtherPage('login.php');\n\n }\n }",
"public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }",
"function UserInfo(){\r\n\r\n\t//get user\r\n\tif(Helpers::is_logged_in()){\r\n\r\n\t//get the id of current user\r\n\t$uid=Helpers::uid();\r\n\r\n\t//get app's meta info\r\n\t$app_meta=$this->GetMetaInfo();\r\n\r\n\t/*\r\n\t**Boolean variable to check wether user is logged in based on the App_meta info \r\n\t**It Also helps find out wether a user was om Landing Page or on Dashboard\r\n\t*/\r\n\t$meta_logged_in=!empty($app_meta['logged_in']) && $app_meta['logged_in'];\r\n\r\n\t//get the User object\r\n\t$user=Helpers::get_controller(USERS)->GetUserById($uid);\r\n\t\t\r\n\t//Lets decide wether to show the user (that just logged in) the Welcome message\r\n\tif(!empty(Yii::app()->session['logged_in']) && !Helpers::IsToday($user->registration_date) && $meta_logged_in){\r\n\t\r\n\t$welcome=true;\t\r\n\tunset(Yii::app()->session['logged_in']);\r\n\t\r\n\t}\r\n\r\n\t/**\r\n\t** check wether user is to go through the Site Tour\r\n\t** After the first login\r\n\t**/\r\n\tif($user->tour_enabled && $meta_logged_in){\r\n\r\n\t$tour_enabled=true;\t\r\n\r\n\t$user->tour_enabled=0;\r\n\t\r\n\t$user->save();\t\r\n\r\n\t}\r\n\r\n\treturn array(\r\n\r\n\t\t\"id\"=>$uid,\r\n\t\t\"message\"=>!empty($welcome)?\"Welcome back \".Helpers::get_controller(USERS)->UserName($uid):false,\r\n\t\t\"tour_enabled\"=>!empty($tour_enabled),\r\n\r\n\t\t);\r\n\r\n\t}\r\n\r\n\treturn array();\r\n}",
"public function actionAccount(){\n\t $user = Yii::app()->user;\n\t $user_data = Padres::model()->findByAttributes(array('usuario' => $user->id));\n\t $this->render('account',array(\n\t\t\t\t\t'user'=> $user,\n\t\t\t\t\t'user_data' => $user_data\n\t\t\t\t));\n\t\t\t\t\n\t}",
"public static function index() {\n $loggedInUserId = parent::getLoggedInUsersId();\n\n if (!$loggedInUserId) {\n header(\"Location: /\");\n }\n else {\n\n # Get the database handler\n $mysqli = parent::dbConnect();\n\n # Get the user's current email address\n $stmt = $mysqli->prepare('select name, username, author_email from mobile_users where id = ?');\n $stmt->bind_param('s', $loggedInUserId);\n $stmt->execute();\n $stmt->bind_result($displayname, $username, $userEmailAddress);\n $stmt->fetch();\n $stmt->close();\n\n # Initialize and inflate the template\n $tpl = parent::tpl()->loadTemplate('account');\n\n print $tpl->render(array_merge(parent::getGlobalTemplateData(),\n array(\n 'displayname' => $displayname,\n 'username' => $username,\n 'emailaddress' => $userEmailAddress,\n 'success' => isSet($_GET['success']) ? (($_GET['success'] == 1) ? '✔︎ Successfully updated!' : '❌ Oh no! Something went wrong.') : null\n )\n ));\n }\n }",
"public function actionInfo()\n {\n $uid = getParam('id', null);\n if (!$uid) {\n $uid = getMyId();\n }\n if (!empty($uid)) {\n\n $useModel = User::find()->active()->where(['id' => $uid])->one();\n if ($useModel) {\n $this->msg = 'User Info';\n $this->data = User::getDetail($uid);\n } else {\n $this->code = 404;\n $this->msg = 'User Not found';\n }\n } else {\n $this->code = 422;\n $this->msg = 'Id is require';\n }\n\n }",
"public function account(){\n $data = array();\n if($this->session->userdata('isUserLoggedIn')){\n $data['user'] = $this->user->getRows(array('username'=>$this->session->userdata('userId')));\n //load the view\n $this->load->view('users/account', $data);\n }else{\n redirect('users/login');\n }\n }",
"public function display_account_login( ){\n\t\tif( $this->is_page_visible( \"login\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_login.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_login.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_login.php' );\n\t\t}\n\t}",
"public function showHome()\n {\n //user authentication\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View(\"userHome\");\n $view->addData(\"userName\", $user->getNickName());\n echo $view->render();\n }",
"function user_logged_in($user_id)\n\t{\n\t}",
"function print_account_info()\r\n{\r\n}",
"public function display_account_personal_information( ){\n\t\tif( $this->is_page_visible( \"personal_information\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_personal_information.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_personal_information.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_personal_information.php' );\n\t\t}\n\t}",
"public function profileAction() {\n\t\t$this->view->assign('account', $this->accountManagementService->getProfile());\n\t}",
"public function myProfile()\n\t{\n\t\t//echo \"<pre>\";print_r($this->session->userdata());die;\n\t\tif($this->session->userdata('VB_USER_ID') == ''):\n\t\t\tredirect(base_url());\n\t\tendif;\n\t\t$this->layouts->set_title(stripcslashes('Profile | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('Profile | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('Profile | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/profile',array(),$data);\n\t}",
"public function findAccount()\r\n {\r\n // get current user id\r\n $loginUser = $_SESSION[\"loginUser\"];\r\n $userId = $loginUser->getId();\r\n \r\n // search accounts from database\r\n $accountList = $this->accountHandler->findAccount($userId);\r\n \r\n require_once ('view/UserHome.php');\r\n }",
"public function displayAdminPage() {\n\t\t if(!isset($_SESSION['userID'])) {\n\t\t \t//redirect\n\t\t \theader('Location:index.php?page=home');\n\t\t }\t\n\t\t if(!isset($_POST['logout'])) {\n\t\t\t$html = '<h2 class=\"redhead\">' . $_SESSION['firstName'] .' Page <br/> Welcome to your Account!</h2>';\t\n\n\t\t\treturn $html;\t\t \t\t\t\t\t\n\t\t} else {\n\t\t\t\t$this -> model -> processLogout();\t\t\t\t\t\n\t\t\t\theader('Location:index.php?page=login');\n\t\t}\n\t}",
"function index()\n{\n\t$username = $this->Session->read('user');\n\t\tif ($username){\n\t\t$this->redirect('/inhabitants/');}\t\n\t\n\t// Alternatif: coba tampilkan info\n\t$username = $this->Session->read('user');\n\tif ($username)\n\t{\n\t\t$results = $this->User->findByUsername($username);\n\t\t$this->set('User', $results['User']);\n\t\t$this->set('last_login', $this->Session->read('last_login'));\n\t} else {\n\t\t$this->redirect('/users/login');\n\t}\n}",
"public function getUserInfo() {\n\t\t$session = Yii::$app->session;\n\t\t$session->open();\n\t\t$session->regenerateID();\n\t\t\n\t\treturn $session['accountInfo'];\n\t}",
"public function show()\n {\n $user_identifier = $this->session->userdata('identifier');\n $user_details = $this->user_m->read($user_identifier);\n $this->data['user_details'] = $user_details;\n $this->load_view('Profil Akun', 'user/profil');\n }",
"public function logInPage() {\n $view = new View('login');\n $view->generate();\n }",
"function showWelcome(){\n\t\n\t//get the user\n\t$user = getUser();\n\tif($user !== false && is_array($user) && count($user) > 0){\n\t\t$output = 'Hello '. $user['userEmail'] .'<br>';\n\t\t$output .= 'Your account has '. ($user['activated'] == false ? 'not ' : '') .'been activated.<br>';\n\t\t$output .= 'Your last activity was: '. $user['lastActivity'];\n\t\treturn $output;\n\t}\n\telse{\n\t\treturn \"Welcome to the site. Your account could not be retreived at this time.\";\n\t}\n\t\n}",
"static function displayLogInUser()\n {\n echo \"<div class='col-xs-6'><h1>Log Into Account</h1>\";\n echo \"<form role='form' method='post' action='login.php'>\";\n echo \"<label for='loginUser'>Username: </label>\";\n echo \"<input type='text' class='form-control' id='loginUser' name='usr' required>\";\n echo \"<label for='loginPass'>Password: </label>\";\n echo \"<input type='password' class='form-control' id='loginPass' name='pwd' required>\";\n echo \"<input type='hidden' name='action' value='login'><input type='submit' class='btn btn-default'>\";\n echo \"</form></div>\";\n }",
"public function getInfo()\n\t{\n\t\t$output = Output::getInstance();\n\t\t$auth = $this->ensureAuthed();\n\n\t\t$teamNumbers = $auth->getCurrentUserTeams();\n\t\t$teams = array();\n\t\tforeach ($teamNumbers as $id)\n\t\t{\n\t\t\t$teams[$id] = $auth->displayNameForTeam($id);\n\t\t}\n\n\t\t$output->setOutput('display-name', $auth->displayNameForUser($this->username));\n\t\t$output->setOutput('email', $auth->emailForUser($this->username));\n\t\t$output->setOutput('teams', $teams);\n\t\t$output->setOutput('is-admin', $auth->isCurrentUserAdmin());\n\t\t$settingsManager = Settings::getInstance();\n\t\t$settings = $settingsManager->getSettings($this->username);\n\t\t$output->setOutput('settings', $settings);\n\t\treturn true;\n\t}",
"public function logStatus()\n {\n //piece to handle the login/logout\n $u = $this->isAuth();\n $lstr = ($u) ? '<a href=\"/user/main\">' . $u .\n '</a> <a href=\"/user/logout\">[logout]</a>' :\n '<a href=\"/user/login\">login</a>';\n $this->template->write('logged', $lstr);\n }",
"public function show()\n {\n $user = Auth::user();\n\n $totalAccounts = User::count();\n $verifiedAccounts = User::where('usaf_verified', 1)->count();\n $users = User::orderByDesc('isAdmin')\n ->orderBy('created_at', 'asc')\n ->orderBy('usaf_verified', 'desc')\n ->get();\n\n $accountsLinked = DB::table('social_identities')->where('user_id', '=', $user->id)->get();\n\n return view('layouts.account.show', ['user' => $user, 'accountsLinked' => $accountsLinked, 'totalAccounts' => $totalAccounts, 'verifiedAccounts' => $verifiedAccounts, 'users' => $users]);\n }",
"public function getInfo()\n {\n if(Sentry::check())\n {\n $user = Sentry::getUser();\n $data = $this->app->json([\n \"username\" => $user->first_name,\n \"password\" => \" \",\n \"email\" => $user->email\n ]);\n return $data;\n } else {\n return false;\n }\n }",
"public function profileAction() {\r\n $user = $this->getCurUser();\r\n return $this->render('AlbatrossUserBundle:User:profile.html.twig', array(\r\n 'userInfo' => $user,\r\n )\r\n );\r\n }",
"function emc_logged_in_info() {\r\n\r\n\tif ( ! is_user_logged_in() || ! class_exists( 'Groups_Utility', false ) ) return false;\r\n\r\n\tglobal $current_user;\r\n\r\n\t$groups_user = new Groups_User( get_current_user_id() );\r\n $groups = $groups_user->__get( 'groups' );\r\n array_shift( $groups );\r\n\r\n $welcome = sprintf( __( 'Welcome, %s', 'emc' ), esc_html( $current_user->display_name ) );\r\n\r\n $edit = sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\r\n self_admin_url( 'profile.php' ),\r\n esc_attr__( 'Edit your profile', 'emc' ),\r\n esc_html__( 'Edit Profile', 'emc' )\r\n );\r\n $logout = sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\r\n wp_logout_url( home_url() ),\r\n esc_attr__( 'Log out of your account', 'emc' ),\r\n esc_html__( 'Log Out', 'emc' )\r\n );\r\n $toggle = sprintf( '<a class=\"emc-toggle-link\" title=\"%1$s\">%2$s</a>',\r\n esc_attr__( 'View your projects', 'emc' ),\r\n esc_html__( 'View your projects', 'emc' )\r\n );\r\n ?>\r\n <div class=\"container\">\r\n\t\t<div class=\"emc-logged-in-info\">\r\n\t\t\t<h2 class=\"emc-welcome-title\">\r\n\t\t\t\t<span class=\"emc-welcome-link\"><?php echo $logout; ?></span>\r\n\t\t\t\t<span class=\"emc-welcome-link\"><?php echo $edit; ?></span>\r\n\t\t\t\t<?php echo $welcome; ?>\r\n\t\t\t\t<?php echo $toggle; ?>\r\n\t\t\t</h2>\r\n\t\t\t<div class=\"emc-projects\">\r\n\t\t\t <?php foreach ( $groups as $group ) {\r\n\t\t\t \t$term = get_term_by( 'name', $group->name, 'emc_project' );\r\n\r\n\t\t\t \tif ( $term ) : ?>\r\n\r\n\t\t\t\t \t<div class=\"emc-project\">\r\n\t\t\t\t \t\t<h3 class=\"emc-project-title\"><?php echo esc_html( $term->name ); ?></h3>\r\n\t\t\t\t \t\t<?php emc_the_term_thumbnail( $term ); ?>\r\n\t\t\t\t \t\t<?php emc_the_project_content( $term ); ?>\r\n\t\t\t\t \t</div>\r\n\r\n\t\t\t \t<?php endif;\r\n\t\t\t\t} ?>\r\n\t\t\t</div><!-- .emc-projects -->\r\n\r\n\t\t</div><!-- .emc-logged-in-info -->\r\n\t</div>\r\n\r\n<?php }",
"public function index()\n {\n $UserLocated = $this->UserData->FUserLogedInData(); \n\n $dados = [\n 'titulo' => 'WarnerAcademy | My Profile.',\n 'UserData' =>$UserLocated\n ]; \n \n \n /* Se nao Estiver Logado Mostrar a Home Page como Default.*/\n $template = $this->twig->loadTemplate('MyProfile.html');\n $template->display($dados); \n }",
"function show_page() {\n\t$query = 'SELECT *, DATE_FORMAT(creation_date, \"%M %e, %Y\") AS formatted_creation FROM users WHERE id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" LIMIT 1';\n\t$result = DB::queryRaw($query);\t// have MySQL format the date for us\n\t\n\tif (mysqli_num_rows($result) != 1)\n\t\ttrigger_error('User not found', E_USER_ERROR);\n\t\n\t// ** User Found, info valid at this point **\n\t\n\t$row = mysqli_fetch_assoc($result);\n\t\n\t\n\t// Page header\n\tglobal $use_rel_external_script;\t// direct page_header to include some javascript that will make links\n\t$use_rel_external_script = true;\t// marked as rel=\"external\" open in a new tab while remaining XHTML-valid\n\t\n\tpage_header($row['name']);\t// the title of the page is the user's name; helpful if you open multiple users in different tabs\n\t\n\techo <<<HEREDOC\n <h1>View User</h1>\n \n\nHEREDOC;\n\t\n\t\n\t// Format Data\n\t$email_verified = 'No';\n\tif ($row['email_verification'] == '1')\n\t\t$email_verified = 'Yes';\n\t\t\n\t$cell = format_phone_number($row['cell']);\n\t\n\t$permissions = $row['permissions'];\n\t$account_type = 'Regular';\n\tif ($permissions == 'C')\n\t\t$account_type = 'Captain';\n\telse if ($permissions == 'A')\n\t\t$account_type = 'Non-Captain Admin';\n\telse if ($permissions == 'L')\n\t\t$account_type = 'Alumnus';\n\telse if ($permissions == 'T')\n\t\t$account_type = 'Temporary';\n\t\n\t// mailing list status\n\t$mailings = 'No';\n\tif ($row['mailings'] == '1')\n\t\t$mailings = 'Yes';\n\t\n\t\n\t// Format Approval Status line\n\t//\n\t// depending on whether the user is approved, banned, or in limbo, the link next to that\n\t// information needs to un-approve, un-ban, or approve/ban the user\n\t// eg. \"Approval Status: Approved (to un-approve, click here)\"\n\tif ($row['approved'] == '-1') {\n\t\t$approval_status = 'Banned';\n\t\t$approval_line = \" <span class=\\\"small\\\">(<a href=\\\"Edit_User?Approve&ID={$row['id']}&xsrf_token={$_SESSION['xsrf_token']}&Return=View\\\">approve</a> | <a href=\\\"Edit_User?Unapprove&ID={$row['id']}&xsrf_token={$_SESSION['xsrf_token']}&Return=View\\\">make pending</a>)</span>\";\n\t}\n\telse if ($row['approved'] == '0') {\n\t\t$approval_status = 'Pending';\n\t\t$approval_line = \" <span class=\\\"small\\\">(<a href=\\\"Edit_User?Approve&ID={$row['id']}&xsrf_token={$_SESSION['xsrf_token']}&Return=View\\\">approve</a> | <a href=\\\"Edit_User?Ban&ID={$row['id']}&xsrf_token={$_SESSION['xsrf_token']}&Return=View\\\">ban</a>)</span>\";\n\t}\n\telse if ($row['approved'] == '1') {\n\t\t$approval_status = 'Approved';\n\t\t$approval_line = \" <span class=\\\"small\\\">(<a href=\\\"Edit_User?Ban&ID={$row['id']}&xsrf_token={$_SESSION['xsrf_token']}&Return=View\\\">ban</a>)</span>\";\n\t}\n\t\t\n\techo <<<HEREDOC\n <table class=\"spacious\">\n <tr>\n <td>Name:</td>\n <td>\n <span class=\"b\">{$row['name']}</span>\n <span class=\"small\">(<a href=\"Edit_User?Change_Name&ID={$row['id']}&Return=View\">change</a>)</span>\n </td>\n </tr><tr>\n <td>Email Address:</td>\n <td class=\"b\"><a href=\"mailto:{$row['email']}\" rel=\"external\">{$row['email']}</a></td>\n </tr><tr>\n <td>Cell Phone Number: </td>\n <td class=\"b\">$cell</td>\n </tr><tr>\n <td>Year of Graduation:</td>\n <td>\n <span class=\"b\">{$row['yog']}</span>\n <span class=\"small\">(<a href=\"Edit_User?Change_YOG&ID={$row['id']}&Return=View\">change</a>)</span>\n <br /><br />\n </td>\n </tr><tr>\n <td>ID:</td>\n <td><span class=\"b\">{$row['id']}</span></td>\n </tr><tr>\n <td>Account Type:</td>\n <td>\n <span class=\"b\">$account_type</span>\n <span class=\"small\">(<a href=\"Edit_User?Change_Permissions&ID={$row['id']}&Return=View\">change</a>)</span>\n </td>\n </tr><tr>\n <td>Mailing List:</td>\n <td><span class=\"b\">$mailings</span></td>\n </tr><tr>\n <td>Approval Status:</td>\n <td>\n <span class=\"b\">$approval_status</span>\n $approval_line\n </td>\n </tr><tr>\n <td>Email Verified:</td>\n <td class=\"b\">$email_verified</td>\n </tr><tr>\n <td>Creation Date:</td>\n <td><span class=\"b\">{$row['formatted_creation']}</span></td>\n </tr><tr>\n <td>Registered From:</td>\n <td class=\"b\">{$row['registration_ip']}</td>\n </tr>\n </table>\n <br />\n <span class=\"small i\">Only users are able to edit their email address and cell phone number.</span>\nHEREDOC;\n\t\n\t// Show test scores\n\t$query = 'SELECT test_scores.score AS score, tests.name AS name, tests.total_points AS total, DATE_FORMAT(tests.date, \"%M %e, %Y\") AS formatted_date, test_scores.score_id AS score_id'\n\t\t\t. ' FROM test_scores'\n\t\t\t. ' INNER JOIN tests ON tests.test_id=test_scores.test_id'\n\t\t\t. ' WHERE test_scores.user_id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" AND archived=\"0\"'\n\t\t\t. ' ORDER BY tests.date DESC';\n\t$result = DB::queryRaw($query);\n\t\n\tif (mysqli_num_rows($result) > 0) {\n\t\techo <<<HEREDOC\n\n \n <br /><br /><br /><br /><br />\n <h4>Recent Test Scores</h4>\n <table class=\"contrasting\">\n <tr>\n <th>Test</th>\n <th>Score</th>\n <th>Maximum</th>\n <th>Date</th>\n <th></th>\n </tr>\n\nHEREDOC;\n\t\t\n\t\t$row = mysqli_fetch_assoc($result);\n\t\twhile ($row) {\n\t\t\techo <<<HEREDOC\n <tr>\n <td>{$row['name']}</td>\n <td class=\"text-centered\">{$row['score']}</td>\n <td class=\"text-centered\">{$row['total']}</td>\n <td>{$row['formatted_date']}</td>\n <td><a href=\"Delete_Score?ID={$row['score_id']}&xsrf_token={$_SESSION['xsrf_token']}\">Delete</a></td>\n </tr>\n\nHEREDOC;\n\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t}\n\t\t\n\t\techo <<<HEREDOC\n </table>\nHEREDOC;\n\t}\n\t\n\t$query = 'SELECT test_scores.score AS score, tests.name AS name, tests.total_points AS total, DATE_FORMAT(tests.date, \"%M %e, %Y\") AS formatted_date, test_scores.score_id AS score_id'\n\t\t\t. ' FROM test_scores'\n\t\t\t. ' INNER JOIN tests ON tests.test_id=test_scores.test_id'\n\t\t\t. ' WHERE test_scores.user_id=\"' . mysqli_real_escape_string(DB::get(),$_GET['ID']) . '\" AND archived=\"1\"'\n\t\t\t. ' ORDER BY tests.date DESC';\n\t$result = DB::queryRaw($query);\n\t\n\tif (mysqli_num_rows($result) > 0) {\n\t\techo <<<HEREDOC\n\n \n <br /><br />\n <h4>Old Test Scores</h4>\n <table class=\"contrasting\">\n <tr>\n <th>Test</th>\n <th>Score</th>\n <th>Maximum</th>\n <th>Date</th>\n <th></th>\n </tr>\n\nHEREDOC;\n\t\t\n\t\t$row = mysqli_fetch_assoc($result);\n\t\twhile ($row) {\n\t\t\techo <<<HEREDOC\n <tr>\n <td>{$row['name']}</td>\n <td class=\"text-centered\">{$row['score']}</td>\n <td class=\"text-centered\">{$row['total']}</td>\n <td>{$row['formatted_date']}</td>\n <td><a href=\"Delete_Score?ID={$row['score_id']}&xsrf_token={$_SESSION['xsrf_token']}\">Delete</a></td>\n </tr>\n\nHEREDOC;\n\t\t\t$row = mysqli_fetch_assoc($result);\n\t\t}\n\t\t\n\t\techo <<<HEREDOC\n </table>\nHEREDOC;\n\t}\n}",
"public function index(){\n \t$this->head = $this->fetch('head'); \n \t$this->foot = $this->fetch('foot');\n \t\n \t\n \tif(isset($_SESSION['user_id']))\n \t{\n \t\t\n \t}\n \telse\t\n \t{\n \t\t$this->whetherLogin = \"<div id=\\\"wb_login_btn\\\"></div>\";\n \t}\n \t\n \t$this->display(); \n \t\n }",
"function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }",
"public function user()\n\t{\n\t\t$this->validation_access();\n\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$pageActive = $this->uri->segment(5);\n\t\tif ($pageActive == 'settings'){\n\n\t\t\t$level = $this->user_model->getAttr('admin')['level'];\n\t\t\tif ($level == '1'){\n\t\t\t\t$levelName = 'Administrator';\n\t\t\t} else {\n\t\t\t\t$levelName = 'Karyawan';\n\t\t\t}\n\n\t\t\t$data = [\n\t\t\t\t\t\t'fullname' => $this->user_model->getAttr('admin')['fullname'],\n\t\t\t\t\t\t'level' => $levelName\n\t\t\t\t\t];\n\t\t\t$this->load->view('user_dashboard/myaccount_settings.php', $data);\n\t\t} else {\n\t\t\t$this->load->view('user_dashboard/myaccount_index.php');\n\t\t}\n\t\t\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function navigation_user(){\r\n $current_user = wp_get_current_user();\r\n if ( $current_user->display_name ) {\r\n $name = $current_user->display_name;\r\n } else {\r\n $name = esc_html__( 'Welcome!', 'woolentor-pro' );\r\n }\r\n $name = apply_filters( 'woolentor_profile_name', $name );\r\n ?>\r\n <div class=\"woolentor-user-area\">\r\n <div class=\"woolentor-user-image\">\r\n <?php echo get_avatar( $current_user->user_email, 125 ); ?>\r\n </div>\r\n <div class=\"woolentor-user-info\">\r\n <span class=\"woolentor-username\"><?php echo esc_attr( $name ); ?></span>\r\n <span class=\"woolentor-logout\"><a href=\"<?php echo esc_url( wp_logout_url( get_permalink() ) ); ?>\"><?php echo esc_html__( 'Logout', 'woolentor-pro' ); ?></a></span>\r\n </div>\r\n </div>\r\n <?php\r\n\r\n }",
"public function userAccount()\n\t{\n $per_page = 4;\n $total_rows = (new Task())->countRows()->execute();\n $total_pages = ceil($total_rows / $per_page);\n $data = (new Task())->all('0','4')->execute();\n $pages = ['total_pages' => $total_pages, 'current_page' => 1];\n $data = [$data, $pages];\n View::render('userprofile', $data);\n\t}",
"abstract protected function isUserLoggedIn() ;",
"function index() \n { \n $data['profile_info'] = $this->tank_auth->get_user_by_id($this->tank_auth->get_user_id(),TRUE);\n $data['profile_detail'] = $this->tank_auth->get_user_profile_detail($this->tank_auth->get_user_id()); \t \n $this->_template($data,$templatename='profile'); \n }",
"public function myAccount() {\n return $this->render('user/index.html.twig', [\n 'user' => $this->getUser()\n ]);\n }",
"function weldata_theme_lt_loggedinblock(){\n global $user;\n return l(check_plain($user->name), 'user/' . $user->uid) .' | ' . l(t('Log out'), 'user/logout');\n}",
"public function show()\n {\n return $this->responseOk(Auth::user());\n }",
"public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }",
"function printUserInfo(){\n\n\t\t/* Get User Info */\n\t\t$user = $this->getUserInfo();\n\n\t\t/* Check for Real Name */\n\t\tif($user->person->realname->_content){\n\t\t\t$name = $user->person->realname->_content;\n\t\t} else {\n\t\t\t$name = $user->person->username->_content;\n\t\t}\n\t\t$description = $user->person->description->_content;\n\n\n\t\t/* Add <br> tags */\n\t\t$description = str_replace(\"\\n\",'<br/>',$description);\n\n\t\t/* Generate output */\n\t\t$output = '<section class=\"person\" itemscope itemtype=\"http://schema.org/Person\">'; // Using some Microdata for Additional Searchability\n\t\t$output .= '<img src=\"http://farm'.$user->person->iconfarm.'.staticflickr.com/'.$user->person->iconserver.'/buddyicons/'.$user->person->nsid.'_r.jpg\" class=\"avatar\" itemprop=\"photo\" alt=\"'.$user->person->realname->_content.'\" />';\n\t\t$output .= '<h3 >Hi! I\\'m <span class=\"name\" itemprop=\"name\" rel=\"author\">'.$name.'</span></h3>';\n\t\t$output .= '<p class=\"description span6\" itemprop=\"description\">'.$description.'<br/><br/>View my Photos on <a href=\"'.$user->person->photosurl->_content.'\" target=\"_blank\" rel=\"autor\">Flickr</a>.</p>';\n\t\t$output .= '</section>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}",
"function m_dspUserAccount()\n\t{\n\t\tif(!isset($_SESSION['userid']) || $_SESSION['userid']==\"\")\n\t\t{\n\t\t\t#URL TEMPER\n\t\t\t$this->libFunc->m_mosRedirect($this->m_safeUrl(SITE_URL.\"user/index.php?action=user.loginForm\"));\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t#INTIALIZING TEMPLATES\n\t\t\t$this->ObTpl=new template();\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"\");\n\t\t\t$this->ObTpl->set_file(\"TPL_USER_FILE\", $this->userTemplate);\n\t\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_CURRENTINFO_BLK\",\"current_blk\");\n\t\t\t$this->ObTpl->set_block(\"TPL_CURRENTINFO_BLK\",\"TPL_ORDERLISTMAIN_BLK\",\"orderlistmain_blk\");\n\t\t\t$this->ObTpl->set_block(\"TPL_ORDERLISTMAIN_BLK\",\"TPL_ORDERLIST_BLK\",\"orderlist_blk\");\n\t\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_EDITACCOUNT_BLK\",\"edit_blk\");\n\t\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_CHANGEPASS_BLK\",\"changepass_blk\");\n\t\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"countryblk\",\"countryblks\");\n\t\t\t$this->ObTpl->set_block(\"TPL_EDITACCOUNT_BLK\",\"BillCountry\",\"nBillCountry\");\n\t\t\t$this->ObTpl->set_block(\"TPL_EDITACCOUNT_BLK\",\"TPL_NEWSLETTER_BLK\",\"news_blk\");\n\t\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"stateblk\",\"stateblks\");\n\t\t\t#INTIALIZING\n\t\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\n\t\t\t$this->ObTpl->set_var(\"news_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"current_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"edit_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"changepass_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"orderlistmain_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"orderlist_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"BILL_STATE\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATE\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATENAME\",\"\");\n\n\t\t\t$this->obTpl->set_var(\"TPL_VAR_BREDCRUMBS\",\" » My Account\");\n\n\t\t\t$accountUrl=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.home\");\n\t\t\tif(isset($this->request['msg']) && $this->request['msg']==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_PASSWORD_CHANGED);\n\t\t\t}\n\t\t\tif($this->err==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$this->errMsg);\n\t\t\t}\n\t\t\t\n\t\t\t#SAFE URLS\n\t\t\t$updateUrl=SITE_URL.\"user/index.php?action=user.home&mode=editDetails\";\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_UPDATEURL\",$this->libFunc->m_safeUrl($updateUrl));\n\t\t\t$changePassUrl=SITE_URL.\"user/index.php?action=user.home&mode=changePass\";\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHANGEPASSURL\",$this->libFunc->m_safeUrl($changePassUrl));\n\t\t\t$logoutUrl=SITE_URL.\"user/index.php?action=user.logout\";\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_LOGOUTURL\",$this->libFunc->m_safeUrl($logoutUrl));\n\t\t\t$reportsUrl=SITE_URL.\"user/index.php?action=user.home&mode=reports\";\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_REPORTS_URL\",$this->libFunc->m_safeUrl($reportsUrl));\n\n\n\t\t\t#QUERY DATABASE\n\t\t\t$this->obDb->query = \"SELECT * FROM \".CUSTOMERS.\" where iCustmerid_PK = '\".$_SESSION['userid'].\"'\";\n\t\t\t$row_customer = $this->obDb->fetchQuery();\n\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\tif($recordCount!=1)\n\t\t\t{\n\t\t\t\t$this->libFunc->m_sessionUnregister(\"userid\");\n\t\t\t\t$this->libFunc->m_sessionUnregister(\"username\");\n\t\t\t\t$retUrl=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.home\");\n\t\t\t\t$_SESSION['referer']=$retUrl;\n\t\t\t\t$siteUrl=SITE_URL.\"user/index.php?action=user.loginForm\";\n\t\t\t\t$this->libFunc->m_mosRedirect($this->libFunc->m_safeUrl($siteUrl));\n\t\t\t\texit;\n\t\t\t}\t\t\t\t\t\n\t\t\t$this->obDb->query = \"SELECT iStateId_PK, vStateName FROM \".STATES.\" ORDER BY vStateName\";\n\t\t\t$row_state = $this->obDb->fetchQuery();\n\t\t\t$row_state_count = $this->obDb->record_count;\n\t\t\t\n\t\t\t$this->obDb->query = \"SELECT iCountryId_PK, vCountryName, vShortName FROM \".COUNTRY.\" ORDER BY iSortFlag,vCountryName\";\n\t\t\t$row_country = $this->obDb->fetchQuery();\n\t\t\t$row_country_count = $this->obDb->record_count;\n\n\t\t\t# Loading billing country list\t\t\n\t\t\tfor($i=0;$i<$row_country_count;$i++)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"k\", $row_country[$i]->iCountryId_PK);\n\t\t\t\t$this->ObTpl->parse('countryblks','countryblk',true);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_COUNTRY_VALUE\", $row_country[$i]->iCountryId_PK);\n\t\t\t\t\n\t\t\t\tif($row_customer[0]->vCountry> 0)\n\t\t\t\t{\n\t\t\t\t\tif($row_customer[0]->vCountry == $row_country[$i]->iCountryId_PK)\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"selected=\\\"selected\\\"\");\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$row_customer[0]->vCountry = $row_country[$i]->iCountryId_PK;\n\t\t\t\t\tif($row_country[$i]->iCountryId_PK==251)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"selected=\\\"selected\\\"\");\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_COUNTRY_NAME\",$this->libFunc->m_displayContent($row_country[$i]->vCountryName));\n\t\t\t\t$this->ObTpl->parse(\"nBillCountry\",\"BillCountry\",true);\n\t\t\t}\n\t\t\tif(isset($row_customer[0]->vCountry) && $row_customer[0]->vCountry != '')\n\t\t\t\t$this->ObTpl->set_var('selbillcountid',$row_customer[0]->vCountry);\n\t\t\telse\n\t\t\t\t$this->ObTpl->set_var('selbillcountid',\"251\");\n\t\t\tif(isset($row_customer[0]->vState) && $row_customer[0]->vState != '')\n\t\t\t\t$this->ObTpl->set_var('selbillstateid',$row_customer[0]->vState);\n\t\t\telse\n\t\t\t\t$this->ObTpl->set_var('selbillstateid',\"0\");\n\t\t\t\n\t\t\t# Loading the state list here\n\t\t\t$this->obDb->query = \"SELECT C.iCountryId_PK as cid,S.iStateId_PK as sid,S.vStateName as statename FROM \".COUNTRY.\" C,\".STATES.\" S WHERE S.iCountryId_FK=C.iCountryId_PK ORDER BY C.vCountryName,S.vStateName\";\n\t\t\t$cRes = $this->obDb->fetchQuery();\n\t\t\t$country_count = $this->obDb->record_count;\n\n\t\t\tif($country_count == 0)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"countryblks\", \"\");\n\t\t\t\t$this->ObTpl->set_var(\"stateblks\", \"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t$loopid=0;\n\t\t\t\tfor($i=0;$i<$country_count;$i++)\n\t\t\t\t{\n\t\t\t\t\tif($cRes[$i]->cid==$loopid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$stateCnt++;\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$loopid=$cRes[$i]->cid;\n\t\t\t\t\t\t$stateCnt=0;\n\t\t\t\t\t}\n\t\t\t\t\t$this->ObTpl->set_var(\"i\", $cRes[$i]->cid);\n\t\t\t\t\t$this->ObTpl->set_var(\"j\", $stateCnt);\n\t\t\t\t\t$this->ObTpl->set_var(\"stateName\",$cRes[$i]->statename);\n\t\t\t\t\t$this->ObTpl->set_var(\"stateVal\",$cRes[$i]->sid);\n\t\t\t\t\t$this->ObTpl->parse('stateblks','stateblk',true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_FNAME\", $this->libFunc->m_displayContent($row_customer[0]->vFirstName));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_LNAME\", $this->libFunc->m_displayContent($row_customer[0]->vLastName));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_EMAIL\", $this->libFunc->m_displayContent($row_customer[0]->vEmail));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PASS\", $this->libFunc->m_displayContent($row_customer[0]->vPassword));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ADDRESS1\", $this->libFunc->m_displayContent($row_customer[0]->vAddress1 ));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ADDRESS2\", $this->libFunc->m_displayContent($row_customer[0]->vAddress2 ));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CITY\", $this->libFunc->m_displayContent($row_customer[0]->vCity));\n\t\t\tif($row_customer[0]->vState>1)\n\t\t\t{\n\t\t\t\t$this->obDb->query = \"SELECT vStateName FROM \".STATES.\" where iStateId_PK = '\".$row_customer[0]->vState.\"'\";\n\t\t\t\t$row_state = $this->obDb->fetchQuery();\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATE\",\n\t\t\t\t$this->libFunc->m_displayContent($row_state[0]->vStateName));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATENAME\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vStateName));\n\t\t\t}\n\t\t\t$this->obDb->query = \"SELECT vCountryName FROM \".COUNTRY.\" where iCountryId_PK = '\".$row_customer[0]->vCountry.\"' order by vCountryName\";\n\t\t\t\t$row_country = $this->obDb->fetchQuery();\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_COUNTRY\",\n\t\t\t\t$this->libFunc->m_displayContent($row_country[0]->vCountryName));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ZIP\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vZip));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_COMPANY\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vCompany));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PHONE\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vPhone));\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HOMEPAGE\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vHomePage));\n\t\t\tif($row_customer[0]->iMailList==1)\n\t\t\t{\n\t\t\t\t$maillist=\"HTML\";\n\t\t\t}\n\t\t\telseif($row_customer[0]->iMailList==2)\n\t\t\t{\n\t\t\t\t$maillist=\"Plain text \";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$maillist=\"None\";\n\t\t\t}\n\n\t\t\tif(MAIL_LIST==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_NEWSLETTER\",$maillist);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_NEWSLETTER\",$maillist.\"(opt-out)\");\n\t\t\t}\n\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SIGNUPDATE\",\n\t\t\t$this->libFunc->dateFormat1($row_customer[0]->tmSignupDate));\n\n\t\t\tif($row_customer[0]->iMailList==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK1\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\telseif($row_customer[0]->iMailList==2)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK2\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK3\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\n\t\t\tif(!isset($this->request['mode']) || empty($this->request['mode']))\n\t\t\t{\n\t\t\t\t$this->m_displayInvoiceList();\n\t\t\t\t$this->ObTpl->parse(\"current_blk\",\"TPL_CURRENTINFO_BLK\");\n\t\t\t}\n\t\t\telseif($this->request['mode']==\"editDetails\")\n\t\t\t{\n\t\t\t\t#DISPLAY EDIT ACCOUNT FORM\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BREDCRUMBS\",\" » <a href=\".$accountUrl.\">My Account</a> » Update Information\");\n\t\t\t\tif(MAIL_LIST==1)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->parse(\"news_blk\",\"TPL_NEWSLETTER_BLK\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"edit_blk\",\"TPL_EDITACCOUNT_BLK\");\n\t\t\t}\n\t\t\telseif($this->request['mode']==\"changePass\")\n\t\t\t{\n\t\t\t\t#DISPLAY CHANGEPASS FORM\n\t\t\t\t$this->obTpl->set_var(\"TPL_VAR_BREDCRUMBS\",\" » <a href=\".$accountUrl.\">My Account</a> » Change Password\");\n\t\t\t\t$this->ObTpl->parse(\"changepass_blk\",\"TPL_CHANGEPASS_BLK\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->m_displayInvoiceList();\n\t\t\t\t$this->ObTpl->parse(\"current_blk\",\"TPL_CURRENTINFO_BLK\");\n\t\t\t}\n\t\t\n\t\t\treturn($this->ObTpl->parse(\"return\",\"TPL_USER_FILE\"));\n\t\t}#END ELSE LOOP\n\t\n\t}",
"function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}",
"protected function isLoggedIn() {\n\t\t$page = $this->GetPage($this->purl.'?op=view_account', $this->cookie, 0, $this->purl);\n\t\tif (stripos($page, '/?op=logout') === false && stripos($page, '/logout') === false) return false;\n\t\treturn $page;\n\t}",
"public function getLogIn(){\n\n\t\treturn View::make('account.login');\n\t}",
"public function index()\n {\n // Get the currently authenticated user...\n $user = Auth::user();\n return view('member.account', compact('user'));\n }",
"public function information()\n {\n $user = Auth::user();\n return view('user.profileInfo', compact('user'));\n }",
"function show() {\n // Process request with using of models\n $user = Service::get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n $view = 'user/show';\n return $this->render($view, $data);\n } else {\n return Application::error403();\n }\n}",
"public function information() \n\t{\n UserModel::authentication();\n\n\t\t//get the activity\n\t\t$timeline = ActivityModel::timeline();\n\t\t\n $this->View->Render('user/timeline', ['timeline' => $timeline]);\n }",
"public function is_logged_in() {\n\n\t}",
"public function userInfo()\n {\n $this->startBrokerSession();\n $user = null;\n\n $userId = $this->getSessionData('sso_user');\n\n if ($userId) {\n $user = $this->getUserInfo($userId);\n if (!$user) return $this->fail(\"User not found\", 500); // Shouldn't happen\n }\n\n header('Content-type: application/json; charset=UTF-8');\n echo json_encode($user);\n }",
"public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }",
"public function setProfileInformation()\n {\n $view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t$this->getUserInformations($view,$username);\n\t\t$this->setResourcesUploaded($view,$username);\n\t\treturn $view->fetch('profile.tpl');\n\t}",
"public function user()\n\t{\n\n\t\t$user = $this->current_user ? $this->current_user : $this->ion_auth->get_user();\n\n\t\techo json_encode($user);die;\n\t}",
"public function account()\n {\n return view('profil.account', ['id' => auth()->id(), 'page' => 2]);\n }",
"function pnUserLoggedIn()\r\n{\r\n if(pnSessionGetVar('uid')) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"public final function display(){\n echo \"Username is{$this->user} and user id is{$this->userId}\";\n }",
"function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}",
"public function userAccount()\n {\n $recipes= $this->getDoctrine()\n ->getRepository(Recipe::class)\n ->findAll();\n $user = $this->getUser();\n $reviews= $this->getDoctrine()\n ->getRepository(Review::class)\n ->findAll();\n $user = $this->getUser();\n return $this->render('user/show.html.twig', [\n 'user' => $user,\n 'recipes' => $recipes,\n 'reviews' => $reviews,\n ]);\n\n }",
"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 }",
"function user_user_profile($CI,$user){\n\t\t$CI->user->head($user);\n\t}",
"public function indexAction()\n {\n $this->view->setVar('logged_in', is_array($this->auth->getIdentity()));\n \n }"
] | [
"0.73454934",
"0.71608096",
"0.7129549",
"0.71237254",
"0.69842905",
"0.696578",
"0.6953128",
"0.6926733",
"0.687448",
"0.67931473",
"0.675132",
"0.6699616",
"0.6661584",
"0.6658045",
"0.6650993",
"0.66439354",
"0.6643903",
"0.66413444",
"0.66325027",
"0.66321415",
"0.66311276",
"0.66024894",
"0.658045",
"0.6557245",
"0.6551122",
"0.6529621",
"0.6506265",
"0.65002245",
"0.6455734",
"0.6455734",
"0.6454065",
"0.6452242",
"0.6452242",
"0.6452242",
"0.6452242",
"0.6437546",
"0.639767",
"0.6362233",
"0.6361172",
"0.6358512",
"0.6352525",
"0.63523126",
"0.6345061",
"0.6341672",
"0.63342947",
"0.6332626",
"0.6332439",
"0.6331299",
"0.6328691",
"0.63235325",
"0.6313136",
"0.6311083",
"0.63093334",
"0.63086253",
"0.6301255",
"0.62954956",
"0.6292713",
"0.6291726",
"0.6280166",
"0.6279109",
"0.6272708",
"0.6272393",
"0.6269308",
"0.62642926",
"0.6256289",
"0.6253283",
"0.6251834",
"0.62503016",
"0.6249255",
"0.6242454",
"0.6229679",
"0.62278706",
"0.62270576",
"0.6222463",
"0.6219969",
"0.62051797",
"0.6200516",
"0.6196151",
"0.6191464",
"0.61895967",
"0.61827564",
"0.6179021",
"0.61762685",
"0.61757207",
"0.6174704",
"0.6169103",
"0.6164463",
"0.6152784",
"0.6151663",
"0.61441314",
"0.61424816",
"0.6137853",
"0.6122517",
"0.6120414",
"0.61149997",
"0.61141336",
"0.6112824",
"0.61080366",
"0.6099059",
"0.6095318"
] | 0.78777677 | 0 |
Displays the current progress and Steps done/ to be done. | public function progress() {
$data = array();
if (!$this->user->is_logged_in()) {
redirect("/account/info");
}
$this->user->get_user($this->user->getMyId());
$data['user'] = $this->user;
$data['current'] = str_replace('overview', 'play', $this->user->get_next_step());
$this->load->view('account/progress', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function showProgress()\n {\n $allQuestions = $this->questionRepository->list(['id', 'question']);\n $this->transformProgressList($allQuestions);\n\n $this->console->info( ' ************ Your progress is ************');\n\n foreach ($this->progress as $option) {\n $validate = $option['is_true'] ? __('True') : __('False');\n $this->console->info( ' Question: ' . $option['question']);\n if(null !== $option['is_true'])\n $this->console->info( ' Answer: ' . $option['answer'] . '('.$validate .')');\n $this->console->info( ' ');\n }\n $this->console->info( ' *******************************************');\n }",
"private function display_progress_bar($args){\n $number_of_steps = count($this->step_ids);\n $current_step = $args['step'];\n\n echo '<ul class=\"list-unstyled\">';\n for($i = 1; $i < $number_of_steps - 1; $i++){\n echo '<li style=\"display:inline-block; margin-right:15px;\">Step ' . $i . '</li>';\n }\n echo '</ul>';\n }",
"public function render()\n {\n $this->currentStepId = array_search($this->currentStepName, $this->steps);\n $this->totalNumberOfSteps = count($this->steps);\n\n $this->percentDone = round(($this->currentStepId) * 100 / ($this->totalNumberOfSteps - 1));\n $this->percentToDo = 100 - $this->percentDone;\n\n $this->nextModuleName = '';\n if (isset($this->steps[$this->currentStepId + 1])) {\n $this->nextModuleName = $this->steps[$this->currentStepId + 1];\n }\n $this->previousModuleName = '';\n if (isset($this->steps[$this->currentStepId - 1])) {\n $this->previousModuleName = $this->steps[$this->currentStepId - 1];\n }\n $this->previousPreviousModuleName = '';\n if (isset($this->steps[$this->currentStepId - 2])) {\n $this->previousPreviousModuleName = $this->steps[$this->currentStepId - 2];\n }\n\n $this->piwikVersion = Version::VERSION;\n\n return parent::render();\n }",
"private function showAnswers() : void\n {\n $this->showProgress();\n }",
"protected function printProgress($action, $current, $total) {\n $progress = $total - $current;\n $percent = round(($progress / $total) * 100);\n echo \"<p><b><i>{$action}: {$progress} of {$total} (~{$percent}%)</i></b></p>\";\n flush();\n }",
"public static function step()\n\t{\n\t\tself::show(self::$_step++);\n\t}",
"function show_completed_page(&$infos)\n\t\t{\n\t\t\t$this->t->set_file('activity_completed', 'activity_completed.tpl');\n\t\t\t$this->t->set_block('activity_completed', 'report_row', 'rowreport');\n\t\t\t//build an icon array for show_engine_infos\n\t\t\t$icon_array = Array();\n\t\t\t\n\t\t\t$icon_array['ok'] \t\t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'check').'\">';\n\t\t\t$icon_array['failure'] \t\t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'stop').'\">';\n\t\t\t$icon_array['transition'] \t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'transition').'\">';\n\t\t\t$icon_array['transition_human'] = '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'transition_human').'\">';\n\t\t\t$icon_array['activity'] \t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'auto_activity').'\">';\n\t\t\t$icon_array['dot'] \t\t= '<img src=\"'.$GLOBALS['egw']->common->image('workflow', 'puce').'\"> ';\n\t\t\t$this->show_engine_infos($infos, $icon_array);\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'wf_procname'\t=> $this->process_name,\n\t\t\t\t'procversion'\t=> $this->process_version,\n\t\t\t\t'actname'\t=> $this->activity_name,\n\t\t\t\t'rowreport'\t=> '',\n\t\t\t));\n\n\t\t\t$this->translate_template('activity_completed');\n\t\t\t$this->t->pparse('output', 'activity_completed');\n\t\t\t$this->show_after_running_page();\n\t\t}",
"public function actionProgress($total=100){\n $select = $this->select('pilih sample : ', [1=>'sample1', 2=>'sample2']);\n if($select==1){\n Console::startProgress(0, $total);\n for ($n = 1; $n <= $total; $n++) {\n usleep($total);\n Console::updateProgress($n, $total);\n }\n Console::endProgress();\n }\n else{\n # Git clone like progress (showing only status information):\n Console::startProgress(0, $total, 'Counting objects: ', false);\n for ($n = 1; $n <= $total; $n++) {\n usleep($total);\n Console::updateProgress($n, $total);\n }\n Console::endProgress(\"done.\" . PHP_EOL);\n }\n }",
"public function progressAction(){\n $groupID = $this->_request->getParam('g');\n \n $group_DB = new Application_Model_DbTable_Group();\n $groupName = $group_DB->getName($groupID);\n $this->view->group_name = $groupName;\n \n $plans_DB = new Application_Model_DbTable_Planing();\n if (!isset($_SESSION['Default']['field'])) {\n $this->view->field_error = true;\n } else {\n $plans = $plans_DB->getByGroup ($groupID, $_SESSION['Default']['field']);\n $this->view->plans = $plans;\n\n $this->view->groupID = $groupID;\n }\n }",
"public function completed()\r\n {\r\n set_meta('title', 'Done');\r\n $progress = app()->make(Progress::class);\r\n $progress->reset();\r\n\r\n return view('antares/installer::installation.completed');\r\n }",
"public function showInstallProgress()\r\n {\r\n return redirect()->to(handles('antares::install/progress'));\r\n }",
"protected function UpdateProgress($action, $done=0, $total=0)\n\t{\n\t\tstatic $lastPercent;\n\t\tif($total > 0) {\n\t\t\t$percent = ceil($done/$total*100);\n\t\t}\n\t\telse {\n\t\t\t$percent = 100;\n\t\t}\n\t\t// We only show an updated progress bar if the rounded percentage has actually chanegd\n\t\tif($percent == $lastPercent) {\n\t\t\treturn;\n\t\t}\n\n\t\t$lastPercent = $percent;\n\t\t$action = sprintf($action, $done, $total);\n\t\techo \"<script type='text/javascript'>\\n\";\n\t\techo sprintf(\"self.parent.UpdateProgress('%s', '%s');\", str_replace(array(\"\\n\", \"\\r\", \"'\"), array(\" \", \"\", \"\\\\'\"), $action), $percent);\n\t\techo \"</script>\";\n\t\tflush();\n\t}",
"public function progress()\n\t{\n\t\t$data['user'] \t\t\t= $this->user;\n \t$iduser \t\t\t\t= $this->user['iduser'];\n \t\n\t\t$get_header \t\t\t= $this->db->get_where('header', array('header_is_displayed' => 'Y'));\n\t\t$get_footer \t\t\t= $this->db->get_where('footer', array('footer_is_displayed' => 'Y'));\n\t\t\n\t\t$namalengkap = $this->userform_model->ambilnama($iduser);\n $nama = $namalengkap->nama_lengkap;\n\t\t//print_r($nama); die;\n\t\t$data['nama']\t\t= $nama;\n\t\t$data['get_header']\t\t= $get_header;\n\t\t$data['get_footer']\t\t= $get_footer;\n\t\t$this->load->view('progress', $data);\n\t}",
"function show_migrate_multisite_files_progress( $current, $total ) {\n echo \"<span style='position: absolute;z-index:$current;background:#F1F1F1;'>Parsing Blog \" . $current . ' - ' . round($current / $total * 100) . \"% Complete</span>\";\n echo(str_repeat(' ', 256));\n if (@ob_get_contents()) {\n @ob_end_flush();\n }\n flush();\n}",
"public function displayFinished() \n {\n if ($this->has_finished) {\n return '<i style=\"font-size:25px;color:#449D44;\" class=\"fa fa-check\" aria-hidden=\"true\"></i>';\n } else {\n return '<i style=\"font-size:25px;color:#C9302C;\" class=\"fa fa-times\" aria-hidden=\"true\"></i>';\n }\n }",
"function renderProgress($tot_complete, $tot_failed, $total, $show_title = false) {\n\t\n\tif($total == 0) return '';\n\t$perc_complete \t= round(($tot_complete / $total) * 100, 2);\n\t$perc_failed \t= round(($tot_failed / $total) * 100, 2);\n\t\n\t$title = str_replace('[total]', $total, Lang::t('_PROGRESS_TITLE', 'course'));\n\t$title = str_replace('[complete]', $tot_complete, $title);\n\t$title = str_replace('[failed]', $tot_failed, $title);\n\t\n\t$html = '';\n\tif($show_title === true) $html .= '<span class=\"progress_title\">'.$title.'</span><br />';\n\tif($perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_complete\" title=\"'.$title.'\">'\n\t\t\t.'<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} elseif($perc_failed + $perc_complete >= 100) {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_failed\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t} else {\n\t\t\n\t\t$html .= \"\\n\".'<div class=\"box_progress_bar\" title=\"'.$title.'\">';\n\t\tif($perc_complete != 0) $html .= '<div class=\"bar_complete\" style=\"width: '.$perc_complete.'%;\"></div>';\n\t\tif($perc_failed != 0) $html .= '<div class=\"bar_failed\" style=\"width: '.$perc_failed.'%;\"></div>';\n\t\t$html .= '<div class=\"nofloat\">'\n\t\t\t.'</div></div>'.\"\\n\";\n\t}\n\t\n\treturn $html;\n}",
"public function showResults()\n {\n $tracker = Tracker::getInstance();\n\n $tracker->outputStats();\n if (count($tracker->getFailures())) {\n $tracker->output(\"\\nFAILURES\\n\", null, null, true);\n $tracker->outputFailures();\n }\n\n if (count($tracker->getErrors())) {\n $tracker->output(\"\\nERRORS\\n\");\n $tracker->outputErrors();\n }\n\n $tracker->output(\"\\n\");\n\n if (count($tracker->getFailures())) {\n return;\n }\n\n if ($this->coverageDirectory()) {\n $tracker->output('Generating coverage report as html...' . \"\\n\");\n $this->_generateCoverageHtml();\n return $tracker->output('Done' . \"\\n\");\n }\n\n if ($this->showCoverage()) {\n $this->_generateCoverageCommandLine();\n return;\n }\n }",
"function showUploadCompletePage() {\n\t\t$this->setCacheLevelNone();\n\t\t$this->render($this->getTpl('uploadComplete', '/account'));\t\t\n\t\n\t}",
"public function form_footer_progress_status_percentage_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-percentage\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s - Percentage of fields completed. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%s%% completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\">100</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}",
"protected function getDisplayText($step) {\n $numPackages = sizeof($this->workPackages);\n return ($step>=0 && $step<$numPackages) ? $this->workPackages[$step]['name'].\" ...\" :\n ($step>=$numPackages ? \"Done\" : \"\");\n }",
"public function getOutput() {\n if($this->strLogfile != \"\") {\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_log\", true);\n $this->strLogfile = $this->objTemplates->fillTemplate(\n array(\n \"log_content\" => $this->strLogfile,\n \"systemlog\" => $this->getLang(\"installer_systemlog\")\n ), $strTemplateID\n );\n }\n\n\n //build the progress-entries\n $strCurrentCommand = (isset($_GET[\"step\"]) ? $_GET[\"step\"] : \"\");\n if($strCurrentCommand == \"\")\n $strCurrentCommand = \"phpsettings\";\n\n $arrProgressEntries = array(\n \"phpsettings\" => $this->getLang(\"installer_step_phpsettings\"),\n \"config\" => $this->getLang(\"installer_step_dbsettings\"),\n \"loginData\" => $this->getLang(\"installer_step_adminsettings\"),\n \"modeSelect\" => $this->getLang(\"installer_step_modeselect\"),\n \"install\" => $this->getLang(\"installer_step_modules\"),\n \"samplecontent\" => $this->getLang(\"installer_step_samplecontent\"),\n \"finish\" => $this->getLang(\"installer_step_finish\"),\n );\n\n $strProgress = \"\";\n $strTemplateEntryTodoID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_progress_entry\", true);\n $strTemplateEntryCurrentID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_progress_entry_current\", true);\n $strTemplateEntryDoneID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_progress_entry_done\", true);\n\n $strTemplateEntryID = $strTemplateEntryDoneID;\n foreach($arrProgressEntries as $strKey => $strValue) {\n $arrTemplateEntry = array();\n $arrTemplateEntry[\"entry_name\"] = $strValue;\n\n //choose the correct template section\n if($strCurrentCommand == $strKey) {\n $strProgress .= $this->objTemplates->fillTemplate($arrTemplateEntry, $strTemplateEntryCurrentID, true);\n $strTemplateEntryID = $strTemplateEntryTodoID;\n }\n else\n $strProgress .= $this->objTemplates->fillTemplate($arrTemplateEntry, $strTemplateEntryID, true);\n\n }\n $arrTemplate = array();\n $arrTemplate[\"installer_progress\"] = $strProgress;\n $arrTemplate[\"installer_version\"] = $this->strVersion;\n $arrTemplate[\"installer_output\"] = $this->strOutput;\n $arrTemplate[\"installer_forward\"] = $this->strForwardLink;\n $arrTemplate[\"installer_backward\"] = $this->strBackwardLink;\n $arrTemplate[\"installer_logfile\"] = $this->strLogfile;\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_main\", true);\n\n $strReturn = $this->objTemplates->fillTemplate($arrTemplate, $strTemplateID);\n $strReturn = $this->callScriptlets($strReturn);\n $this->objTemplates->setTemplate($strReturn);\n $this->objTemplates->deletePlaceholder();\n $strReturn = $this->objTemplates->getTemplate();\n return $strReturn;\n }",
"public function form_footer_progress_status_proportion_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-proportion\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %1$s - Number of fields completed, %2$s - Number of fields in total. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%1$s of %2$s completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\"></span>',\n\t\t\t\t'<span class=\"completed-of\"></span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-proportion-completed\" style=\"display: none\">\n\t\t\t<?php \\esc_html_e( 'Form completed', 'wpforms-conversational-forms' ); ?>\n\t\t</div>\n\t\t<?php\n\t}",
"private function renderOutputWithController() \n\t{\n\t\tprintf('%s', $this->controller->go());\n\t}",
"public function render()\n {\n $queue_size = $this->manager->getQueueSize();\n $worker_statuses = $this->manager->getWorkerStatuses();\n\n $this->clear();\n $this->line('Spider Manager Dashboard. Press Ctrl+C to exit.');\n $this->line('Queue size: ' . $queue_size);\n\n $this->hr();\n foreach ($worker_statuses as $i => $status) {\n $status = $status == WorkerStatus::WORKING ? $this->green($status) : $this->gray($status);\n $this->line('Worker '.sprintf('%04d', $i).': '.$status);\n }\n $this->hr();\n }",
"public static function print_progress($copied, $skipped)\n {\n echo \"\\033[30D\";\n echo \"Copied: \" . str_pad($copied, 6, ' ', STR_PAD_RIGHT) . \" Skipped: \" . str_pad($skipped, 6, ' ', STR_PAD_RIGHT); \n }",
"public function display()\n\t{\n\t\tprint_r(\"<br/>RedheadDuck looks like this!<br/>\");\n\t}",
"function show_answers_progress($real_taskcount, $taskcount, $pid, $colspan = -1){\n\t\n\tif($colspan == -1){\n\t\t$colspan = \"\";\n\t}else{\n\t\t$colspan = \" colspan = '$colspan'\";\n\t}\n\t\n\t//taskcount formatting\n\t$delta_tc = $taskcount - $real_taskcount;\n\t$const = 60;\n\tif($delta_tc >= 0 || $taskcount == 0){\n\t\t$width = $const;\n\t}else{\n\t\t$width = $const * $taskcount / $real_taskcount;\n\t\t$sec_width = $const * abs($delta_tc) / $real_taskcount;\n\t}\n\t\n\techo \"<td$colspan>\n\t\t<meter id='bar$pid' min='0' max='100' low='25' high='75' optimum='100' value='\";\n\tif($taskcount == 0){\n\t\techo \"0\";\n\t}else{\n\t\techo $real_taskcount / $taskcount * 100;\n\t}\n\techo \"' style='width:\".$width.\"%;'></meter>\";\n\tif($delta_tc < 0 && $taskcount != 0){\n\t\techo \"<meter min='0' max='100' low='0' high='0' optimum='0' value='100' style='width:\".$sec_width.\"%;'></meter>\";\n\t}\n\techo \"<label for='bar$pid'> $real_taskcount/$taskcount</label>\";\n\techo \"</td>\";\n}",
"function flush() {\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t <div class=\"progressbar\" style=\"position:relative;overflow:hidden; height: <?php echo $this->height ; ?>px;width:<?php echo $this->length ; ?>px;\">\r\n\t\t\t\t<img src=\"<?php echo plugin_dir_url(\"/\").\"/\".str_replace(basename(__FILE__),\"\",plugin_basename( __FILE__)); ?>/img/progressbar.png\" style='position:absolute;left:0;top:-<?php echo floor(2*$this->height) ; ?>px;height:<?php echo floor(3*$this->height) ; ?>px;width:<?php echo $this->length ; ?>px;'/>\r\n\t\t\t\t<img id=\"<?php echo $this->id.\"_image\"; ?>\" src=\"<?php echo plugin_dir_url(\"/\").\"/\".str_replace(basename(__FILE__),\"\",plugin_basename( __FILE__)); ?>/img/progressbar.png\" style='position:absolute;left:0;top:0px;height:<?php echo floor(3*$this->height) ; ?>px;width:<?php echo floor($this->length*$this->start/100) ; ?>px;'/>\r\n\t\t\t\t<div id=\"<?php echo $this->id.\"_text\"; ?>\" style='position:absolute;left:0;top:0px;height:<?php echo $this->height; ?>px;text-align:center;line-height:<?php echo $this->height; ?>px;width:<?php echo $this->length ; ?>px;'><?php echo $this->insideText?> </div>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean();\r\n\t\t}",
"public function actionDetails()\n\t{\n\t $this->layout='main';\n\t \n $user_data = Users::model()->findByPk(Yii::app()->user->id);\n $step_completed = $user_data->step_completed;\n\n if($user_data->user_role == 2 && $step_completed < 5){\n $this->render('start', ['step_completed' =>$step_completed]);\n }else{ $this->render('details'); }\t\n\t}",
"public static function progress($done, $total, $msg = '', $msglen = null)\n\t\t{\n\t\t\tif ($done <= $total) {\n\t\t\t\t$size = self::get_width();\n\t\t\t\t$msglen = is_null($msglen) ? strlen($msg):$msglen;\n\t\t\t\t$psize = abs($size - $msglen - 12);\n\n\t\t\t\t$perc = (double) ($done/$total);\n\t\t\t\t$bar = floor($perc*$psize);\n\n\t\t\t\t$status_bar = \"\\r [\";\n\t\t\t\t$status_bar .= str_repeat(\"=\", $bar);\n\n\t\t\t\tif ($bar < $psize) {\n\t\t\t\t\t$status_bar .= \">\";\n\t\t\t\t\t$status_bar .= str_repeat(\" \", $psize - $bar -1);\n\t\t\t\t} else {\n\t\t\t\t\t$status_bar.=\"=\";\n\t\t\t\t}\n\n\t\t\t\t$disp = number_format($perc*100, 0);\n\t\t\t\t$status_bar .= \"] $disp%\";\n\n\t\t\t\t$left = $total - $done;\n\t\t\t\t$status_bar .= \": \".$msg;\n\n\t\t\t\tif (($blank = $size - strlen($status_bar)) > 0) {\n\t\t\t\t\t$status_bar .= str_repeat(' ', $blank);\n\t\t\t\t}\n\n\t\t\t\techo $status_bar;\n\t\t\t\tflush();\n\n\t\t\t\tif($done == $total) {\n\t\t\t\t\t\\Helper\\Cli::out();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function showHotfixSteps()\n\t{\n\t\t$this->showUpdateSteps(true);\n\t}",
"function icu_drush_print_progress($label, $current=NULL, $range=NULL) {\n static $green = \"\\033[1;32m\";\n static $white = \"\\033[0;37m\";\n\n if (is_null($current)) {\n $output = $green . \"Progress: $label \\n\";\n print $output;\n return;\n }\n\n $ratio = ($current+1) / $range;\n $percentage = floor($ratio * 100) . '%';\n $columns = drush_get_context('DRUSH_COLUMNS', 80);\n // Subtract 10 characters for the percentage, brackets, spaces and arrow.\n $progress_columns = $columns - 10;\n // If ratio is 1 (complete), the > becomes a = to make a full bar.\n $arrow = ($ratio < 1) ? '>' : '=';\n // Print a new line if ratio is 1 (complete). Otherwise, use a CR.\n $line_ending = ($ratio < 1) ? \"\\r\" : \"\\n\";\n\n // Determine the current length of the progress string.\n $current_length = floor($ratio * $progress_columns);\n $progress_string = str_pad('', $current_length, \"=\");\n\n $output = $green . '[';\n $output .= $progress_string . $arrow;\n $output .= str_pad('', $progress_columns - $current_length);\n $output .= ']';\n $output .= str_pad('', 5 - strlen($percentage)) . $percentage;\n $output .= $line_ending . $white;\n\n print $output;\n}",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"function renderStepDisplay() {\n\t\t$stepsSpans = '';\n\t\tif (is_array ($this->steps)) {\n\t\t\t$stepTitle = $this->steps[$this->currentStep]['label'];\n\t\t\t$counter = 1;\n\t\t\tforeach ($this->steps as $stepNr => $stepConf) {\n\t\t\t\t$stepsSpans .= '<span class=\"tx-frontendformslib-steps-'.($this->currentStep == $stepNr ? 'active' : 'inactive').'\">'.$this->steps[$stepNr]['label'].'</span>';\n\t\t\t\t$counter ++;\n\t\t\t}\n\n\t\t\t$output = '\n\t\t\t\t<div class=\"tx-frontendformslib-steps\">\n\t\t\t\t\t'.$stepsSpans.'\n\t\t\t\t</div>\n\t\t\t';\n\t\t}\n\t\treturn $output;\n\t}",
"public function actionIndex()\n {\n $this->stdout(\"\\n Example Module Base Command: \" . date('d.m.y h:i:s') . \" Done!\\n\");\n }",
"public function show_progress($value)\r\n\t{\r\n\t\t$this->buffer->show_progress($value);\r\n\t}",
"function displayFinishSetup()\n\t{\n\t\t$this->checkDisplayMode(\"finish_setup\");\n\t\t$this->no_second_nav = true;\n//echo \"<b>1</b>\";\n\t\tif ($this->validateSetup())\n\t\t{\n\t\t\t$txt_info = $this->lng->txt(\"info_text_finish1\").\"<br /><br />\".\n\t\t\t\t\"<p>\".$this->lng->txt(\"user\").\": <b>root</b><br />\".\n\t\t\t\t$this->lng->txt(\"password\").\": <b>homer</b></p>\";\n\t\t\t$this->setButtonNext(\"login_new\",\"login\");\n//echo \"<b>2</b>\";\n\t\t\t$this->setup->getClient()->reconnect();\t\t// if this is not done, the writing of\n\t\t\t\t\t\t\t\t\t\t\t// the setup_ok fails (with MDB2 and a larger\n\t\t\t\t\t\t\t\t\t\t\t// client list), alex 17.1.2008\n\t\t\t$this->setup->getClient()->setSetting(\"setup_ok\",1);\n//$this->setup->getClient()->setSetting(\"zzz\", \"Z\");\n//echo \"<b>3</b>\";\n\t\t\t$this->setup->getClient()->status[\"finish\"][\"status\"] = true;\n//echo \"<b>4</b>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$txt_info = $this->lng->txt(\"info_text_finish2\");\n\t\t}\n\n//echo \"<b>5</b>\";\n\t\t// output\n\t\t$this->tpl->addBlockFile(\"SETUP_CONTENT\",\"setup_content\",\"tpl.clientsetup_finish.html\", \"setup\");\n\t\t$this->tpl->setVariable(\"TXT_INFO\",$txt_info);\n\n\t\t$this->setButtonPrev(\"nic\");\n//echo \"<b>6</b>\";\n\t\t$this->checkPanelMode();\n//echo \"<b>7</b>\";\n\t}",
"private function showProjectInfo()\n {\n // URLs\n $this->output->writeln('');\n $this->output->writeln('<info>'. $this->project->getName(false) .'</info> has now been created.');\n $this->output->writeln('<comment>Development:</comment> ' . $this->project->getDevUrl());\n $this->output->writeln('<comment>Staging:</comment> ' . $this->project->getStagingUrl());\n $this->output->writeln('<comment>Production:</comment> N/A');\n\n // Database credentials\n $databaseCredentials = $this->project->getDatabaseCredentials('dev');\n $this->output->writeln('');\n $this->output->writeln('<info>Development MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n\n $databaseCredentials = $this->project->getDatabaseCredentials('staging');\n $this->output->writeln('');\n $this->output->writeln('<info>Staging MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n $this->output->writeln('');\n\n // We're done!\n $this->output->writeln('<info>You can now run \"cd '. $this->project->getName() .' && vagrant up\"</info>');\n }",
"function print_progress_redraw($thisbarid, $done, $total, $width, $donetext='') {\n if (empty($thisbarid)) {\n return;\n }\n echo '<script>';\n echo 'document.getElementById(\"text'.$thisbarid.'\").innerHTML = \"'.addslashes($donetext).'\";'.\"\\n\";\n echo 'document.getElementById(\"slider'.$thisbarid.'\").style.width = \\''.$width.'px\\';'.\"\\n\";\n echo '</script>';\n}",
"protected function prompt_done() {\n $this->prompt_info(\", done.\");\n }",
"function pastIntro() {\n // move progress forward and redirect to the runSurvey action\n $this->autoRender = false; // turn off autoRender\n $this->Session->write('Survey.progress', RIGHTS);\n $this->redirect(array('action' => 'runSurvey'));\n\n }",
"function dumpContents()\r\n {\r\n\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n //TODO [Perez][JLeon] Do we leave this method?\r\n // call the OnShow event if assigned so the Text property can be changed\r\n if ($this->_onshow != null)\r\n {\r\n $this->callEvent('onshow', array());\r\n }\r\n\r\n $avalue = $this->_text;\r\n $avalue=str_replace('\"','"',$avalue);\r\n $type = \"progress\";\r\n if ($this->_type == pbsMeterBar)\r\n $type = \"meter\";\r\n echo \"<$type id=\\\"$this->_name\\\" value=\\\"$avalue\\\" $attributes>$this->_text</$type>\";\r\n\r\n }",
"function showProgress($percent,$remainingTime)\n{\n $time='';\n if (!empty($remainingTime))\n {\n if ($remainingTime<120)\n {\n# $time=sprintf(\"(%d seconds remaining)\",$remainingTime);\n }\n elseif ($remainingTime<60*120)\n {\n # $time=sprintf(\"(%d minutes remaining)\",round($remainingTime/60));\n }\n else\n {\n # $time=sprintf(\"(%d hours remaining)\",round($remainingTime/3600));\n }\n }\n flush();\n}",
"public function display() {\r\n\t\t$this->script();\r\n\t\t$this->html();\r\n\t\t\r\n\t}",
"public function step_4()\n \t{\n \t\t$this->data['title'] = 'Step-4';\n\t\t$this->show_viewFrontInner('step_4', $this->data);\n \t}",
"public function printSuccessMessage()\n {\n printf('Successfully checked %d lines in %d files :)'. PHP_EOL, $this->lines, $this->files);\n }",
"public function display()\n {\n echo \"temperature:{$this->_subject->getTemperature()},humidity:{$this->_subject->getHumidity()},pressure:{$this->_subject->getPressure()}\" . PHP_EOL;\n }",
"public function printResultBar() \n { \n \n if( $this->getTotalOfResults() > 0 ) { \n printf(\"\n <div id=\\\"result-bar\\\">\n Showing page <span>%s</span> of <span>\n %s</span> available pages for\n <span>%s</span> \n results. \n </div>\n \"\n , $this->getCurrentPage()\n , $this->getTotalOfPages()\n , $this->getTotalOfResults()\n );\n \n } else { \n print \"<div id=\\\"result-bar-not-found\\\">\n No records were found to your search.</div>\"; \n } \n \n }",
"function printResults () {\n\n if (! $this->isActive()) { return; }\n\n $unstoppedTasks = array_keys($this->startTime);\n if (count($unstoppedTasks)) {\n Tht::error('Unstopped Perf task: `' . $unstoppedTasks[0] . '`');\n }\n\n $results = $this->results();\n\n // Have to do this outside of results() or the audit calls will show up in the perf tasks.\n // $results['imageAudit'] = Tht::module('Image')->auditImages(Tht::path('public'));\n\n $thtDocLink = Tht::getThtSiteUrl('/reference/perf-panel');\n $compileMessage = Compiler::getDidCompile() ? '<div class=\"bench-compiled\">Files were updated. Refresh to see compiled results.</div>' : '';\n\n $table = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['single']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'value' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Peak Memory (MB)', 'Detail' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n $tableGroup = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['group']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'numCalls' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Memory (MB)', 'Calls' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n\n $opCache = '';\n if (Tht::isOpcodeCacheEnabled()) {\n $opCache = '<span style=\"color: #393\">ON</span>';\n }\n else {\n $opCache = '<span style=\"color: #c33\">OFF</span>';\n }\n\n $appCache = Tht::module('Cache')->u_get_driver();\n if ($appCache == 'file') {\n $appCache = '<span style=\"color: #c33\">' . $appCache . '</span>';\n }\n else {\n $appCache = '<span style=\"color: #393\">' . $appCache . '</span>';\n }\n\n\n\n $phpVersion = phpVersion();\n\n\n echo $this->perfPanelCss();\n echo $this->perfPanelJs($results['scriptTime']);\n\n ?>\n <div id=\"perf-score-container\">\n\n <div class=\"perfSection\">\n <div class='perfHeader'>Perf Score: <span id='perfScoreTotalLabel'></span><span id='perfScoreTotal'></span></div>\n\n <div class=\"perfHelp\"><a href=\"<?= $thtDocLink ?>\" style=\"font-weight:bold\">About This Score</a></div>\n </div>\n\n <?= $compileMessage ?>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Page Execution: <span id=\"perfScoreServer\"><?= $results['scriptTime'] ?> ms</span></div>\n <div>Network - Transfer: <span id='perfScoreNetwork'></span></div>\n <div>Browser - window.onload: <span id='perfScoreClient'></span></div>\n </div>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Peak Memory: <span><?= $results['peakMemory'] ?> MB</span></div>\n </div>\n </div>\n\n <div class=\"perfSection tasksGrouped\">\n <div class=\"perfSubHeader\">Top Tasks (Grouped)</div>\n <?= $tableGroup ?>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfSubHeader\">Top Tasks (Individual)</div>\n <?= $table ?>\n <div style='text-align:center; margin-top:48px;'>\n <p style=\"font-size: 80%\"> Sub-task time is not included in parent tasks.</p>\n </div>\n </div>\n\n\n\n <div class=\"perfSection\">\n <div class=\"perfHeader\">PHP Info</div>\n\n <div style=\"text-align: left; width: 300px; display: inline-block; margin-top: 32px\">\n <li>PHP Version: <b><?= $phpVersion ?></b></li>\n <li>Opcode Cache: <b><?= $opCache ?></b></li>\n <li>App Cache Driver: <b><?= $appCache ?></b></li>\n </div>\n </div>\n\n <div class=\"perfSection\">\n Perf Panel only visible to localhost or <code>devIp</code> in <code>config/app.jcon</code>\n </div>\n\n </div>\n <?php\n\n }",
"private function printTaskPage() {\n\t\treadfile ( 'html/task.html' );\n\t}",
"public function start()\n {\n Console::startProgress(0,100);\n }",
"protected function _showFinalMessages()\n {\n if ($this->_errors) {\n $this->_output->writeln(\n \"<fg=red>There was some errors on setting configuration: \\n{$this->_errors}</fg=red>\"\n );\n }\n\n if ($this->_warnings) {\n $this->_output->writeln(\n \"<comment>There was some warnings on setting configuration: \\n{$this->_warnings}</comment>\"\n );\n }\n\n if ($this->_configurationCounter > 0) {\n $this->_output->writeln(\n \"<info>Configuration has been applied</info>\"\n );\n\n $this->_output->writeln(\n \"<info>Total changed configurations: {$this->_configurationCounter}</info>\"\n );\n } else {\n $this->_output->writeln(\n \"<error>There was no configuration applied.</error>\"\n );\n }\n }",
"public function progressFinish() {}",
"public function printDetails() \n {\n\n echo count($this->filesArray) . ' files has been updated' . PHP_EOL\n . ' New details are given below ' . PHP_EOL;\n // list down files after updation\n foreach ($this->filesArray as $file) {\n echo $file . ' ' . filesize($file) . 'kb' . PHP_EOL;\n }\n }",
"function showProgress($downloaded_size, $download_size, $cli_size=30) {\n \n if($downloaded_size > $download_size){\n \treturn;\n }\n\n //avoid division by 0\n if($download_size == 0){\n \treturn;\n }\n\n static $start_time;\n\n if(!isset($start_time) || empty($start_time)){\n \t$start_time = time();\n }\n\n $current_time = time();\n\n $percentage = (double) ($downloaded_size / $download_size);\n\n $bar = floor($percentage * $cli_size);\n\n $status_bar_str = \"\\r[\";\n $status_bar_str .= str_repeat(\"=\", $bar);\n\n if($bar < $cli_size){\n $status_bar_str .= \">\";\n $repeat = $cli_size - $bar;\n $status_bar_str .= str_repeat(\" \", $repeat);\n } else {\n $status_bar_str .= \"=\";\n }\n\n $disp = number_format($percentage * 100, 0);\n\n $status_bar_str .=\"] $disp% \".$downloaded_size.\"/\".$download_size;\n\n if($downloaded_size == 0){\n \t$download_rate = 0;\n }\n else{\n \t$download_rate = ($current_time - $start_time) / $downloaded_size;\n\t}\n $left = $download_size - $downloaded_size;\n \n $estimated = round($download_rate * $left, 2);\n $elapsed = $current_time - $start_time;\n\n $status_bar_str .= \" remaining: \".number_format($estimated).\" sec. elapsed: \".number_format($elapsed).\" sec.\";\n\n echo \"$status_bar_str \";\n\n flush();\n\n if($downloaded_size == $download_size) {\n echo \"\\n\";\n }\n}",
"public function renderWaiting()\n\t{\n\t\tif (!$this->configuration->isRunned())\n\t\t{\n\t\t\t$this->events->triggerListener('onRendererWaitingStart');\n\t\t\t$uri = $this->link->createLink($this->configuration, array(\n\t\t\t\t'setRunned' => true,\n\t\t\t));\n\t\t\techo Html::el('h2')->add(Html::el('a', 'START')->href($uri));\n\t\t\techo '<p style=\"display: none;\" id=\"sentence\" data-state=\"waiting\">Waiting for start</p>';\n\t\t\t$this->events->triggerListener('onRendererWaitingEnd');\n\t\t}\n\t}",
"function print_panel() {\t\n\t\tif ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) {\n\t\t\t$this->print_saved_message();\n\t\t}\n\t\tif ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) {\n\t\t\t$this->print_reset_message();\n\t\t}\n\t\n\t\t$this->print_heading();\n\t\t$this->print_options();\n\t\t$this->print_footer();\n\t}",
"public function render()\n {\n return view('components::element.progress');\n }",
"private function stepDone (SymfonyStyle $io)\n {\n $io->writeln(\"<fg=green>done.</>\");\n $io->newLine(2);\n }",
"function run()\r\n\t{\r\n//\t\t$trail->add(new Breadcrumb($this->get_browse_cda_languages_url(), Translation :: get('Cda')));\r\n//\t\t$trail->add(new Breadcrumb($this->get_variable_translations_searcher_url(), Translation :: get('SearchVariableTranslations')));\r\n\r\n\t\t$this->display_header($trail);\r\n\t\techo $this->display_form();\r\n\t\techo '<br />';\r\n echo $this->get_table();\r\n\t\t$this->display_footer();\r\n\t}",
"public function form_footer_progress_block_html() {\n\n\t\t$progress_style = ! empty( $this->form_data['settings']['conversational_forms_progress_bar'] ) ? $this->form_data['settings']['conversational_forms_progress_bar'] : '';\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress\">\n\t\t\t<div class=\"wpforms-conversational-form-footer-progress-status\">\n\t\t\t\t<?php\n\t\t\t\tif ( 'proportion' === $progress_style ) {\n\t\t\t\t\t$this->form_footer_progress_status_proportion_html();\n\t\t\t\t} else {\n\t\t\t\t\t$this->form_footer_progress_status_percentage_html();\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<div class=\"wpforms-conversational-form-footer-progress-bar\">\n\t\t\t\t<div class=\"wpforms-conversational-form-footer-progress-completed\"></div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"function show() {\n // Abort if empty file\n if($this->oParser->oManager->tsCurDate < 1) {\n return;\n }\n \n // We want to process the output later\n ob_start();\n\n $this->printHeading();\n $this->printDailyMessages();\n $this->printAbsentTeachers();\n $this->printStandInTable();\n $this->printStandInTableFooter();\n\n $str = ob_get_clean();\n #debugPrint($str);\n echo vpBeautifyString($str);\n }",
"public function welcomInformations() {\n echo \"\\t\\t####################################\\t\\t\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t# \" . Utils::red(\"This is a Enterprise Backup Tool!\") . \"\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t####################################\\t\\t\\n\\n\";\n }",
"public function actionPrintsummary() {\n $this->layout = \"@app/views/layouts/print\";\n\n $searchModel = new FilesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('printsummary', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }",
"public function showComplete(){\n\t\t\n\t\t//our tasks\n\t\t$this->set('tasks', $this->Task->find('all', array(\n\t\t\t'conditions' => array('Task.status_id' => '2'),\n\t\t\t'order' => array('Task.completed_on'),\n\t\t)));\n\t\t\n\t\t//our statuses\n\t\t$this->set('statuses', $this->Task->Status->find('list'));\n\t\t\n\t\t//our locations\n\t\t$this->set('locations', $this->Task->Location->find('list'));\n\t\t\n\t\t//our keywords\n\t\t$this->set('keywords', $this->Task->Keyword->find('list'));\n\t\t\n\t\t//our link locations\n\t\t$linkLocation['/foundersFactory/tasks/'] = \"Show by Location\";\n\t\tforeach($this->Task->Location->find('list') as $key => $location){\n\t\t\t$linkLocation['/foundersFactory/tasks/showByLocation/'.$key] = $location;\n\t\t}\n\t\t$this->set('linkLocations', $linkLocation);\n\t}",
"public static function printFoot (){\n\t?>\t\t\n\t\t\t\t<p class='submit'>\n\t\t\t\t\t<input type='submit' name='Submit' value=\"<?php _e('Save changes') ?>\" class='button-primary' />\n\t\t\t\t</p>\t\t\t\t\n\t\t\t\t\n\t\t\t</form>\n\t\t</div>\n\t\t\n\t<?php\n\t}",
"function show_after_running_page()\n\t\t{\n\t\t\t$this->t->set_file('after_running', 'after_running.tpl');\n\t\t\t\n\t\t\t//prepare the links form\n\t\t\t$link_data_proc = array(\n\t\t\t\t'menuaction'\t\t=> 'workflow.ui_userinstances.form',\n\t\t\t\t'filter_process'\t=> $this->process_id,\n\t\t\t);\n\t\t\t$link_data_inst = array(\n\t\t\t\t'menuaction'\t\t=> 'workflow.ui_userinstances.form',\n\t\t\t\t'filter_instance'\t=> $this->instance_id,\n\t\t\t);\n\t\t\tif ($this->activity_type == 'start')\n\t\t\t{\n\t\t\t\t$activitytxt = lang('get back to instance creation');\n\t\t\t\t$act_button_name = lang('New instance');\n\t\t\t\t$link_data_act = array(\n\t\t\t\t\t'menuaction'\t\t=> 'workflow.ui_useropeninstance.form',\n\t\t\t\t);\n\t\t\t}\n\t\t\telseif ($this->activity_type == 'standalone')\n\t\t\t{\n\t\t\t\t$activitytxt = lang('get back to global activities');\n\t\t\t\t$act_button_name = lang('Global activities');\n\t\t\t\t$link_data_act = array(\n\t\t\t\t\t'menuaction'\t\t=> 'workflow.ui_useractivities.form',\n\t\t\t\t\t'show_globals'\t\t=> true,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$activitytxt = lang('go to same activities for other instances of this process');\n\t\t\t\t$act_button_name = lang('activity %1', $this->activity_name);\n\t\t\t\t$link_data_act = array(\n\t\t\t\t\t'menuaction'\t\t=> 'workflow.ui_userinstances.form',\n\t\t\t\t\t'filter_process' => $this->process_id,\n\t\t\t\t\t'filter_activity_name'\t=> $this->activity_name,\n\t\t\t\t);\n\t\t\t}\n\t\t\t$button='<img src=\"'. $GLOBALS['egw']->common->image('workflow', 'next')\n\t\t\t\t.'\" alt=\"'.lang('go').'\" title=\"'.lang('go').'\" width=\"16\" >';\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'same_instance_text'\t=> ($this->activity_type=='standalone')? '-' : lang('go to the actual state of this instance'),\n\t\t\t\t'same_activities_text'\t=> $activitytxt,\n\t\t\t\t'same_process_text'\t=> lang('go to same process activities'),\n\t\t\t\t'same_instance_button'\t=> ($this->activity_type=='standalone')? '-' : '<a href=\"'.$GLOBALS['egw']->link('/index.php',$link_data_inst).'\">'\n\t\t\t\t\t.$button.lang('instance %1', ($this->instance_name=='')? $this->instance_id: $this->instance_name).'</a>',\n\t\t\t\t'same_activities_button'=> '<a href=\"'.$GLOBALS['egw']->link('/index.php',$link_data_act).'\">'\n\t\t\t\t\t.$button.$act_button_name.'</a>',\n\t\t\t\t'same_process_button'\t=> '<a href=\"'.$GLOBALS['egw']->link('/index.php',$link_data_proc).'\">'\n\t\t\t\t\t.$button.lang('process %1', $this->process_name).'</a>',\n\t\t\t));\n\t\t\t$this->translate_template('after_running');\n\t\t\t$this->t->pparse('output', 'after_running');\n\t\t\t$GLOBALS['egw']->common->egw_footer();\n\t\t}",
"function _showStatus() {\r\n $okMessage = implode('<br />', $this->_okMessage);\r\n $errMessage = implode('<br />', $this->_errMessage);\r\n\r\n if (!empty($errMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_ERROR_MESSAGE', $errMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('errormsg');\r\n }\r\n\r\n if (!empty($okMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_OK_MESSAGE', $okMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('okmsg');\r\n }\r\n }",
"public function run()\n {\n if (Yii::$app->user->isGuest)\n return;\n\n return $this->render('overview', array(\n 'update' => \\humhub\\modules\\notification\\controllers\\ListController::getUpdates()\n ));\n }",
"protected function outputSpecificStep() {}",
"public function print () : void {\r\n echo $this->getTitle(), PHP_EOL, PHP_EOL;\r\n echo $this->getInfo(), PHP_EOL, PHP_EOL;\r\n\r\n foreach ($this->items as $index => $value) {\r\n echo ($index + 1) . '. ' . $value->getText(), PHP_EOL;\r\n }\r\n\r\n echo PHP_EOL;\r\n }",
"public function national_progress_bar_reported()\n\t{\n\t\t$this->load->model('overview_model');\n\t\techo $this->overview_model->national_view_progress_bar_reported($this->get_filter_start_date(),$this->get_filter_stop_date());\n\t}",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"public function display()\n {\n }",
"function run()\r\n {\r\n $trail = BreadcrumbTrail :: get_instance();\r\n $trail->add(new Breadcrumb($this->get_url(), Translation :: get(ucfirst($this->get_folder()))));\r\n\r\n $this->display_header($trail);\r\n echo $this->get_action_bar_html() . '';\r\n echo $this->get_publications_html();\r\n $this->display_footer();\r\n }",
"private function progress(): void\n {\n if ($this->generator && $this->generator->valid() && !$this->saved) {\n $this->entries[] = [$this->generator->key(), $this->generator->current()];\n $this->saved = true;\n }\n }",
"public function showupAction()\n {\n $this->line('Hi !');\n $name = $this->prompt('I\\'m quark ! And you, who you are ?');\n\n $this->line('Nice to meet you ' . $name);\n\n if ($this->confirm('Are you humain ?', true)) {\n $this->info('Yes you are !');\n\n switch ($this->choices('You are a male, a female, or just human ?', ['male', 'female', 'human'], 'human')) {\n case 'male':\n case 'female':\n $this->line('Ok');\n break;\n case 'human':\n $this->line('Ok, i like your thinking way :)');\n break;\n }\n } else {\n $this->info('Hey ! you like me');\n }\n\n $this->line('');\n $this->line('Well, by ' . $name);\n }",
"function progress($server) {\n printf(\"%s:%-8s %3d%% complete\\r\",\n $server->name, $server->status, $server->progress);\n}",
"public function showContents() {\n\t\techo $this -> getContents();\n\t\texit ;\n\t}",
"public function done() {\n ncurses_refresh();\n ncurses_end();\n usleep(300000);\n }",
"private function _progress($passed) {\n $text = $passed ? 'P' : 'F';\n\n fwrite(STDOUT, $this->_colors->getColoredString($text, $this->_colorsPalete[$passed]));\n return true;\n }",
"public function displayComponent() {\n\t\t\n\t\t\t$this->outputLine($this->_content);\n\t\t\t\n\t\t}",
"function printStatus (): void {\r\n foreach ( $this->allPlayers() as $player ) {\r\n $player->printDeck();\r\n }\r\n }",
"public function displayUpgradePage()\n {\n global $token;\n $upgraderVesion = $this->context['versionInfo'][0];\n $upgraderBuild = $this->context['versionInfo'][1];\n $this->log(\"WebUpgrader v.\" . $upgraderVesion . \" (build \" . $upgraderBuild . \") starting\");\n include dirname(__FILE__) . '/upgrade_screen.php';\n }",
"public function jdidealScreen(): void\n\t{\n\t\techo 'RO Payments';\n\t}",
"public function run()\r\n\t{\r\n\t\treturn 'faz de conta...';\r\n\t}",
"public function done()\n {\n $this->setStatus(self::STATUS_DONE);\n }",
"function update_progress_bar($percent, $first_time) {\n\tglobal $pkg_interface;\n\tif ($percent > 100) {\n\t\t$percent = 1;\n\t}\n\tif ($pkg_interface <> \"console\") {\n\t\techo '<script type=\"text/javascript\">';\n\t\techo \"\\n//<![CDATA[\\n\";\n\t\techo 'document.getElementById(\"progressbar\").style.width=\"'. $percent.'%\"';\n\t\techo \"\\n//]]>\\n\";\n\t\techo '</script>';\n\t} else {\n\t\tif (!($first_time)) {\n\t\t\techo \"\\x08\\x08\\x08\\x08\\x08\";\n\t\t}\n\t\techo sprintf(\"%4d%%\", $percent);\n\t}\n}",
"private function progress_bar_html():string{\n return '<progress value='.$this->score.' max=\"'.self::MAX.'\">'.$this->score.'/'.self::MAX.'</progress>';\n }",
"public function report()\r\n {\r\n echo \"Question Bank Work is finish\";\r\n\r\n echo \"<br>\";\r\n\r\n echo \"Please Check Storage Folder\";\r\n\r\n echo \"<br>\";\r\n\r\n echo 'Count of Questions Get From Hsmai Server is: ' . count($this->questionInfo->items);\r\n\r\n echo \"questions\";\r\n }",
"function infoScreen()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreenForward();\n\t}",
"function renderStepsOverview() {\n\n\t\t$rows = array();\n\n\t\t\t// Generate a summary of all data from the different steps:\n\t\tforeach ($this->steps as $stepNr => $stepConf) {\n\t\t\t\t// Show all steps except the overview of course:\n\t\t\tif ($stepNr < $this->currentStep) {\n\t\t\t\t\t// If a userfunction was defined for rendering the overview part for this step, call the user function:\n\t\t\t\tif (is_array($stepConf['userfunctions']['renderstepsoverview'])) {\n\t\t\t\t\tif (method_exists ($stepConf['userfunctions']['renderstepsoverview']['userobject'], $stepConf['userfunctions']['renderstepsoverview']['usermethod'])) {\n\t\t\t\t\t\t$userConfig = array(\n\t\t\t\t\t\t\t'stepNr' => $stepNr,\n\t\t\t\t\t\t\t'stepConf' => $stepConf\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$rows[] = call_user_method ($stepConf['userfunctions']['renderstepsoverview']['usermethod'], $stepConf['userfunctions']['renderstepsoverview']['userobject'], $userConfig, $stepConf['userfunctions']['renderstepsoverview']['userobject'], $this);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$rows[] = '\n\t\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t\t<legend>'.htmlspecialchars($stepConf['label']).'</legend>';\n\t\t\t\t\t$counter = 1;\n\t\t\t\t\tif (is_array ($stepConf['fields'])) {\n\t\t\t\t\t\tforeach ($stepConf['fields'] as $fieldConf) {\n\t\t\t\t\t\t\t$rows[] = '\n\t\t\t\t\t\t\t\t<div class=\"tx-frontendformslib-stepsoverview-row tx-frontendformslib-stepsoverview-row-'.($counter%2 ? 'even':'odd').'\">\n\t\t\t\t\t\t\t\t\t'.$this->getSingleLabel($fieldConf).\n\t\t\t\t\t\t\t\t\t htmlspecialchars($this->sessionData['data'][$fieldConf['table']][$fieldConf['name']]).'\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t';\n\t\t\t\t\t\t\t$counter ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$rows[] = '\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$output .= '\n\t\t\t<div class=\"tx-frontendformslib-stepsoverview\">\n\t\t\t\t'.implode (chr(10), $rows).'\n\t\t\t</div>\n\t\t';\n\n\t\treturn $output;\n\t}",
"public function renderAfterStep($obj)\n {\n $feature = $obj->getCurrentFeature();\n $scenario = $obj->getCurrentScenario();\n\n $steps = $scenario->getSteps();\n $step = end($steps); //needed because of strict standards\n\n //path displayed only if available (it's not available in undefined steps)\n $strPath = '';\n if($step->getDefinition() !== null) {\n $strPath = $step->getDefinition()->getPath();\n }\n\n $stepResultClass = '';\n if($step->isPassed()) {\n $stepResultClass = 'passed';\n }\n if($step->isFailed()) {\n $stepResultClass = 'failed';\n }\n if($step->isSkipped()) {\n $stepResultClass = 'skipped';\n }\n if($step->isPending()) {\n $stepResultClass = 'pending';\n }\n\n $arguments ='';\n $argumentType = $step->getArgumentType();\n\n if($argumentType == \"PyString\"){\n $arguments = '<br><pre class=\"argument\">' . htmlentities($step->getArguments()) . '</pre>';\n }\n\n if ($argumentType == 'Table'){\n $arguments = '<br><pre class=\"argument\">' . $this->renderTableNode($step->getArguments()) . '</pre>';\n }\n\n $print = '\n <li class=\"'.$stepResultClass.'\">\n <div class=\"step\">\n <span class=\"keyword\">'.$step->getKeyWord().' </span>\n <span class=\"text\">'.htmlentities($step->getText()).' </span>\n <span class=\"path\">'.$strPath.'</span>'\n . $arguments . '\n </div>';\n $exception = $step->getException();\n if(!empty($exception)) {\n $relativeScreenshotPath = 'assets/screenshots/' . $feature->getScreenshotFolder() . '/' . $scenario->getScreenshotName();\n $fullScreenshotPath = $obj->getOutputPath() . '/' . $relativeScreenshotPath;\n $print .= '\n <pre class=\"backtrace\">'.$step->getException().'</pre>';\n if(file_exists($fullScreenshotPath))\n {\n $print .= '<a href=\"' . $relativeScreenshotPath . '\">Screenshot</a>';\n }\n }\n $print .= '\n </li>';\n\n return $print;\n }",
"public function displayCalc()\r\n {\r\n require_once ROOT . DIRECTORY_SEPARATOR . \"view\" . DIRECTORY_SEPARATOR . \"index.html\";\r\n }",
"public function stepStart($data, $form)\n {\n if (!$data) return;\n\n if ($data['settings']['progress_indicator'] == 'steps') {\n $nav = \"<ul class='ff-step-titles'><li class='ff_active'><span>\" . implode('</span></li><li><span>', $data['settings']['step_titles']) . \"</span></li></ul>\";\n } elseif ($data['settings']['progress_indicator'] == 'progress-bar') {\n $nav = \"<div class='ff-el-progress-status'></div>\n <div class='ff-el-progress'>\n <div class='ff-el-progress-bar'><span></span></div>\n </div>\n <ul style='display: none' class='ff-el-progress-title'>\n <li>\" . implode('</li><li>', $data['settings']['step_titles']) . \"</li>\n </ul>\";\n } else {\n $nav = '';\n }\n\n $data['attributes']['data-disable_auto_focus'] = ArrayHelper::get($data, 'settings.disable_auto_focus', 'no');\n $data['attributes']['data-enable_auto_slider'] = ArrayHelper::get($data, 'settings.enable_auto_slider', 'no');\n\n $data['attributes']['data-enable_step_data_persistency'] = ArrayHelper::get($data, 'settings.enable_step_data_persistency', 'no');\n $data['attributes']['data-enable_step_page_resume'] = ArrayHelper::get($data, 'settings.enable_step_page_resume', 'no');\n\n $atts = $this->buildAttributes(\n \\FluentForm\\Framework\\Helpers\\ArrayHelper::except($data['attributes'], 'name')\n );\n\n echo \"<div class='ff-step-container' {$atts}>\";\n if ($nav) {\n echo \"<div class='ff-step-header'>{$nav}</div>\";\n }\n\n echo \"<span class='ff_step_start'></span><div class='ff-step-body'>\";\n $data['attributes']['class'] .= ' fluentform-step';\n $data['attributes']['class'] = trim($data['attributes']['class']) . ' active';\n $atts = $this->buildAttributes(\n \\FluentForm\\Framework\\Helpers\\ArrayHelper::except($data['attributes'], 'name')\n );\n echo \"<div {$atts}>\";\n }",
"public function printStep(Event $event)\n {\n $step = $event->getSubject();\n\n if (!($step->getParent() instanceof BackgroundNode) || !$this->backgroundPrinted) {\n if (!($step->getParent() instanceof OutlineNode) || !$this->outlineStepsPrinted) {\n $this->html .= '<li class=\"' . $this->statuses[$event->get('result')] . '\">';\n\n // Get step description\n $text = htmlspecialchars($this->outlineStepsPrinted ? $step->getText() : $step->getCleanText());\n\n // Print step\n $this->html .= '<div class=\"step\">';\n $this->html .= '<span class=\"keyword\">' . $step->getType() . '</span> ';\n $this->html .= '<span class=\"text\">' . $text . '</span>';\n if (null !== ($def = $event->get('definition'))) {\n $this->html .= $this->getSourcePathHtml($def->getFile(), $def->getLine());\n }\n $this->html .= '</div>';\n\n // Print step arguments\n if ($step->hasArguments()) {\n foreach ($step->getArguments() as $argument) {\n if ($argument instanceof PyStringNode) {\n $this->html .= '<pre class=\"argument\">' . htmlspecialchars($argument) . '</pre>';\n } elseif ($argument instanceof TableNode) {\n $this->html .= $this->getTableHtml($argument, 'argument');\n }\n }\n }\n\n // Print step exception\n if (null !== $event->get('exception')) {\n $message = $event->get('exception')->getMessage();\n\n $this->html .= '<div class=\"backtrace\"><pre>' . htmlspecialchars($message) . '</pre></div>';\n }\n\n // Print step snippet\n if (null !== $event->get('snippet')) {\n $snippets = array_values($event->get('snippet'));\n $snippet = $snippets[0];\n\n $this->html .= '<div class=\"snippet\"><pre>' . htmlspecialchars($snippet) . '</pre></div>';\n }\n\n $this->html .= '</li>';\n } else {\n if (null !== $event->get('exception')) {\n $this->outlineSubresultExceptions[] = $event->get('exception');\n }\n }\n }\n }",
"function viewDeliveryProgress(){\n $user=$this->session->userdata('username');\n $data['progress']=$this->deliveryAndPickupModel->viewProgress($user);\n $this->load->view('deliveryAndPickupView/viewdeliveryandpickup', $data);\n\t}"
] | [
"0.75575596",
"0.7044762",
"0.6753969",
"0.64469326",
"0.64225984",
"0.640198",
"0.63812846",
"0.6318462",
"0.6296183",
"0.6282982",
"0.62557954",
"0.62289554",
"0.61976266",
"0.61645347",
"0.61196804",
"0.61053854",
"0.60718536",
"0.60505325",
"0.6045323",
"0.60347486",
"0.59864956",
"0.5969512",
"0.59530294",
"0.59180415",
"0.59007317",
"0.58978635",
"0.5865908",
"0.5837613",
"0.5814276",
"0.5801903",
"0.5799654",
"0.5781627",
"0.57814944",
"0.5764929",
"0.57561046",
"0.5751908",
"0.5736695",
"0.57341594",
"0.5724343",
"0.5699829",
"0.56834626",
"0.5669356",
"0.5661721",
"0.5647532",
"0.5647101",
"0.5610329",
"0.5579109",
"0.5578277",
"0.556732",
"0.5566274",
"0.556072",
"0.55582947",
"0.55543244",
"0.55536777",
"0.5548735",
"0.55447733",
"0.5531834",
"0.5515856",
"0.55086744",
"0.549526",
"0.54853445",
"0.5485149",
"0.54844165",
"0.54835325",
"0.5477847",
"0.54696083",
"0.5461899",
"0.54614997",
"0.54508555",
"0.5449517",
"0.5444047",
"0.54437464",
"0.5440449",
"0.5431045",
"0.5431045",
"0.54306185",
"0.54306185",
"0.5415288",
"0.54009515",
"0.5399775",
"0.53904104",
"0.5388544",
"0.53879976",
"0.53873533",
"0.5381285",
"0.5378875",
"0.53781533",
"0.53778315",
"0.53745943",
"0.53738546",
"0.53641033",
"0.53607",
"0.5359605",
"0.53587216",
"0.5355815",
"0.53535795",
"0.53455496",
"0.53414094",
"0.5317455",
"0.5314659"
] | 0.70732975 | 1 |
User Picks an Avatar Separately now | public function avatar() {
$data = array();
if (!$this->user->is_logged_in()) {
redirect("/account/info");
}
$this->user->get_user($this->user->getMyId());
$data['user'] = $this->user;
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
$hidden_fields = array(
'user_id' => $this->user->getMyId(),
'set_avatar' => 'set_avatar',
);
$data['hidden'] = $hidden_fields;
$data['avatars'] = $this->user->get_all_avatars();
if ($this->input->post('set_avatar') == 'set_avatar') {
if ($this->form_validation->run('account/avatar') === FALSE) {
$this->load->view('account/avatar', $data);
}
else {
$id = $this->user->update_avatar();
redirect('account/profile_complete');
}
}
else {
$this->load->view('account/avatar', $data);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionAvatar()\n {\n $players=Player::find()->active()->all();\n foreach($players as $player)\n {\n $robohash=new \\app\\models\\Robohash($player->profile->id,'set1');\n $image=$robohash->generate_image();\n if(get_resource_type($image)=== 'gd')\n {\n $dst_img=\\Yii::getAlias('@app/web/images/avatars/'.$player->profile->id.'.png');\n imagepng($image,$dst_img);\n imagedestroy($image);\n $player->profile->avatar=$player->profile->id.'.png';\n $player->profile->save(false);\n }\n }\n }",
"private function changeAvatar()\n {\n try\n {\n global $userquery; \n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($_FILES['avatar_file']['name']))\n throw_error_msg(\"provide avatar_file\");\n\n $array['userid'] = userid();\n $userquery->update_user_avatar_bg($array);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($array['userid']);\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"function getUserImageInitial($userId, $name)\n{\n return getAvatarUrl().\"?name=$name&size=30&rounded=true&color=fff&background=\".getRandomColor($userId);\n}",
"public function getAvatar($identity);",
"public function avatar()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n $this->load->helper('directory');\n\n $files = directory_map(APPPATH .'../public_html/images/avatar');\n\n foreach ($files AS $key => $file) {\n\n $file_part = explode('.', $file);\n\n if (!is_numeric($file_part[0])) {\n unset($files[$key]);\n }\n }\n\n $view_data['number_avatar'] = count($files);\n \n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->update([\n 'id' => $this->current_user->id,\n 'avatar_id' => $this->input->post('avatar')\n ]);\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n }\n\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n\n $res = $this->get_current_user_detail();\n\n $view_data['current_avatar'] = $res['result']['avatar'];\n\n $this->_render($view_data);\n }",
"public function setAvatar(string $avatar);",
"public function getAvatar(): string;",
"function the_champ_social_avatar_options(){\r\n\tglobal $user_ID, $theChampLoginOptions;\r\n\tif(isset($theChampLoginOptions['enable']) && isset($theChampLoginOptions['avatar']) && isset($theChampLoginOptions['avatar_options'])){\r\n\t\tif(isset($_POST['ss_dontupdate_avatar'])){\r\n\t\t\t$dontUpdateAvatar = intval($_POST['ss_dontupdate_avatar']);\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_dontupdate_avatar', $dontUpdateAvatar);\r\n\t\t}else{\r\n\t\t\t$dontUpdateAvatar = get_user_meta($user_ID, 'thechamp_dontupdate_avatar', true);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_small_avatar']) && heateor_ss_validate_url($_POST['ss_small_avatar']) !== false){\r\n\t\t\t$updatedSmallAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_small_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_avatar', $updatedSmallAvatar);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_large_avatar']) && heateor_ss_validate_url($_POST['ss_large_avatar']) !== false){\r\n\t\t\t$updatedLargeAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_large_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_large_avatar', $updatedLargeAvatar);\r\n\t\t}\r\n\t\t?>\r\n\t\t<div class=\"profile\" style=\"margin-bottom:20px\">\r\n\t\t\t<form action=\"\" method=\"post\" class=\"standard-form base\">\r\n\t\t\t\t<h4><?php _e('Social Avatar', 'super-socializer') ?></h4>\r\n\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_1\"><input id=\"ss_dontupdate_avatar_1\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"1\" <?php echo $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Do not fetch and update social avatar from my profile, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_0\"><input id=\"ss_dontupdate_avatar_0\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"0\" <?php echo ! $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Update social avatar, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_small_avatar\"><?php _e('Small Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_small_avatar\" type=\"text\" name=\"ss_small_avatar\" value=\"<?php echo isset($updatedSmallAvatar) ? $updatedSmallAvatar : get_user_meta($user_ID, 'thechamp_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_large_avatar\"><?php _e('Large Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_large_avatar\" type=\"text\" name=\"ss_large_avatar\" value=\"<?php echo isset($updatedLargeAvatar) ? $updatedLargeAvatar : get_user_meta($user_ID, 'thechamp_large_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save Changes', 'super-socializer') ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t\t<?php\r\n\t}\r\n}",
"function fc_get_easySocial_avatar(){\r\n\t$user = Foundry::user();\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getAvatar());\r\n}",
"public function testUpdateAvatarImage()\n {\n }",
"public function getRandomAvatar(): string {\n\t\t$avatarsArray = $this->getAvatars();\n\n\t\treturn $avatarsArray[array_rand($avatarsArray)];\n\t}",
"function upm_get_avatar($avatar = '') {\r\n global $current_user;\r\n wp_get_current_user();\r\n\r\n if( $current_user && is_object($current_user) && is_a($current_user, 'WP_User')) {\r\n if ($current_user->has_cap('partner') && !empty($current_user->user_image)) {\r\n $avatar = wp_get_attachment_image_url($current_user->user_image,'thumbnail', false);\r\n } else {\r\n $avatar = get_avatar_url($current_user->ID);\r\n }\r\n }\r\n return \"<img class='avatar avatar-64 photo' src='\" . $avatar . \"'>\";\r\n}",
"function fc_get_jomSocial_avatar(){\r\n\t$user =& CFactory::getUser($userid);\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getThumbAvatar());\r\n}",
"protected function handleAvatar() : void // image\n {\n // something happened in the last years: those textures do not include tiny icons\n $sizes = [/* 'tiny' => 15, */'small' => 18, 'medium' => 36, 'large' => 56];\n $aPath = 'uploads/avatars/%d.jpg';\n $s = $this->_get['size'] ?: 'medium';\n\n if (!$this->_get['id'] || !preg_match('/^([0-9]+)\\.(jpg|gif)$/', $this->_get['id'][0], $matches) || !in_array($s, array_keys($sizes)))\n {\n trigger_error('AjaxProfile::handleAvatar - malformed request received', E_USER_ERROR);\n return;\n }\n\n $this->contentType = $matches[2] == 'png' ? MIME_TYPE_PNG : MIME_TYPE_JPEG;\n\n $id = $matches[1];\n $dest = imageCreateTruecolor($sizes[$s], $sizes[$s]);\n\n if (file_exists(sprintf($aPath, $id)))\n {\n $offsetX = $offsetY = 0;\n\n switch ($s)\n {\n case 'tiny':\n $offsetX += $sizes['small'];\n case 'small':\n $offsetY += $sizes['medium'];\n case 'medium':\n $offsetX += $sizes['large'];\n }\n\n $src = imageCreateFromJpeg(printf($aPath, $id));\n imagecopymerge($dest, $src, 0, 0, $offsetX, $offsetY, $sizes[$s], $sizes[$s], 100);\n }\n else\n trigger_error('AjaxProfile::handleAvatar - avatar file #'.$id.' not found', E_USER_ERROR);\n\n if ($matches[2] == 'gif')\n imageGif($dest);\n else\n imageJpeg($dest);\n }",
"function showAvatar()\n {\n $avatar_size = $this->avatarSize();\n\n $avatar = $this->profile->getAvatar($avatar_size);\n\n $this->out->element('img', array('src' => ($avatar) ?\n $avatar->displayUrl() :\n Avatar::defaultImage($avatar_size),\n 'class' => 'avatar photo',\n 'width' => $avatar_size,\n 'height' => $avatar_size,\n 'alt' =>\n ($this->profile->fullname) ?\n $this->profile->fullname :\n $this->profile->nickname));\n }",
"function avatar_filter( $avatar, $user, $size, $default, $alt ) {\n global $pagenow;\n \n // Do not filter if inside WordPress options page\n if ( 'options-discussion.php' == $pagenow )\n return $avatar;\n\n // If passed an object, assume $user->user_id\n if ( is_object( $user ) )\n $id = $user->user_id;\n\n // If passed a number, assume it was a $user_id\n else if ( is_numeric( $user ) )\n $id = $user;\n\n // If passed a string and that string returns a user, get the $id\n else if ( is_string( $user ) && ( $user_by_email = get_user_by_email( $user ) ) )\n $id = $user_by_email->ID;\n\n // If somehow $id hasn't been assigned, return the result of get_avatar\n if ( empty( $id ) )\n return !empty( $avatar ) ? $avatar : $default;\n\n if ( !$this->loaded_defines ) {\n $this->defines();\n $this->loaded_defines = true;\n } \n \n // Let BuddyPress handle the fetching of the avatar\n $bp_avatar = $this->fetch( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );\n\n // If BuddyPress found an avatar, use it. If not, use the result of get_avatar\n return ( !$bp_avatar ) ? $avatar : $bp_avatar; \n }",
"public function uploadAvatar()\n {\n\n if (!empty($_FILES['avatar']['name'])) {\n\n\n // array containg the extensions of popular image files\n $allowedExtensions = array(\"gif\", \"jpeg\", \"jpg\", \"png\");\n\n //echo $_FILES['avatar']['name'];\n\n\n // make it so i can get the .extension\n $tmp = explode(\".\", $_FILES['avatar']['name']);\n\n\n // get the end part of the file\n $newfilename = hash('sha256', reset($tmp) . time());\n\n $extension = end($tmp);\n\n $_FILES['avatar']['name'] = $newfilename . \".\" . $extension;\n //echo $_FILES['avatar']['name'];\n\n\n // ok here we go.. maybe a switch might be nice?.. meh..\n if ((($_FILES['avatar']['type'] == \"image/gif\")\n || ($_FILES['avatar']['type'] == \"image/jpeg\")\n || ($_FILES['avatar']['type'] == \"image/jpg\")\n || ($_FILES['avatar']['type'] == \"image/png\"))\n && ($_FILES['avatar']['size'] < 2000000)\n && in_array($extension, $allowedExtensions)\n ) {\n\n // get the error\n if ($_FILES['avatar']['error'] > 0) {\n redirect('register.php', $_FILES['avatar']['error'], 'error');\n } else {\n // and finally move the file into the folder\n move_uploaded_file($_FILES['avatar']['tmp_name'], \"images/avatars/\" . $_FILES['avatar']['name']);\n //redirect('index.php', 'Amazing! your all signed up', 'success');\n $_SESSION['avatar'] = $_FILES['avatar']['name'];\n return true;\n }\n\n } else {\n // stop and warn the user that the file type is not suppoerted\n redirect('register.php', 'Invalid File Type! We only accept \"gif\", \"jpeg\", \"jpg\", or \"png\"', 'error');\n }\n } else {\n //move_uploaded_file($_FILES['avatar']['tmp_name'], SERVER_URI . \"images/avatars/\" . $_FILES['avatar']['name']);\n return false;\n }\n\n }",
"function getAvatar($id = ID, $type = '')\n{\n\tif($type == '')\n\t\t$type = getDBData('user_avatar_type', $id);\n\n\tif(!$type)\n\t\treturn '';\n\n\treturn getAvatarImg(\n\t\t($type == '1' ?\n\t\t\tgetDBData('user_avatar_data', $id) :\n\t\t\t'avatar.php?i=' . $id\n\t));\n}",
"public function avatar() {\n\t\tif(!empty($this->request->data['Upload']['file'])) {\n\t\t\t/* check all image parameters */\n\t\t\t\n\t\t\t$this->__checkImgParams();\n\t\t\t\t\t\t\n\t\t\t$user = $this->User->findById($this->Auth->user('id'));\n\t\t\t$uploadPath = WWW_ROOT . 'img/uploads/users/';\n\t\t\t$uploadFile = $uploadPath . $this->Auth->user('public_key') . '-' . $this->request->data['Upload']['file']['name'];\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t$directory = dir($uploadPath); \n\t\t\tif(!empty($user['User']['image'])) {\n\t\t\t\tunlink(WWW_ROOT . $user['User']['image']);\n\t\t\t}\n\t\t\t$directory->close();\n\n\t\t\t\n\t\t\tif(move_uploaded_file($this->request->data['Upload']['file']['tmp_name'], $uploadFile)) {\n\t\t\t\t\n\t\t\t\t$data['User']['image'] = '/img/uploads/users/' . $this->Auth->user('public_key') . '-' . $this->request->data['Upload']['file']['name'];\n\t\t\t\t$data['User']['api_key'] = '538bfe80756c5c00a1984a4bd57c4b45';\n\t\t\t\t\n\t\t\t\t$data['User']['id'] = $user['User']['id'];\n\t\t\t\t//$this->User->id = $data['User']['id'];\n\t\t\t\t$this->User->save($data);\n\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Your profile picture has been set!');\n\t\t\t\t$this->redirect(Controller::referer('/'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Something went wrong uploading your avatar...');\n\t\t\t\t$this->redirect(Controller::referer('/'));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->Session->setFlash('We didn\\'t catch that avatar, please try again...');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t}",
"function floated_admin_avatar($name)\n {\n }",
"public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}",
"function dokan_get_avatar( $avatar, $id_or_email, $size, $default, $alt ) {\n\n if ( is_numeric( $id_or_email ) ) {\n $user = get_user_by( 'id', $id_or_email );\n } elseif ( is_object( $id_or_email ) ) {\n if ( $id_or_email->user_id != '0' ) {\n $user = get_user_by( 'id', $id_or_email->user_id );\n } else {\n return $avatar;\n }\n } else {\n $user = get_user_by( 'email', $id_or_email );\n }\n\n if ( !$user ) {\n return $avatar;\n }\n\n // see if there is a user_avatar meta field\n $user_avatar = get_user_meta( $user->ID, 'dokan_profile_settings', true );\n $gravatar_id = isset( $user_avatar['gravatar'] ) ? $user_avatar['gravatar'] : 0;\n if ( empty( $gravatar_id ) ) {\n return $avatar;\n }\n\n $avater_url = wp_get_attachment_thumb_url( $gravatar_id );\n\n return sprintf( '<img src=\"%1$s\" alt=\"%2$s\" width=\"%3$s\" height=\"%3$s\" class=\"avatar photo\">', esc_url( $avater_url ), $alt, $size );\n}",
"public function getAvatar() {\n return (new Query())->select('profile_photo')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }",
"function imageUser($name) {\n\tif (File::exists(base_path() . '/public/avatar/' . $name)) {\n\t\treturn Asset('avatar/'.$name);\n\t} else {\n\t\treturn Asset('images/default-avatar.png');\n\t}\n}",
"public function addAvatar( $value){\n return $this->_add(5, $value);\n }",
"public function avatarUser()\n {\n return asset(\"storage/images/$this->avatar\");\n }",
"public function getUserAvatar(){\n return($this->userAvatar);\n }",
"function getAvatarPath($pseudo){\n $path =\"./public/images/avatar/\";\n if (isset($_GET['pseudo'])){\n $infoUser = selectInfoUser($_GET['pseudo']);\n }elseif (isset($pseudo) && $pseudo != \"\") {\n $infoUser = selectInfoUser($pseudo);\n }else{\n $infoUser = selectInfoUser($_SESSION['pseudo']);\n }\n\n if (isset($infoUser['avatar'])){\n $name = $infoUser['avatar'];\n }else{\n $name = 'default.png';\n }\n $path .= $name;\n\n return $path;\n}",
"public function editAvatar(EditUserForm $request){\n if(Auth::check()){\n $valid = User::select('id')\n ->where('email', $request->email)\n ->where('id', '<>' , $request->id)\n ->get();\n if(count($valid) <= 0){\n\n $user = User::find($request->id);\n $oldAvatar = $user->avatar; \n\n if ($request->avatar == $oldAvatar){\n\n $fileName = $request->avatar;\n }\n else{\n\n if ( $oldAvatar =='img/img_profile_users/default-avatar2.jpg') {\n\n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n }\n else{\n \n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n unlink($oldAvatar);\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n };\n } \n\n $sessionUser = Auth::user()->name;\n //$user = User::find($request->id);\n $user->name = $request->name;\n $user->email = $request->email;\n $user->telephone = $request->telephone;\n $user->dependence = $request->dependence;\n $user->role = $request->role;\n $user->avatar = $fileName;\n $user->save();\n $audi_users = new Audi_Users;\n $audi_users->name = $request->name;\n $audi_users->email = $request->email;\n $audi_users->telephone = $request->telephone;\n $audi_users->dependence = $request->dependence;\n $audi_users->role = $request->role;\n $audi_users->avatar = $fileName;\n $audi_users->id_user = Auth::user()->id;\n $audi_users->tipo_audi = 2;\n $audi_users->save();\n return ['success'=>'ok'];\n }else{\n return ['error'=>'Este correo ya esta asignado a otro usuario'];\n }\n }\n else{\n return ['error'=>'no se pudo completar la operacion'];\n }\n }",
"public function vl_avatar_function(){\r\n\t\t\tglobal $current_user;\r\n\t\t\t$user_id = $current_user->ID;\r\n\t\t\t?>\r\n\t\t\t<div class=\"vl_profile_avatar_container\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$size= get_option('fancy-style-size');\r\n\t\t\t\tif ( is_user_logged_in() ) {\r\n\t\t\t\t\techo 'Welcome : ' . esc_html( $current_user->display_name );\r\n\t\t\t\t\techo \"<br>\";\r\n\t\t\t\t\techo $this->vl_get_avatars( $user_id,$user_id, $size ,'avatar','avatar'); ?>\r\n\t\t\t\t\t<br class=\"small-grid\">\r\n\t\t\t\t\t<div class=\"vl_upload_container profile_avatar_upload_container hidden\">\r\n\t\t\t\t\t\t<div class=\"vl_upload_area\">Upload</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"upload-button\">\r\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-block vl_profile_upload_btn\">UPLOAD</button>\r\n\t\t\t\t\t\t<br class=\"tiny-grid\">\r\n\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t\t<?php\r\n\t\t\t}else{\r\n\t\t\t\techo \"Sorry! you are not logged in\";\r\n\t\t\t\techo \"<br>\";\r\n\t\t\t\t echo get_avatar($current_user->ID);\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}",
"public function setAvatar($avatar){\n\t\t$pictureName = 'default.png';\n\t\t\n\t\tif ($avatar){\n\t\t\t$pictureName = $this->saveImage($avatar);\n\t\t}\n\t\t$this->avatar = $pictureName;\n\t}",
"public function getImg_avatar()\r\n {\r\n return $this->img_avatar;\r\n }",
"public function avatar(){\n if($this->avatar){\n return asset('/avatars/patients/'.$this->avatar);\n }else{\n return \"https://www.gravatar.com/avatar/{{md5(trim($this->fname))}}?d=mm&s=150\" ;\n }\n }",
"public function getAvatar()\r\n\t{\r\n\t\t$avatar = null;\r\n\t\t$avatars = $this->getAvatars();\r\n\t\tif(count($avatars) == 0)\r\n\t\t{\r\n\t\t\t$avatar = new Avatar();\r\n\t\t\t$avatar->setProfile($this);\r\n\t\t\t$avatar->save();\r\n\t\t}\r\n\t\telse\r\n\t\t\t$avatar = $avatars[0];\r\n\t\t\r\n\t\treturn $avatar;\r\n\t}",
"public function getDefaultAvatar()\n\t{\n\t\t$event = new Event('onApplicationGetDefaultAvatar');\n\t\tFactory::getDispatcher()->triggerEvent($event);\n\n\t\treturn $event->getArgument('avatar', false);\n\t}",
"public function getAvatar()\n {\n // so that updated images happen when users change their avatar. Also fixes #9822\n if (!isset($this->data['avatar'])) {\n $ui = app(UserInfoRepository::class)->getByID($this->data['id']);\n if ($ui) {\n $this->data['avatar'] = $ui->getUserAvatar()->getPath();\n }\n }\n return $this->data['avatar'];\n }",
"public function saveUserAvatar($avatar) {\n\n $img = file_get_contents($avatar);\n $ava = $this->generateUniqueAvatarName();\n $file = Yii::app()->baseUrl.'images/members/avatars/'.$ava;\n file_put_contents($file, $img);\n\n return $ava;\n }",
"public function get_avatar($avatar, $id_or_email, $size = '96', $default = '', $alt = false ) { \n\t\tglobal $phpbbForum;\n\n\t\tif (!$this->is_working() || !$this->get_setting('integrateLogin') || !$this->get_setting('avatarsync')) { \n\t\t\treturn $avatar;\n\t\t}\n\n\t\t$safe_alt = (false === $alt) ? esc_attr(__('Avatar image', 'wp-united')) : esc_attr($alt);\n\n\t\t$user = false;\n\n\t\tif ( !is_numeric($size) )\n\t\t\t$size = '96';\n\n\t\t// Figure out if this is an ID or e-mail --sourced from WP's pluggable.php\n\t\tif ( is_numeric($id_or_email) ) {\n\t\t\t$id = (int) $id_or_email;\n\t\t\t$user = get_userdata($id);\n\t\t} elseif (is_object($id_or_email)) {\n\t\t\tif (!empty($id_or_email->user_id)) {\n\t\t\t\t$id = (int)$id_or_email->user_id;\n\t\t\t\t$user = get_userdata($id);\n\t\t\t}\n\t\t} else {\n\t\t\t$email = $id_or_email;\n\t\t\t$user = get_user_by('email', $id_or_email);\n\t\t\tif(is_object($user)) {\n\t\t\t\t$id = $user->user_id;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif(!$user) {\n\t\t\treturn $avatar;\n\t\t}\n\n\t\t$wpuIntID = wpu_get_integrated_phpbbuser($user->ID);\n\t\t\n\t\tif(!$wpuIntID) { \n\t\t\t// the user isn't integrated, show WP avatar\n\t\t\treturn $avatar;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$phpbbAvatar = $phpbbForum->get_avatar($wpuIntID, $size, $size, $safe_alt);\t\n\t\t\t\n\t\t\tif(!empty($phpbbAvatar) && (stristr($phpbbAvatar, 'wpuput=1') === false)) {\n\t\t\t\t$phpbbAvatar = str_replace('src=', 'class=\"avatar avatar-' . $size . ' photo\" src=', $phpbbAvatar);\n\t\t\t\treturn $phpbbAvatar;\n\t\t\t}\n\t\t\t\n\t\t\treturn $avatar;\n\t\t\t\n\t\t}\n\t}",
"protected function getAvatar()\n\t{\n\t\treturn $this->avatar();\n\t}",
"public function changeAvatar($file)\n\t{\n\t\t$photoname = Helper::makeUuid() . '.png';\n\t\tImage::make($file)->resize(300,300)->save(storage_path() . '/hphotos/xpf1/' . $photoname);\n\t\t//$file->move(storage_path() . '/hphotos/xpf1/',$photoname);\n\t\t$this->instance->profile = $photoname;\n\t\t$this->instance->save();\n\t}",
"function generateAvatar($fullname)\n {\n $avatarName = urlencode(\"{$fullname}\");\n return \"https://ui-avatars.com/api/?name={$avatarName}&background=838383&color=FFFFFF&size=140&rounded=true\";\n }",
"public static function switchAvatar\n\t(\n\t\t$uniID\t\t\t// <int> The Uni-Account to create an avatar for.\n\t,\t$aviID\t\t\t// <int> The avatar to use.\n\t)\t\t\t\t\t// RETURNS <bool> TRUE on success, or FALSE if failed.\n\t\n\t// AppAvatar::switchAvatar($uniID, $aviID);\n\t{\n\t\t// Check if you have an avatar with this identification\n\t\t$has = Database::selectOne(\"SELECT avatar_id FROM avatars WHERE uni_id=? AND avatar_id=?\", array($uniID, $aviID));\n\t\tif($has !== false)\n\t\t{\n\t\t\t// Switch to the chosen avatar\n\t\t\tif(Database::query(\"UPDATE users SET avatar_opt=? WHERE uni_id=? LIMIT 1\", array($has['avatar_id'], $uniID)))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function user_user_construct_($user){\n\t\t$CI =& get_instance();\n\t\t//if($user->is_logged() && $user->get()->avatar == '') $user->update('avatar',$CI->gears->user->avatar->default);\n\t}",
"public function hasAvatar(){\n return $this->_has(5);\n }",
"public function get_avatar()\n\t{\n\t\treturn $this->user_loader->get_avatar($this->get_data('from_user_id'));\n\t}",
"private function deleteLatestAvatar()\n {\n $userId = Auth::user()->id;\n $userLatestAvatar = Avatar::where('user_id', $userId)->oldest()->first();\n if ($userLatestAvatar) {\n $imageUrl = $userLatestAvatar->image_url;\n if (!strpos($imageUrl, 'default')) {\n $locationImage = public_path('uploads/avatars/' . $imageUrl);\n unlink($locationImage);\n }\n $userLatestAvatar->delete();\n }\n }",
"function ciniki_users_avatarGet($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n // FIXME: Add ability to get another avatar for sysadmin\n 'user_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'User'), \n 'version'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Version'),\n 'maxlength'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Maximum Length'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.avatarGet', $args['user_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the users avatar image_id\n //\n $avatar_id = 0;\n if( isset($ciniki['session']['user']['avatar_id']) && $ciniki['session']['user']['avatar_id'] > 0 ) {\n $avatar_id = $ciniki['session']['user']['avatar_id'];\n }\n\n //\n // FIXME: If no avatar specified, return the default icon\n //\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'private', 'getUserImage');\n return ciniki_images_getUserImage($ciniki, $ciniki['session']['user']['id'], $avatar_id, $args['version'], $args['maxlength']);\n}",
"function get_avatar($member_avatar=\"\", $member_view_avatars=0, $avatar_dims=\"x\", $avatar_type='', $no_cache=0 )\n {\n \t//-----------------------------------------\n \t// No avatar?\n \t//-----------------------------------------\n \t\n \tif ( ! $member_avatar or $member_view_avatars == 0 or ! $this->vars['avatars_on'] or ( strpos( $member_avatar, \"noavatar\" ) AND !strpos( $member_avatar, '.' ) ) )\n \t{\n \t\treturn \"\";\n \t}\n \t\n \tif ( substr( $member_avatar, -4 ) == \".swf\" and $this->vars['allow_flash'] != 1 )\n \t{\n \t\treturn \"\";\n \t}\n \t\n \t//-----------------------------------------\n \t// Defaults...\n \t//-----------------------------------------\n \t\n \t$davatar_dims = explode( \"x\", strtolower($this->vars['avatar_dims']) );\n\t\t$default_a_dims = explode( \"x\", strtolower($this->vars['avatar_def']) );\n \t$this_dims = explode( \"x\", strtolower($avatar_dims) );\n\t\t\n\t\tif (!isset($this_dims[0])) $this_dims[0] = $davatar_dims[0];\n\t\tif (!isset($this_dims[1])) $this_dims[1] = $davatar_dims[1];\n\t\tif (!$this_dims[0]) $this_dims[0] = $davatar_dims[0];\n\t\tif (!$this_dims[1]) $this_dims[1] = $davatar_dims[1];\n\t\t\n \t//-----------------------------------------\n \t// LEGACY: Determine type\n \t//-----------------------------------------\n\t\t\n\t\tif ( ! $avatar_type )\n\t\t{\n\t\t\tif ( preg_match( \"/^http:\\/\\//\", $member_avatar ) )\n\t\t\t{\n\t\t\t\t$avatar_type = 'url';\n\t\t\t}\n\t\t\telse if ( strstr( $member_avatar, \"upload:\" ) or ( strstr( $member_avatar, 'av-' ) ) )\n\t\t\t{\n\t\t\t\t$avatar_type = 'upload';\n\t\t\t\t$member_avatar = str_replace( 'upload:', '', $member_avatar );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$avatar_type = 'local';\n\t\t\t}\n\t \t}\n\t\n\t\t//-----------------------------------------\n\t\t// No cache?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $no_cache )\n\t\t{\n\t\t\t$member_avatar .= '?_time=' . time();\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// No avatar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $member_avatar == 'noavatar' )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// URL avatar?\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ( $avatar_type == 'url' )\n\t\t{\n\t\t\tif ( substr( $member_avatar, -4 ) == \".swf\" )\n\t\t\t{\n\t\t\t\treturn \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" width='{$this_dims[0]}' height='{$this_dims[1]}'>\n\t\t\t\t\t\t<param name='movie' value='{$member_avatar}'><param name='play' value='true'>\n\t\t\t\t\t\t<param name='loop' value='true'><param name='quality' value='high'>\n\t\t\t\t\t\t<param name='wmode' value='transparent'> \n\t\t\t\t\t\t<embed src='{$member_avatar}' width='{$this_dims[0]}' height='{$this_dims[1]}' play='true' loop='true' quality='high' wmode='transparent'></embed>\n\t\t\t\t\t\t</object>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<img src='{$member_avatar}' border='0' width='{$this_dims[0]}' height='{$this_dims[1]}' alt='' />\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Not a URL? Is it an uploaded avatar?\n\t\t//-----------------------------------------\n\t\t\t\n\t\telse if ( ($this->vars['avup_size_max'] > 1) and ( $avatar_type == 'upload' ) )\n\t\t{\n\t\t\t$member_avatar = str_replace( 'upload:', '', $member_avatar );\n\t\t\t\n\t\t\tif ( substr( $member_avatar, -4 ) == \".swf\" )\n\t\t\t{\n\t\t\t\treturn \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" width='{$this_dims[0]}' height='{$this_dims[1]}'>\n\t\t\t\t\t\t<param name='movie' value='{$this->vars['upload_url']}/$member_avatar'><param name='play' value='true'>\n\t\t\t\t\t\t<param name='loop' value='true'><param name='quality' value='high'>\n\t\t\t\t\t\t<param name='wmode' value='transparent'> \n\t\t\t\t\t <embed src='{$this->vars['upload_url']}/$member_avatar' width='{$this_dims[0]}' height='{$this_dims[1]}' play='true' loop='true' quality='high' wmode='transparent'></embed>\n\t\t\t\t\t\t</object>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<img src='{$this->vars['upload_url']}/$member_avatar' border='0' width='{$this_dims[0]}' height='{$this_dims[1]}' alt='' />\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// No, it's not a URL or an upload, must\n\t\t// be a normal avatar then\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ($member_avatar != \"\")\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Do we have an avatar still ?\n\t\t \t//-----------------------------------------\n\t\t \t\n\t\t\treturn \"<img src='{$this->vars['AVATARS_URL']}/{$member_avatar}' border='0' alt='' />\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// No, ok - return blank\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\treturn \"\";\n\t\t}\n }",
"function target_add_avatar($avatar)\n{\n\t$avatar_file = basename($avatar['file']);\n\tif (empty($avatar['descr'])) {\n\t\t$avatar['descr'] = $avatar_file;\n\t}\n\n\tif (empty($avatar['custom'])) {\n\t\t$avatar_dir = $GLOBALS['WWW_ROOT_DISK'] .'images/avatars/';\n\t} else {\n\t\t$avatar_dir = $GLOBALS['WWW_ROOT_DISK'] .'images/custom_avatars/';\n\t}\n\n\t$ext = strtolower(substr(strrchr($avatar['file'], '.'),1));\n\tif ($ext != 'jpeg' && $ext != 'jpg' && $ext != 'png' && $ext != 'gif') {\n\t\tpf('...Skip invalid avatar ['. $avatar['descr'] .']');\n\t\treturn;\n\t}\n\n\tif ($GLOBALS['VERBOSE']) pf('...'. $avatar['descr']);\n\n\t$old_umask=umask(0);\n\tif( !copy($avatar['file'], $avatar_dir . $avatar_file) ) {\n\t\tpf('WARNING: Couldn\\'t copy avatar ['. $file .'] to ['. $avatar_dir . $avatar_file .')');\n\t\treturn;\n\t}\n\tumask($old_umask);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'avatar (img, descr) VALUES('. _esc($avatar_file) .','. _esc($avatar['descr']) .')');\n}",
"public function setOppoAvatar($value)\n {\n return $this->set(self::_OPPO_AVATAR, $value);\n }",
"public function getAvatar()\n {\n return $this->getProfilePicture();\n }",
"public function getAvatar()\n {\n return $this->user['avatar'];\n }",
"function scribbles_add_author_avatar() {\n\n\t?>\n\t<div class=\"avatar-container\">\n\n\t\t<?php echo get_avatar( get_the_author_meta( 'user_email' ), '128' ); ?>\n\n\t</div>\n\t<?php\n\n}",
"public function uploadAvatar($file) {\n\t\tif ( $file['error']!=UPLOAD_ERR_OK ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\t$avatar = $this->avatar;\n\n\t\t\tif ( !empty($avatar) && file_exists(SITE_ROOT . '/uploads/avatars/' . $avatar) ) {\n\t\t\t\tunlink(SITE_ROOT . '/uploads/avatars/' . $avatar);\n\t\t\t}\n\t\t\t$avatar = $this->getId() . '.' . pathinfo($file['name'], PATHINFO_EXTENSION);\n\n\t\t\tif ( move_uploaded_file($file['tmp_name'], 'uploads/avatars/' . $avatar) ) {\n\t\t\t\treturn $avatar;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t}",
"function caldol_bbp_get_topic_author_avatar($author_avatar, $topic_id, $size ) {\n\tglobal $bp;\n\t$author_avatar = '';\n\t$size = 30;\n\t$topic_id = bbp_get_topic_id( $topic_id );\n\tif ( !empty( $topic_id ) ) {\n\t\tif ( !bbp_is_topic_anonymous( $topic_id ) ) {\n\t\t\t$author_avatar = bp_core_fetch_avatar( 'item_id=' . bbp_get_topic_author_id( $topic_id ) ); //bbp_get_topic_author_avatar( bbp_get_topic_author_id( $topic_id ), $size );\n\t\t} else {\n\t\t\t$author_avatar = bp_core_fetch_avatar(bbp_get_topic_author_id( $topic_id ) );//bbp_get_topic_author_avatar( bbp_get_topic_author_id( $topic_id ), $size );\n\t\t\t//$author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );\n\t\t}\n\t}\n\treturn $author_avatar;\n\n}",
"public function availablePhoto(){\n\t\t$this->query->save(\"pmj_member_photo\",array(\"registration_id\"=>getSessionUser(),\"filename_ori\"=>$this->input->post('radio-avatar'),\"filename\"=>$this->input->post('radio-avatar'),\"filename_thumb\"=>$this->input->post('radio-avatar'),\"type\"=>\"main\",\"avatar\"=>\"1\",\"submit_date\"=> date(\"Y-m-d H:i:s\"),\"status\"=>\"online\"));\n\t\t\n\t\tredirect(base_url().\"profile\");\n\t}",
"public function getAvatar()\n {\n return $this->Avatar;\n }",
"public function getAvatar()\n {\n return $this->Avatar;\n }",
"function _getAvatarImg($data) {\n\t\tglobal $_JC_CONFIG, $mosConfig_live_site, $grav_link, $database, $mosConfig_absolute_path,\n\t\t\t\t$mosConfig_db;\n\t\t\n\t\t$grav_url = $mosConfig_live_site . \"/components/com_jomcomment/smilies/guest.gif\";\n\t\t\n\t\t$gWidth = ($_JC_CONFIG->get('gWidth')) ? intval($_JC_CONFIG->get('gWidth')) : \"\";\n\t\t$gHeight = ($_JC_CONFIG->get('gHeight')) ? intval($_JC_CONFIG->get('gHeight')) : \"\";\n\t\t\n\t\tswitch ($_JC_CONFIG->get('gravatar')) {\n\t\t\tcase \"gravatar\" :\n\t\t\t\t$gWidth = ($gWidth) ? $gWidth : \"40\";\n\t\t\t\t$grav_url = \"http://www.gravatar.com/avatar.php?gravatar_id=\" . md5($data->email) .\n\t\t\t\t\"&default=\" . urlencode($mosConfig_live_site . \"/components/com_jomcomment/smilies/guest.gif\") .\n\t\t\t\t\"&size=$gWidth\";\n\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"cb\" :\n\t\t\t\t$database->setQuery(\"SELECT avatar FROM #__comprofiler WHERE user_id=\" . $data->user_id . \" AND avatarapproved=1\");\n\t\t\t\t$result = $database->loadResult();\n\t\t\t\tif ($result) {\n\t\t\t\t\t// CB might store the images in either of this 2 folder\n\t\t\t\t\tif (file_exists($mosConfig_absolute_path . \"/components/com_comprofiler/images/\" . $result))\n\t\t\t\t\t\t$grav_url = $mosConfig_live_site . \"/components/com_comprofiler/images/\" . $result;\n\t\t\t\t\telse\n\t\t\t\t\t\tif (file_exists($mosConfig_absolute_path . \"/images/comprofiler/\" . $result))\n\t\t\t\t\t\t\t$grav_url = $mosConfig_live_site . \"/images/comprofiler/\" . $result;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"smf\" :\n\t\t\t\t$smfPath = $_JC_CONFIG->get('smfPath');\n\t\t\t\t$smfPath = trim($smfPath);\n\t\t\t\t$smfPath = rtrim($smfPath, '/');\n\t\t\t\tif (!$smfPath or $smfPath == \"\" or !file_exists(\"$smfPath/Settings.php\"))\n\t\t\t\t\t$smfPath = \"$mosConfig_absolute_path/forum\";\n\t\t\t\tif (!$smfPath or $smfPath == \"\" or !file_exists(\"$smfPath/Settings.php\")) {\n\t\t\t\t\t$database->setQuery(\"select id from #__components WHERE `option`='com_smf'\");\n\t\t\t\t\tif ($database->loadResult()) {\n\t\t\t\t\t\t$database->setQuery(\"select value1 from #__smf_config WHERE variable='smf_path'\");\n\t\t\t\t\t\t$smfPath = $database->loadResult();\n\t\t\t\t\t\t$smfPath = str_replace(\"\\\\\", \"/\", $smfPath);\n\t\t\t\t\t\t$smfPath = rtrim($smfPath, \"/\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (file_exists(\"$smfPath/Settings.php\")) {\n\t\t\t\t\tinclude(\"$smfPath/Settings.php\");\n\t\t\t\t\tmysql_select_db($mosConfig_db, $database->_resource);\n\t\t\t\t\t$useremail = $data->email;\n\t\t\t\t\tmysql_select_db($db_name, $database->_resource);\n\t\t\t\t\t$q = sprintf(\"SELECT avatar,ID_MEMBER FROM $db_prefix\" . \"members WHERE emailAddress='$useremail'\");\n\t\t\t\t\t$result = mysql_query($q);\n\t\t\t\t\tif ($result)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result_row = mysql_fetch_array($result);\n\t\t\t\t\t\tmysql_select_db($mosConfig_db, $database->_resource);\n\t\t\t\t\t\tif ($result_row) {\n\t\t\t\t\t\t\t$id_member = $result_row[1];\n\t\t\t\t\t\t\tif (trim($result_row[0]) != \"\") {\n\t\t\t\t\t\t\t\tif (substr($result_row[0], 0, 7) != \"http://\")\n\t\t\t\t\t\t\t\t\t$grav_url = $boardurl . \"/avatars/$result_row[0]\";\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$grav_url = $result_row[0];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmysql_select_db($db_name);\n\t\t\t\t\t\t\t\t$q = sprintf(\"SELECT ID_ATTACH FROM $db_prefix\" . \"attachments WHERE ID_MEMBER='$id_member' and ID_MSG=0 and attachmentType=0\");\n\t\t\t\t\t\t\t\t$result = mysql_query($q);\n\t\t\t\t\t\t\t\tif ($result)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$result_avatar = mysql_fetch_array($result);\n\t\t\t\t\t\t\t\t\tmysql_select_db($mosConfig_db, $database->_resource);\n\t\t\t\t\t\t\t\t\tif ($result_avatar[0])\n\t\t\t\t\t\t\t\t\t\t$grav_url = \"$boardurl/index.php?action=dlattach;attach=\" . $result_avatar[0] . \";type=avatar\";\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\t\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $grav_url;\n\t}",
"function addavatar ( $avatar_defaults ) {\n\t\t//js is used to create a live preview\n\t\t$options = get_option( 'robohash_options', array( 'bot' => 'set1', 'bg' => 'bg1' ) );\n\n\t\t$bots = '<label for=\"robohash_bot\">Body</label> <select id=\"robohash_bot\" name=\"robohash_bot\">';\n\t\t$bots .= '<option value=\"set1\" '.selected( $options['bot'], 'set1', false ).'>Robots</option>';\n\t\t$bots .= '<option value=\"set2\"'.selected( $options['bot'], 'set2', false ).'>Monsters</option>';\n\t\t$bots .= '<option value=\"set3\"'.selected( $options['bot'], 'set3', false ).'>Robot Heads</option>';\n\t\t$bots .= '<option value=\"any\"'.selected( $options['bot'], 'any', false ).'>Any</option>';\n\t\t$bots .= '</select> ';\n\n\t\t$bgs = '<label for=\"robohash_bg\">Background</label> <select id=\"robohash_bg\" name=\"robohash_bg\">';\n\t\t$bgs .= '<option value=\"\" '.selected( $options['bg'], '', false ).'>None</option>';\n\t\t$bgs .= '<option value=\"bg1\" '.selected( $options['bg'], 'bg1', false ).'>Scene</option>';\n\t\t$bgs .= '<option value=\"bg2\" '.selected( $options['bg'], 'bg2', false ).'>Abstract</option>';\n\t\t$bgs .= '<option value=\"any\" '.selected( $options['bg'], 'any', false ).'>Any</option>';\n\t\t$bgs .= '</select>';\n\t\t$hidden = '<input type=\"hidden\" id=\"spinner\" value=\"'. admin_url('images/wpspin_light.gif') .'\" />';\n\n\t\t//current avatar, based on saved options\n\t\t$avatar_url = \"{$this->url}?set={$options['bot']}&bgset={$options['bg']}\";\n\n\t\t$avatar_defaults[ $avatar_url ] = \t$bots.$bgs.$hidden;\n\n\t\treturn $avatar_defaults;\n\t}",
"function getAvatarImg($img)\n{\n\t$ret = $img ? makeImg($img, ARC_AVATAR_PATH) : '';\n\n\treturn $ret;\n}",
"public function ThisUserAvatar( $size ){\r\n\t\tif( is_user_logged_in() ){\r\n\t\t\treturn get_avatar(get_current_user_id(), $size);\r\n\t\t}\r\n\t}",
"function fetch_user_info($id){\n\t\t$id = (int)$id;\n\t\t\n\t\t$sql = \"SELECT * FROM users WHERE id = {$id}\";\n\t\t$result = mysql_query($sql);\n\t\t\n\t\t$info = mysql_fetch_assoc($result);\n\t\t$info['avatar'] = (file_exists(\"{$GLOBALS['path']}/user_avatars/{$info['id']}.jpg\")) ? \"core/user_avatars/{$info['id']}.jpg\" : \"core/user_avatars/default.jpg\";\n\t\t\n\t\treturn $info;\n\t}",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function getAvatar()\n {\n return $this->profile->getAvatar();\n }",
"public function getAvatarImage() : string\n {\n $imagePlaceholder = asset('storage/images/profiles') . '/' . Auth::user()->avatar;\n\n if(empty(Auth::user()->avatar)) {\n $imagePlaceholder = asset('img/user-image-placeholder.png');\n }\n\n return $imagePlaceholder;\n }",
"public function outputAvatarImage()\n\t{\n\t\techo $this->app->html->img($this->avatar_url, $this->avatar_width, $this->avatar_height, $this->username);\n\t}",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public static function getUserLoginAvatar() {\n return Yii::$app->session->get(UserHelper::SESSION_AVATAR);\n }",
"public function hasAvatar(){\n return $this->_has(6);\n }",
"public function avatar($id){\n \n Auth::userAuth();\n $data['title1'] = 'Edit Avatar';\n if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['addAvatar']){\n\n echo $pro_img = $_FILES['image']['name'];\n $pro_tmp = $_FILES['image']['tmp_name'];\n $pro_type = $_FILES['image']['type'];\n if(!empty($pro_img)){\n $uploaddir = dirname(ROOT).'\\public\\uploads\\\\' ;\n $pro_img = explode('.',$pro_img);\n $pro_img_ext = $pro_img[1];\n $pro_img = $pro_img[0].time().'.'.$pro_img[1];\n\n if($pro_img_ext != \"jpg\" && $pro_img_ext != \"png\" && $pro_img_ext != \"jpeg\"\n && $pro_img_ext != \"gif\" ) {\n $data['errImg']= \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n }\n }else {\n $data['errImg'] = 'You must choose an image';\n }\n \n\n if(empty($data['errImg'])){\n move_uploaded_file($pro_tmp, $uploaddir.$pro_img);\n unlink($uploaddir.Session::name('user_img'));\n $this->userModel->avatar($id,$pro_img);\n Session::set('user_img',$pro_img );\n Session::set('success', 'Your avatar has been uploaded successfully');\n Redirect::to('users/profile');\n }else {\n $this->view('users.avatar', $data);\n }\n }else {\n $this->view('users.avatar',$data);\n }\n }",
"protected function saveUserProfile(){\n\t\t$req = $this->postedData;\n\t\t$avatar = $req['avatar'];\n\t\t// Si un fichier est chargé, alors l'utilisateur veut certainement celui-ci comme avatar...\n\t\tif (isset($_FILES['field_string_avatarFile']) and !empty($_FILES['field_string_avatarFile']['name'])) $avatar = 'user';\n\n\t\tswitch ($avatar){\n\t\t\tcase 'default': $this->user->setAvatar('default'); break;\n\t\t\tcase 'gravatar': $this->user->setAvatar('gravatar'); break;\n\t\t\tcase 'user':\n\t\t\t\t$userAvatarFile = Sanitize::sanitizeFilename($this->user->getName()).'.png';\n\t\t\t\tif ((!isset($_FILES['field_string_avatarFile']) or empty($_FILES['field_string_avatarFile']['name'])) and !file_exists(\\Settings::AVATAR_PATH.$userAvatarFile)){\n\t\t\t\t\t// Si l'utilisateur n'a pas d'image déjà chargée et qu'il n'en a pas indiqué dans le champ adéquat, on retourne false\n\t\t\t\t\tnew Alert('error', 'Impossible de sauvegarder l\\'avatar, aucune image n\\'a été chargée !');\n\t\t\t\t\treturn false;\n\t\t\t\t}elseif(isset($_FILES['field_string_avatarFile']) and !empty($_FILES['field_string_avatarFile']['name'])){\n\t\t\t\t\t// Chargement de l'image\n\t\t\t\t\t$args = array();\n\t\t\t\t\t$args['resize'] = array('width' => 80, 'height' => 80);\n\t\t\t\t\t// Les avatars auront le nom des utilisateurs, et seront automatiquement transformés en .png par SimpleImages\n\t\t\t\t\t$args['name'] = $this->user->getName().'.png';\n\t\t\t\t\t$avatarFile = Upload::file($_FILES['field_string_avatarFile'], \\Settings::AVATAR_PATH, \\Settings::AVATAR_MAX_SIZE, \\Settings::ALLOWED_IMAGES_EXT, $args);\n\t\t\t\t\tif (!$avatar) {\n\t\t\t\t\t\tnew Alert('error', 'L\\'avatar n\\'a pas été pris en compte !');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$this->user->setAvatar($avatarFile);\n\t\t\t\t}else{\n\t\t\t\t\t// Si l'utilisateur a déjà une image chargée et qu'il n'en a pas indiqué de nouvelle, on lui remet celle qu'il a déjà.\n\t\t\t\t\t$this->user->setAvatar($userAvatarFile);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ldap': $this->user->setAvatar('ldap');\n\t\t}\n\t\t// L'authentification via LDAP ramène déjà le nom l'adresse email et la gestion du mot de passe\n\t\tif (AUTH_MODE == 'sql'){\n\t\t\tif (!isset($req['name'])){\n\t\t\t\tnew Alert('error', 'Vous n\\'avez pas indiqué le nom d\\'utilisateur !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!isset($req['email'])){\n\t\t\t\tnew Alert('error', 'Vous n\\'avez pas indiqué l\\'adresse email !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$name = htmlspecialchars($req['name']);\n\t\t\tif (UsersManagement::getDBUsers($name) != null and $name != $this->user->getName()){\n\t\t\t\tnew Alert('error', 'Ce nom d\\'utilisateur est déjà pris !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$email = $req['email'];\n\t\t\tif (!\\Check::isEmail($email)){\n\t\t\t\tnew Alert('error', 'Le format de l\\'adresse email que vous avez saisi est incorrect !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$currentPwd = (isset($req['currentPwd'])) ? $req['currentPwd'] : null;\n\t\t\t$newPwd = (isset($req['newPwd'])) ? $req['newPwd'] : null;\n\t\t\tif (!empty($newPwd)){\n\t\t\t\t// On vérifie que le mot de passe actuel a bien été saisi\n\t\t\t\tif (!ACL::canAdmin('admin', 0) and empty($currentPwd)){\n\t\t\t\t\tnew Alert('error', 'Vous avez saisi un nouveau mot de passe sans saisir le mot de passe actuel !');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// On vérifie que le mot de passe actuel est correct\n\t\t\t\tif (!ACL::canAdmin('admin', 0) and Login::saltPwd($currentPwd) != $this->user->getPwd()){\n\t\t\t\t\tnew Alert('error', 'Le mot de passe actuel que vous avez saisi est incorrect !');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// On vérifie que le nouveau mot de passe comporte bien le nombre minimum de caractères requis\n\t\t\t\tif (strlen($newPwd) < \\Settings::PWD_MIN_SIZE){\n\t\t\t\t\tnew Alert('error', 'Le mot de passe doit comporter au moins '.\\Settings::PWD_MIN_SIZE.' caractères !');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$this->user->setPwd($newPwd);\n\t\t\t}\n\t\t}\n\n\t\tif (UsersManagement::updateDBUser($this->user)){\n\t\t\t$msg = ($this->user->getId() == $GLOBALS['cUser']->getId()) ? '' : 'de '.$this->user->getName().' ';\n\t\t new Alert('success', 'Les paramètres du profil '.$msg.'ont été correctement sauvegardés !');\n\t\t\treturn true;\n\t\t}else{\n\t\t\tnew Alert('error', 'Echec de la sauvegarde des paramètres !');\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getOppoAvatar()\n {\n return $this->get(self::_OPPO_AVATAR);\n }",
"public function getAvatar(): Avatar {\n return $this->avatar;\n }",
"public function getAvatar() {\n\t\treturn $this->avatar;\n\t}",
"protected function defaultProfilePhotoUrl()\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=252f3f&background=EBF4FF';\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatarList(){\n return $this->_get(5);\n }",
"public function getSetAvatarReply()\n {\n return $this->get(self::_SET_AVATAR_REPLY);\n }",
"public function soumettre(Request $request)\n {\n $avatarPath = $request->session()->get('avatarPath');\n\n $dossier = 'storage/imagesSubmits/';\n $user=Auth::User()->id;\n $avatars=Avatar::all();\n foreach($avatars as $avatar){\n $userId = $avatar->user_id;\n $imageValide = $avatar->imageValider;\n if ($userId==$user and $imageValide == false){\n $avatar->delete();\n }\n /*if($avatar==$user){\n echo ('trouve doublon de '.$username);\n }*/\n }\n $avatarName=$_POST['publierNom'];\n $avatar = new Avatar();\n $avatar->user_id = $user;\n $avatar->imageUrl = $avatarName;\n $avatar->save();\n //recupere l'extension du nom de l'image\n $avatarHeader = 'image/'.substr(strrchr($avatarName, '.'),1);\n //sauvegarde de l'image cropped apres encodage(balise canvas)/decodage Base64\n \\header($avatarHeader);\n $avatarBase64=$_POST['publierHref'];\n //on retire le MINE-type et le mot clé present pour ne recuperer que la data de l'encodage\n $avatarBase64= substr(strrchr($avatarBase64,','),1);\n $avatarData=base64_decode($avatarBase64);\n $avatarImage=imagecreatefromstring($avatarData);\n imagejpeg($avatarImage,$dossier.$avatarName);\n\n return view ('profile.profile',compact('avatarPath'));\n }",
"static function showAvatar($userId=-1,$linkTo='finfo'){\r\n\t\t\t\r\n\t\t$avatarUserId = $userId;\r\n\t\tif( $avatarUserId == -1) {\r\n\t\t\t$user = FUser::getInstance();\r\n\t\t\t$avatarUserId = $user->userVO->userId;\r\n\t\t}\r\n\t\t$cacheId = $avatarUserId;\r\n\t\t$cacheGrp = 'avatar';\r\n\t\t\r\n\t\t$cache = FCache::getInstance('l');\r\n\t\t$ret = $cache->getData($cacheId,$cacheGrp);\r\n\t\tif(false !== $ret) return $ret;\r\n\r\n\t\t//set cache\r\n\t\tif(!isset($user)) $user = FUser::getInstance();\r\n\r\n\t\tif($userId == -1 ) $avatarUserName = $user->userVO->name;\r\n\t\telseif($userId > 0) $avatarUserName = FUser::getgidname($avatarUserId);\r\n\t\telse $avatarUserName = '';\r\n\t\t\r\n\t\t$ret = '<img src=\"'.FAvatar::getAvatarUrl(($userId==-1)?(-1):($avatarUserId)).'\" alt=\"'.$avatarUserName.'\" class=\"userAvatar\" />';\r\n\t\tif($userId > 0) {\r\n\t\t\t$ret = '<a href=\"'.FSystem::getUri('who='.$userId.'#tabs-profil',$linkTo).'\">'.$ret.'</a>';\r\n\t\t}\r\n\t\t$cache->setData($ret, $cacheId, $cacheGrp);\r\n\t\treturn $ret;\r\n\t}",
"public function updateAvatar(Request $request){\n \tif($request->hasFile('avatar')){\n \t\t$avatar = $request->file('avatar');\n \t\t$filename = preg_replace('/\\s+/', '', Auth::user()->name) . time() . '.' . $avatar->getClientOriginalExtension();\n\n \t\t// Delete current image before uploading new image\n if (Auth::user()->avatar !== 'default.jpg') {\n $file = public_path('/uploads/avatars/' . Auth::user()->avatar);\n if (File::exists($file)) {\n unlink($file);\n }\n }\n\n \t\tImage::make($avatar)->resize(300, 300)->save( public_path('/uploads/avatars/' . $filename ) );\n\n \t\t$user = Auth::user();\n \t\t$user->avatar = $filename;\n \t\t$user->save();\n \t}\n\n \t//return view('user.profile', array('user' => Auth::user()) );\n return back();\n\n }",
"public function diviroids_user_avatar($atts)\n {\n extract(shortcode_atts(array( 'size' => 64, 'class' => null, 'extra_attr' => ''), $atts));\n $userId = DiviRoids_Security::get_current_user('ID');\n $avatar = (0 !== $userId) ? get_avatar($userId, $size, '', '', array('class' => $class, 'extra_attr' => $extra_attr)) : '';\n\n return $avatar;\n }",
"public function getProfilePicture();",
"public function getAvatarAttribute($value)\n {\n return $this->timeline->avatar ? $this->timeline->avatar->source : url('user/avatar/default-'.$this->gender.'-avatar.png');\n }",
"function supportDefaultAvatar()\n {\n\n // Check if a default avatar is defined\n $default = $this->getDefaultImageConfiguration();\n if (empty($default['defaultavatar'])) {\n return false;\n }\n\n // check if default avatar method is configured as one of the avatar methods.\n for($methodnr = 1; $methodnr <= PLUGIN_EVENT_GRAVATAR_METHOD_MAX; $methodnr++){\n $method = $this->get_config(\"method_\" . $methodnr);\n\n // if none is configured, ignore later methods!\n if ($method == 'none'){\n return false;\n }\n\n // return true if default avatar method is found\n if ($method == 'default'){\n return true;\n }\n }\n return false;\n }",
"public function userAvatar(Request $request)\n {\n // validate\n $this->validate($request, [\n 'photo' => ['required', 'image', Rule::dimensions()->minWidth(250)->minHeight(250)->ratio(1 / 1)],\n ]);\n\n // fill variables\n $filename = time() . str_random(16) . '.png';\n $image = Image::make($request->file('photo')->getRealPath());\n $folder = 'users/avatars';\n\n // crop it\n $image = $image->resize(250, 250);\n\n // optimize it\n $image->encode('png', 60);\n\n // upload it\n Storage::put($folder . '/' . $filename, $image);\n $imageAddress = $this->webAddress() . $folder . '/' . $filename;\n\n // delete the old avatar\n if (isset(Auth::user()->avatar)) {\n Storage::delete('users/avatars/' . str_after(Auth::user()->avatar, 'users/avatars/'));\n }\n\n // update user's avatar\n Auth::user()->update([\n 'avatar' => $imageAddress,\n ]);\n\n return $imageAddress;\n }",
"public function getAvatarUrl()\n {\n if (!is_null($this->getLastAvatar()) && Storage::disk('s3')->exists($this->getLastAvatar()->link)) {\n return Storage::disk('s3')->url($this->getLastAvatar()->link);\n }\n\n return $this->sex ? Storage::disk('s3')->url('avatars/user_woman.png') : Storage::disk('s3')->url('avatars/user_man.png');\n }",
"function UserPicture(){\r\n echo \"<img class='user_image' id='user_image' src='../RSAS.net/profile_pictures/$this->picture' onclick='my_account()' />\";\r\n }",
"function update_user_avatar() {\n\n global $DB,$CFG;\n require_once($CFG->dirroot . '/local/elggsync/classes/curl.php');\n $config = get_config('local_elggsync');\n $elggmethod = 'get.user.info';\n $moodlefunctionname = 'core_files_upload';\n $elgg_api_key = $config->elggapikey;\n $moodle_token = $config->moodleapikey;\n $serverurl = $CFG->wwwroot .'/webservice/rest/server.php' . '?wstoken=' . $moodle_token .'&wsfunction=' . $moodlefunctionname;\n $restformat = '&moodlewsrestformat=json';\n\n $curl = new local_elggsync\\easycurl;\n\n $results = $DB->get_records_sql(\"SELECT u.id,u.username,u.city, u.description FROM {user} AS u WHERE u.suspended = 0\");\n foreach($results as $result) {\n $url = $CFG->wwwroot.$config->elggpath.'/services/api/rest/json/?method='.$elggmethod.'&api_key='.$elgg_api_key;\n $fetched = $curl->post($url,array('username'=>$result->username));\n $fetched = json_decode($fetched);\n if(isset($fetched) && $fetched->status == 0) {\n if(isset($fetched->result) && $fetched->result->success == true) {\n $avatar_url = (string) $fetched->result->url;\n if(strpos($avatar_url,'/user/default/') !== false) {\n continue;\n }\n else {\n $tmp = explode('/',$avatar_url);\n $imagename = end($tmp);\n unset($tmp);\n $params = array(\n 'component' => 'user',\n 'filearea' => 'draft',\n 'itemid' => 0,\n 'filepath' => '/',\n 'filename' => $result->id.'_'.$imagename,\n 'filecontent' => base64_encode(file_get_contents($avatar_url)),\n 'contextlevel' => 'user',\n 'instanceid' => 2,\n );\n $upload_file = $curl->post($serverurl . $restformat, $params);\n $upload_file = json_decode($upload_file);\n if(isset($upload_file->itemid)) {\n $update_picture = $curl->post($CFG->wwwroot .'/webservice/rest/server.php' . '?wstoken=' . $moodle_token .'&wsfunction=core_user_update_picture' . $restformat, array('draftitemid'=>$upload_file->itemid,'userid'=>$result->id));\n }\n }\n }\n } \n }\n return true;\n}",
"function upload_avatar() {\n\t\t$config['upload_path'] = './'.URL_AVATAR;\n\t\t$config['allowed_types'] = 'gif|jpg|png';\n\t\t$config['max_size']\t\t = 1500;\n\t\t$config['encrypt_name'] = TRUE;\n\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('upload', $config);\n\t\t$CI->upload->do_upload();\n\t\t$image_data = $CI->upload->data();\n\n\t\t$config = array(\n\t\t\t'image_library' => 'gd2',\n\t\t\t'source_image' => $image_data['full_path'], \n\t\t\t'new_image' \t => APPPATH.'../'.URL_AVATAR,\n\t\t\t'maintain_ratio' => TRUE, \n\t\t\t'width' \t\t => 150,\n\t\t\t'height' \t\t => 150\n\t\t);\n\n\t\t$CI->load->library('image_lib', $config);\n\t\t$CI->image_lib->resize();\n\n\t\treturn $image_data['file_name'];\n\t}"
] | [
"0.70023024",
"0.688273",
"0.6747269",
"0.6501792",
"0.64527416",
"0.63555056",
"0.6314505",
"0.6301981",
"0.62796444",
"0.6186766",
"0.6168689",
"0.6125713",
"0.6122509",
"0.61195284",
"0.61110526",
"0.610642",
"0.6095513",
"0.60889924",
"0.60870713",
"0.608177",
"0.6077544",
"0.6075071",
"0.60677266",
"0.60583645",
"0.6057739",
"0.60481316",
"0.60335433",
"0.60240895",
"0.6019282",
"0.6008527",
"0.595382",
"0.5949707",
"0.5947539",
"0.5946073",
"0.59430283",
"0.58972156",
"0.5896237",
"0.58867496",
"0.58717686",
"0.58646613",
"0.5851626",
"0.58465594",
"0.5841041",
"0.5820208",
"0.58129644",
"0.58060867",
"0.580237",
"0.5799375",
"0.5799368",
"0.57914776",
"0.57874346",
"0.5780555",
"0.5778056",
"0.5762366",
"0.5744621",
"0.57414836",
"0.57230616",
"0.57230616",
"0.5722605",
"0.57093334",
"0.5676497",
"0.56749594",
"0.5669077",
"0.56536305",
"0.56536305",
"0.56536305",
"0.56536305",
"0.56536305",
"0.56507444",
"0.5644175",
"0.56201303",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56078786",
"0.5605596",
"0.56049895",
"0.56047946",
"0.5599017",
"0.5585323",
"0.5581588",
"0.5579966",
"0.5579463",
"0.55791044",
"0.5576888",
"0.5571125",
"0.5554173",
"0.55511445",
"0.5549996",
"0.5546569",
"0.55444396",
"0.55414253",
"0.5539731",
"0.55394334",
"0.5538197",
"0.5535401",
"0.55279535"
] | 0.6639116 | 3 |
User Picks an Avatar Separately now | public function profile_complete() {
$data = array();
if (!$this->user->is_logged_in()) {
redirect("/account/info");
}
$this->user->get_user($this->user->getMyId());
$data['user'] = $this->user;
$this->load->view('account/profile_complete', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionAvatar()\n {\n $players=Player::find()->active()->all();\n foreach($players as $player)\n {\n $robohash=new \\app\\models\\Robohash($player->profile->id,'set1');\n $image=$robohash->generate_image();\n if(get_resource_type($image)=== 'gd')\n {\n $dst_img=\\Yii::getAlias('@app/web/images/avatars/'.$player->profile->id.'.png');\n imagepng($image,$dst_img);\n imagedestroy($image);\n $player->profile->avatar=$player->profile->id.'.png';\n $player->profile->save(false);\n }\n }\n }",
"private function changeAvatar()\n {\n try\n {\n global $userquery; \n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($_FILES['avatar_file']['name']))\n throw_error_msg(\"provide avatar_file\");\n\n $array['userid'] = userid();\n $userquery->update_user_avatar_bg($array);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($array['userid']);\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"function getUserImageInitial($userId, $name)\n{\n return getAvatarUrl().\"?name=$name&size=30&rounded=true&color=fff&background=\".getRandomColor($userId);\n}",
"public function avatar() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n\n $this->load->helper('form');\n $this->load->library('form_validation');\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n $hidden_fields = array(\n 'user_id' => $this->user->getMyId(),\n 'set_avatar' => 'set_avatar',\n );\n $data['hidden'] = $hidden_fields;\n $data['avatars'] = $this->user->get_all_avatars();\n if ($this->input->post('set_avatar') == 'set_avatar') {\n if ($this->form_validation->run('account/avatar') === FALSE) {\n $this->load->view('account/avatar', $data);\n\n }\n else {\n $id = $this->user->update_avatar();\n redirect('account/profile_complete');\n }\n }\n else {\n $this->load->view('account/avatar', $data);\n }\n }",
"public function getAvatar($identity);",
"public function avatar()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n $this->load->helper('directory');\n\n $files = directory_map(APPPATH .'../public_html/images/avatar');\n\n foreach ($files AS $key => $file) {\n\n $file_part = explode('.', $file);\n\n if (!is_numeric($file_part[0])) {\n unset($files[$key]);\n }\n }\n\n $view_data['number_avatar'] = count($files);\n \n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->update([\n 'id' => $this->current_user->id,\n 'avatar_id' => $this->input->post('avatar')\n ]);\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n }\n\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n\n $res = $this->get_current_user_detail();\n\n $view_data['current_avatar'] = $res['result']['avatar'];\n\n $this->_render($view_data);\n }",
"public function setAvatar(string $avatar);",
"public function getAvatar(): string;",
"function the_champ_social_avatar_options(){\r\n\tglobal $user_ID, $theChampLoginOptions;\r\n\tif(isset($theChampLoginOptions['enable']) && isset($theChampLoginOptions['avatar']) && isset($theChampLoginOptions['avatar_options'])){\r\n\t\tif(isset($_POST['ss_dontupdate_avatar'])){\r\n\t\t\t$dontUpdateAvatar = intval($_POST['ss_dontupdate_avatar']);\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_dontupdate_avatar', $dontUpdateAvatar);\r\n\t\t}else{\r\n\t\t\t$dontUpdateAvatar = get_user_meta($user_ID, 'thechamp_dontupdate_avatar', true);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_small_avatar']) && heateor_ss_validate_url($_POST['ss_small_avatar']) !== false){\r\n\t\t\t$updatedSmallAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_small_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_avatar', $updatedSmallAvatar);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_large_avatar']) && heateor_ss_validate_url($_POST['ss_large_avatar']) !== false){\r\n\t\t\t$updatedLargeAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_large_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_large_avatar', $updatedLargeAvatar);\r\n\t\t}\r\n\t\t?>\r\n\t\t<div class=\"profile\" style=\"margin-bottom:20px\">\r\n\t\t\t<form action=\"\" method=\"post\" class=\"standard-form base\">\r\n\t\t\t\t<h4><?php _e('Social Avatar', 'super-socializer') ?></h4>\r\n\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_1\"><input id=\"ss_dontupdate_avatar_1\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"1\" <?php echo $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Do not fetch and update social avatar from my profile, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_0\"><input id=\"ss_dontupdate_avatar_0\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"0\" <?php echo ! $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Update social avatar, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_small_avatar\"><?php _e('Small Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_small_avatar\" type=\"text\" name=\"ss_small_avatar\" value=\"<?php echo isset($updatedSmallAvatar) ? $updatedSmallAvatar : get_user_meta($user_ID, 'thechamp_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_large_avatar\"><?php _e('Large Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_large_avatar\" type=\"text\" name=\"ss_large_avatar\" value=\"<?php echo isset($updatedLargeAvatar) ? $updatedLargeAvatar : get_user_meta($user_ID, 'thechamp_large_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save Changes', 'super-socializer') ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t\t<?php\r\n\t}\r\n}",
"function fc_get_easySocial_avatar(){\r\n\t$user = Foundry::user();\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getAvatar());\r\n}",
"public function testUpdateAvatarImage()\n {\n }",
"public function getRandomAvatar(): string {\n\t\t$avatarsArray = $this->getAvatars();\n\n\t\treturn $avatarsArray[array_rand($avatarsArray)];\n\t}",
"function upm_get_avatar($avatar = '') {\r\n global $current_user;\r\n wp_get_current_user();\r\n\r\n if( $current_user && is_object($current_user) && is_a($current_user, 'WP_User')) {\r\n if ($current_user->has_cap('partner') && !empty($current_user->user_image)) {\r\n $avatar = wp_get_attachment_image_url($current_user->user_image,'thumbnail', false);\r\n } else {\r\n $avatar = get_avatar_url($current_user->ID);\r\n }\r\n }\r\n return \"<img class='avatar avatar-64 photo' src='\" . $avatar . \"'>\";\r\n}",
"function fc_get_jomSocial_avatar(){\r\n\t$user =& CFactory::getUser($userid);\r\n\t\r\n\t// Retrieve the avatar.\r\n\treturn correct_avatar_path($user->getThumbAvatar());\r\n}",
"protected function handleAvatar() : void // image\n {\n // something happened in the last years: those textures do not include tiny icons\n $sizes = [/* 'tiny' => 15, */'small' => 18, 'medium' => 36, 'large' => 56];\n $aPath = 'uploads/avatars/%d.jpg';\n $s = $this->_get['size'] ?: 'medium';\n\n if (!$this->_get['id'] || !preg_match('/^([0-9]+)\\.(jpg|gif)$/', $this->_get['id'][0], $matches) || !in_array($s, array_keys($sizes)))\n {\n trigger_error('AjaxProfile::handleAvatar - malformed request received', E_USER_ERROR);\n return;\n }\n\n $this->contentType = $matches[2] == 'png' ? MIME_TYPE_PNG : MIME_TYPE_JPEG;\n\n $id = $matches[1];\n $dest = imageCreateTruecolor($sizes[$s], $sizes[$s]);\n\n if (file_exists(sprintf($aPath, $id)))\n {\n $offsetX = $offsetY = 0;\n\n switch ($s)\n {\n case 'tiny':\n $offsetX += $sizes['small'];\n case 'small':\n $offsetY += $sizes['medium'];\n case 'medium':\n $offsetX += $sizes['large'];\n }\n\n $src = imageCreateFromJpeg(printf($aPath, $id));\n imagecopymerge($dest, $src, 0, 0, $offsetX, $offsetY, $sizes[$s], $sizes[$s], 100);\n }\n else\n trigger_error('AjaxProfile::handleAvatar - avatar file #'.$id.' not found', E_USER_ERROR);\n\n if ($matches[2] == 'gif')\n imageGif($dest);\n else\n imageJpeg($dest);\n }",
"function showAvatar()\n {\n $avatar_size = $this->avatarSize();\n\n $avatar = $this->profile->getAvatar($avatar_size);\n\n $this->out->element('img', array('src' => ($avatar) ?\n $avatar->displayUrl() :\n Avatar::defaultImage($avatar_size),\n 'class' => 'avatar photo',\n 'width' => $avatar_size,\n 'height' => $avatar_size,\n 'alt' =>\n ($this->profile->fullname) ?\n $this->profile->fullname :\n $this->profile->nickname));\n }",
"function avatar_filter( $avatar, $user, $size, $default, $alt ) {\n global $pagenow;\n \n // Do not filter if inside WordPress options page\n if ( 'options-discussion.php' == $pagenow )\n return $avatar;\n\n // If passed an object, assume $user->user_id\n if ( is_object( $user ) )\n $id = $user->user_id;\n\n // If passed a number, assume it was a $user_id\n else if ( is_numeric( $user ) )\n $id = $user;\n\n // If passed a string and that string returns a user, get the $id\n else if ( is_string( $user ) && ( $user_by_email = get_user_by_email( $user ) ) )\n $id = $user_by_email->ID;\n\n // If somehow $id hasn't been assigned, return the result of get_avatar\n if ( empty( $id ) )\n return !empty( $avatar ) ? $avatar : $default;\n\n if ( !$this->loaded_defines ) {\n $this->defines();\n $this->loaded_defines = true;\n } \n \n // Let BuddyPress handle the fetching of the avatar\n $bp_avatar = $this->fetch( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );\n\n // If BuddyPress found an avatar, use it. If not, use the result of get_avatar\n return ( !$bp_avatar ) ? $avatar : $bp_avatar; \n }",
"public function uploadAvatar()\n {\n\n if (!empty($_FILES['avatar']['name'])) {\n\n\n // array containg the extensions of popular image files\n $allowedExtensions = array(\"gif\", \"jpeg\", \"jpg\", \"png\");\n\n //echo $_FILES['avatar']['name'];\n\n\n // make it so i can get the .extension\n $tmp = explode(\".\", $_FILES['avatar']['name']);\n\n\n // get the end part of the file\n $newfilename = hash('sha256', reset($tmp) . time());\n\n $extension = end($tmp);\n\n $_FILES['avatar']['name'] = $newfilename . \".\" . $extension;\n //echo $_FILES['avatar']['name'];\n\n\n // ok here we go.. maybe a switch might be nice?.. meh..\n if ((($_FILES['avatar']['type'] == \"image/gif\")\n || ($_FILES['avatar']['type'] == \"image/jpeg\")\n || ($_FILES['avatar']['type'] == \"image/jpg\")\n || ($_FILES['avatar']['type'] == \"image/png\"))\n && ($_FILES['avatar']['size'] < 2000000)\n && in_array($extension, $allowedExtensions)\n ) {\n\n // get the error\n if ($_FILES['avatar']['error'] > 0) {\n redirect('register.php', $_FILES['avatar']['error'], 'error');\n } else {\n // and finally move the file into the folder\n move_uploaded_file($_FILES['avatar']['tmp_name'], \"images/avatars/\" . $_FILES['avatar']['name']);\n //redirect('index.php', 'Amazing! your all signed up', 'success');\n $_SESSION['avatar'] = $_FILES['avatar']['name'];\n return true;\n }\n\n } else {\n // stop and warn the user that the file type is not suppoerted\n redirect('register.php', 'Invalid File Type! We only accept \"gif\", \"jpeg\", \"jpg\", or \"png\"', 'error');\n }\n } else {\n //move_uploaded_file($_FILES['avatar']['tmp_name'], SERVER_URI . \"images/avatars/\" . $_FILES['avatar']['name']);\n return false;\n }\n\n }",
"function getAvatar($id = ID, $type = '')\n{\n\tif($type == '')\n\t\t$type = getDBData('user_avatar_type', $id);\n\n\tif(!$type)\n\t\treturn '';\n\n\treturn getAvatarImg(\n\t\t($type == '1' ?\n\t\t\tgetDBData('user_avatar_data', $id) :\n\t\t\t'avatar.php?i=' . $id\n\t));\n}",
"public function avatar() {\n\t\tif(!empty($this->request->data['Upload']['file'])) {\n\t\t\t/* check all image parameters */\n\t\t\t\n\t\t\t$this->__checkImgParams();\n\t\t\t\t\t\t\n\t\t\t$user = $this->User->findById($this->Auth->user('id'));\n\t\t\t$uploadPath = WWW_ROOT . 'img/uploads/users/';\n\t\t\t$uploadFile = $uploadPath . $this->Auth->user('public_key') . '-' . $this->request->data['Upload']['file']['name'];\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t$directory = dir($uploadPath); \n\t\t\tif(!empty($user['User']['image'])) {\n\t\t\t\tunlink(WWW_ROOT . $user['User']['image']);\n\t\t\t}\n\t\t\t$directory->close();\n\n\t\t\t\n\t\t\tif(move_uploaded_file($this->request->data['Upload']['file']['tmp_name'], $uploadFile)) {\n\t\t\t\t\n\t\t\t\t$data['User']['image'] = '/img/uploads/users/' . $this->Auth->user('public_key') . '-' . $this->request->data['Upload']['file']['name'];\n\t\t\t\t$data['User']['api_key'] = '538bfe80756c5c00a1984a4bd57c4b45';\n\t\t\t\t\n\t\t\t\t$data['User']['id'] = $user['User']['id'];\n\t\t\t\t//$this->User->id = $data['User']['id'];\n\t\t\t\t$this->User->save($data);\n\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Your profile picture has been set!');\n\t\t\t\t$this->redirect(Controller::referer('/'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t$this->Session->setFlash('Something went wrong uploading your avatar...');\n\t\t\t\t$this->redirect(Controller::referer('/'));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->Session->setFlash('We didn\\'t catch that avatar, please try again...');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t}",
"function floated_admin_avatar($name)\n {\n }",
"public function getAvatar()\n\t{\n\t\treturn $this->instance->profile;\n\t}",
"function dokan_get_avatar( $avatar, $id_or_email, $size, $default, $alt ) {\n\n if ( is_numeric( $id_or_email ) ) {\n $user = get_user_by( 'id', $id_or_email );\n } elseif ( is_object( $id_or_email ) ) {\n if ( $id_or_email->user_id != '0' ) {\n $user = get_user_by( 'id', $id_or_email->user_id );\n } else {\n return $avatar;\n }\n } else {\n $user = get_user_by( 'email', $id_or_email );\n }\n\n if ( !$user ) {\n return $avatar;\n }\n\n // see if there is a user_avatar meta field\n $user_avatar = get_user_meta( $user->ID, 'dokan_profile_settings', true );\n $gravatar_id = isset( $user_avatar['gravatar'] ) ? $user_avatar['gravatar'] : 0;\n if ( empty( $gravatar_id ) ) {\n return $avatar;\n }\n\n $avater_url = wp_get_attachment_thumb_url( $gravatar_id );\n\n return sprintf( '<img src=\"%1$s\" alt=\"%2$s\" width=\"%3$s\" height=\"%3$s\" class=\"avatar photo\">', esc_url( $avater_url ), $alt, $size );\n}",
"public function getAvatar() {\n return (new Query())->select('profile_photo')->from('user_cv')\n ->where(['user_id' => $this->id, 'is_default' => true])\n ->limit(1)->scalar();\n }",
"function imageUser($name) {\n\tif (File::exists(base_path() . '/public/avatar/' . $name)) {\n\t\treturn Asset('avatar/'.$name);\n\t} else {\n\t\treturn Asset('images/default-avatar.png');\n\t}\n}",
"public function addAvatar( $value){\n return $this->_add(5, $value);\n }",
"public function avatarUser()\n {\n return asset(\"storage/images/$this->avatar\");\n }",
"public function getUserAvatar(){\n return($this->userAvatar);\n }",
"function getAvatarPath($pseudo){\n $path =\"./public/images/avatar/\";\n if (isset($_GET['pseudo'])){\n $infoUser = selectInfoUser($_GET['pseudo']);\n }elseif (isset($pseudo) && $pseudo != \"\") {\n $infoUser = selectInfoUser($pseudo);\n }else{\n $infoUser = selectInfoUser($_SESSION['pseudo']);\n }\n\n if (isset($infoUser['avatar'])){\n $name = $infoUser['avatar'];\n }else{\n $name = 'default.png';\n }\n $path .= $name;\n\n return $path;\n}",
"public function editAvatar(EditUserForm $request){\n if(Auth::check()){\n $valid = User::select('id')\n ->where('email', $request->email)\n ->where('id', '<>' , $request->id)\n ->get();\n if(count($valid) <= 0){\n\n $user = User::find($request->id);\n $oldAvatar = $user->avatar; \n\n if ($request->avatar == $oldAvatar){\n\n $fileName = $request->avatar;\n }\n else{\n\n if ( $oldAvatar =='img/img_profile_users/default-avatar2.jpg') {\n\n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n }\n else{\n \n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n unlink($oldAvatar);\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n };\n } \n\n $sessionUser = Auth::user()->name;\n //$user = User::find($request->id);\n $user->name = $request->name;\n $user->email = $request->email;\n $user->telephone = $request->telephone;\n $user->dependence = $request->dependence;\n $user->role = $request->role;\n $user->avatar = $fileName;\n $user->save();\n $audi_users = new Audi_Users;\n $audi_users->name = $request->name;\n $audi_users->email = $request->email;\n $audi_users->telephone = $request->telephone;\n $audi_users->dependence = $request->dependence;\n $audi_users->role = $request->role;\n $audi_users->avatar = $fileName;\n $audi_users->id_user = Auth::user()->id;\n $audi_users->tipo_audi = 2;\n $audi_users->save();\n return ['success'=>'ok'];\n }else{\n return ['error'=>'Este correo ya esta asignado a otro usuario'];\n }\n }\n else{\n return ['error'=>'no se pudo completar la operacion'];\n }\n }",
"public function vl_avatar_function(){\r\n\t\t\tglobal $current_user;\r\n\t\t\t$user_id = $current_user->ID;\r\n\t\t\t?>\r\n\t\t\t<div class=\"vl_profile_avatar_container\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$size= get_option('fancy-style-size');\r\n\t\t\t\tif ( is_user_logged_in() ) {\r\n\t\t\t\t\techo 'Welcome : ' . esc_html( $current_user->display_name );\r\n\t\t\t\t\techo \"<br>\";\r\n\t\t\t\t\techo $this->vl_get_avatars( $user_id,$user_id, $size ,'avatar','avatar'); ?>\r\n\t\t\t\t\t<br class=\"small-grid\">\r\n\t\t\t\t\t<div class=\"vl_upload_container profile_avatar_upload_container hidden\">\r\n\t\t\t\t\t\t<div class=\"vl_upload_area\">Upload</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"upload-button\">\r\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-block vl_profile_upload_btn\">UPLOAD</button>\r\n\t\t\t\t\t\t<br class=\"tiny-grid\">\r\n\t\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t\t<?php\r\n\t\t\t}else{\r\n\t\t\t\techo \"Sorry! you are not logged in\";\r\n\t\t\t\techo \"<br>\";\r\n\t\t\t\t echo get_avatar($current_user->ID);\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}",
"public function setAvatar($avatar){\n\t\t$pictureName = 'default.png';\n\t\t\n\t\tif ($avatar){\n\t\t\t$pictureName = $this->saveImage($avatar);\n\t\t}\n\t\t$this->avatar = $pictureName;\n\t}",
"public function getImg_avatar()\r\n {\r\n return $this->img_avatar;\r\n }",
"public function avatar(){\n if($this->avatar){\n return asset('/avatars/patients/'.$this->avatar);\n }else{\n return \"https://www.gravatar.com/avatar/{{md5(trim($this->fname))}}?d=mm&s=150\" ;\n }\n }",
"public function getAvatar()\r\n\t{\r\n\t\t$avatar = null;\r\n\t\t$avatars = $this->getAvatars();\r\n\t\tif(count($avatars) == 0)\r\n\t\t{\r\n\t\t\t$avatar = new Avatar();\r\n\t\t\t$avatar->setProfile($this);\r\n\t\t\t$avatar->save();\r\n\t\t}\r\n\t\telse\r\n\t\t\t$avatar = $avatars[0];\r\n\t\t\r\n\t\treturn $avatar;\r\n\t}",
"public function getDefaultAvatar()\n\t{\n\t\t$event = new Event('onApplicationGetDefaultAvatar');\n\t\tFactory::getDispatcher()->triggerEvent($event);\n\n\t\treturn $event->getArgument('avatar', false);\n\t}",
"public function getAvatar()\n {\n // so that updated images happen when users change their avatar. Also fixes #9822\n if (!isset($this->data['avatar'])) {\n $ui = app(UserInfoRepository::class)->getByID($this->data['id']);\n if ($ui) {\n $this->data['avatar'] = $ui->getUserAvatar()->getPath();\n }\n }\n return $this->data['avatar'];\n }",
"public function saveUserAvatar($avatar) {\n\n $img = file_get_contents($avatar);\n $ava = $this->generateUniqueAvatarName();\n $file = Yii::app()->baseUrl.'images/members/avatars/'.$ava;\n file_put_contents($file, $img);\n\n return $ava;\n }",
"public function get_avatar($avatar, $id_or_email, $size = '96', $default = '', $alt = false ) { \n\t\tglobal $phpbbForum;\n\n\t\tif (!$this->is_working() || !$this->get_setting('integrateLogin') || !$this->get_setting('avatarsync')) { \n\t\t\treturn $avatar;\n\t\t}\n\n\t\t$safe_alt = (false === $alt) ? esc_attr(__('Avatar image', 'wp-united')) : esc_attr($alt);\n\n\t\t$user = false;\n\n\t\tif ( !is_numeric($size) )\n\t\t\t$size = '96';\n\n\t\t// Figure out if this is an ID or e-mail --sourced from WP's pluggable.php\n\t\tif ( is_numeric($id_or_email) ) {\n\t\t\t$id = (int) $id_or_email;\n\t\t\t$user = get_userdata($id);\n\t\t} elseif (is_object($id_or_email)) {\n\t\t\tif (!empty($id_or_email->user_id)) {\n\t\t\t\t$id = (int)$id_or_email->user_id;\n\t\t\t\t$user = get_userdata($id);\n\t\t\t}\n\t\t} else {\n\t\t\t$email = $id_or_email;\n\t\t\t$user = get_user_by('email', $id_or_email);\n\t\t\tif(is_object($user)) {\n\t\t\t\t$id = $user->user_id;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif(!$user) {\n\t\t\treturn $avatar;\n\t\t}\n\n\t\t$wpuIntID = wpu_get_integrated_phpbbuser($user->ID);\n\t\t\n\t\tif(!$wpuIntID) { \n\t\t\t// the user isn't integrated, show WP avatar\n\t\t\treturn $avatar;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$phpbbAvatar = $phpbbForum->get_avatar($wpuIntID, $size, $size, $safe_alt);\t\n\t\t\t\n\t\t\tif(!empty($phpbbAvatar) && (stristr($phpbbAvatar, 'wpuput=1') === false)) {\n\t\t\t\t$phpbbAvatar = str_replace('src=', 'class=\"avatar avatar-' . $size . ' photo\" src=', $phpbbAvatar);\n\t\t\t\treturn $phpbbAvatar;\n\t\t\t}\n\t\t\t\n\t\t\treturn $avatar;\n\t\t\t\n\t\t}\n\t}",
"protected function getAvatar()\n\t{\n\t\treturn $this->avatar();\n\t}",
"public function changeAvatar($file)\n\t{\n\t\t$photoname = Helper::makeUuid() . '.png';\n\t\tImage::make($file)->resize(300,300)->save(storage_path() . '/hphotos/xpf1/' . $photoname);\n\t\t//$file->move(storage_path() . '/hphotos/xpf1/',$photoname);\n\t\t$this->instance->profile = $photoname;\n\t\t$this->instance->save();\n\t}",
"function generateAvatar($fullname)\n {\n $avatarName = urlencode(\"{$fullname}\");\n return \"https://ui-avatars.com/api/?name={$avatarName}&background=838383&color=FFFFFF&size=140&rounded=true\";\n }",
"public static function switchAvatar\n\t(\n\t\t$uniID\t\t\t// <int> The Uni-Account to create an avatar for.\n\t,\t$aviID\t\t\t// <int> The avatar to use.\n\t)\t\t\t\t\t// RETURNS <bool> TRUE on success, or FALSE if failed.\n\t\n\t// AppAvatar::switchAvatar($uniID, $aviID);\n\t{\n\t\t// Check if you have an avatar with this identification\n\t\t$has = Database::selectOne(\"SELECT avatar_id FROM avatars WHERE uni_id=? AND avatar_id=?\", array($uniID, $aviID));\n\t\tif($has !== false)\n\t\t{\n\t\t\t// Switch to the chosen avatar\n\t\t\tif(Database::query(\"UPDATE users SET avatar_opt=? WHERE uni_id=? LIMIT 1\", array($has['avatar_id'], $uniID)))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function user_user_construct_($user){\n\t\t$CI =& get_instance();\n\t\t//if($user->is_logged() && $user->get()->avatar == '') $user->update('avatar',$CI->gears->user->avatar->default);\n\t}",
"public function hasAvatar(){\n return $this->_has(5);\n }",
"public function get_avatar()\n\t{\n\t\treturn $this->user_loader->get_avatar($this->get_data('from_user_id'));\n\t}",
"private function deleteLatestAvatar()\n {\n $userId = Auth::user()->id;\n $userLatestAvatar = Avatar::where('user_id', $userId)->oldest()->first();\n if ($userLatestAvatar) {\n $imageUrl = $userLatestAvatar->image_url;\n if (!strpos($imageUrl, 'default')) {\n $locationImage = public_path('uploads/avatars/' . $imageUrl);\n unlink($locationImage);\n }\n $userLatestAvatar->delete();\n }\n }",
"function ciniki_users_avatarGet($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n // FIXME: Add ability to get another avatar for sysadmin\n 'user_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'User'), \n 'version'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Version'),\n 'maxlength'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Maximum Length'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.avatarGet', $args['user_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the users avatar image_id\n //\n $avatar_id = 0;\n if( isset($ciniki['session']['user']['avatar_id']) && $ciniki['session']['user']['avatar_id'] > 0 ) {\n $avatar_id = $ciniki['session']['user']['avatar_id'];\n }\n\n //\n // FIXME: If no avatar specified, return the default icon\n //\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'private', 'getUserImage');\n return ciniki_images_getUserImage($ciniki, $ciniki['session']['user']['id'], $avatar_id, $args['version'], $args['maxlength']);\n}",
"function get_avatar($member_avatar=\"\", $member_view_avatars=0, $avatar_dims=\"x\", $avatar_type='', $no_cache=0 )\n {\n \t//-----------------------------------------\n \t// No avatar?\n \t//-----------------------------------------\n \t\n \tif ( ! $member_avatar or $member_view_avatars == 0 or ! $this->vars['avatars_on'] or ( strpos( $member_avatar, \"noavatar\" ) AND !strpos( $member_avatar, '.' ) ) )\n \t{\n \t\treturn \"\";\n \t}\n \t\n \tif ( substr( $member_avatar, -4 ) == \".swf\" and $this->vars['allow_flash'] != 1 )\n \t{\n \t\treturn \"\";\n \t}\n \t\n \t//-----------------------------------------\n \t// Defaults...\n \t//-----------------------------------------\n \t\n \t$davatar_dims = explode( \"x\", strtolower($this->vars['avatar_dims']) );\n\t\t$default_a_dims = explode( \"x\", strtolower($this->vars['avatar_def']) );\n \t$this_dims = explode( \"x\", strtolower($avatar_dims) );\n\t\t\n\t\tif (!isset($this_dims[0])) $this_dims[0] = $davatar_dims[0];\n\t\tif (!isset($this_dims[1])) $this_dims[1] = $davatar_dims[1];\n\t\tif (!$this_dims[0]) $this_dims[0] = $davatar_dims[0];\n\t\tif (!$this_dims[1]) $this_dims[1] = $davatar_dims[1];\n\t\t\n \t//-----------------------------------------\n \t// LEGACY: Determine type\n \t//-----------------------------------------\n\t\t\n\t\tif ( ! $avatar_type )\n\t\t{\n\t\t\tif ( preg_match( \"/^http:\\/\\//\", $member_avatar ) )\n\t\t\t{\n\t\t\t\t$avatar_type = 'url';\n\t\t\t}\n\t\t\telse if ( strstr( $member_avatar, \"upload:\" ) or ( strstr( $member_avatar, 'av-' ) ) )\n\t\t\t{\n\t\t\t\t$avatar_type = 'upload';\n\t\t\t\t$member_avatar = str_replace( 'upload:', '', $member_avatar );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$avatar_type = 'local';\n\t\t\t}\n\t \t}\n\t\n\t\t//-----------------------------------------\n\t\t// No cache?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $no_cache )\n\t\t{\n\t\t\t$member_avatar .= '?_time=' . time();\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// No avatar?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $member_avatar == 'noavatar' )\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// URL avatar?\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ( $avatar_type == 'url' )\n\t\t{\n\t\t\tif ( substr( $member_avatar, -4 ) == \".swf\" )\n\t\t\t{\n\t\t\t\treturn \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" width='{$this_dims[0]}' height='{$this_dims[1]}'>\n\t\t\t\t\t\t<param name='movie' value='{$member_avatar}'><param name='play' value='true'>\n\t\t\t\t\t\t<param name='loop' value='true'><param name='quality' value='high'>\n\t\t\t\t\t\t<param name='wmode' value='transparent'> \n\t\t\t\t\t\t<embed src='{$member_avatar}' width='{$this_dims[0]}' height='{$this_dims[1]}' play='true' loop='true' quality='high' wmode='transparent'></embed>\n\t\t\t\t\t\t</object>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<img src='{$member_avatar}' border='0' width='{$this_dims[0]}' height='{$this_dims[1]}' alt='' />\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Not a URL? Is it an uploaded avatar?\n\t\t//-----------------------------------------\n\t\t\t\n\t\telse if ( ($this->vars['avup_size_max'] > 1) and ( $avatar_type == 'upload' ) )\n\t\t{\n\t\t\t$member_avatar = str_replace( 'upload:', '', $member_avatar );\n\t\t\t\n\t\t\tif ( substr( $member_avatar, -4 ) == \".swf\" )\n\t\t\t{\n\t\t\t\treturn \"<object classid=\\\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\\\" width='{$this_dims[0]}' height='{$this_dims[1]}'>\n\t\t\t\t\t\t<param name='movie' value='{$this->vars['upload_url']}/$member_avatar'><param name='play' value='true'>\n\t\t\t\t\t\t<param name='loop' value='true'><param name='quality' value='high'>\n\t\t\t\t\t\t<param name='wmode' value='transparent'> \n\t\t\t\t\t <embed src='{$this->vars['upload_url']}/$member_avatar' width='{$this_dims[0]}' height='{$this_dims[1]}' play='true' loop='true' quality='high' wmode='transparent'></embed>\n\t\t\t\t\t\t</object>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"<img src='{$this->vars['upload_url']}/$member_avatar' border='0' width='{$this_dims[0]}' height='{$this_dims[1]}' alt='' />\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// No, it's not a URL or an upload, must\n\t\t// be a normal avatar then\n\t\t//-----------------------------------------\n\t\t\n\t\telse if ($member_avatar != \"\")\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Do we have an avatar still ?\n\t\t \t//-----------------------------------------\n\t\t \t\n\t\t\treturn \"<img src='{$this->vars['AVATARS_URL']}/{$member_avatar}' border='0' alt='' />\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// No, ok - return blank\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\treturn \"\";\n\t\t}\n }",
"function target_add_avatar($avatar)\n{\n\t$avatar_file = basename($avatar['file']);\n\tif (empty($avatar['descr'])) {\n\t\t$avatar['descr'] = $avatar_file;\n\t}\n\n\tif (empty($avatar['custom'])) {\n\t\t$avatar_dir = $GLOBALS['WWW_ROOT_DISK'] .'images/avatars/';\n\t} else {\n\t\t$avatar_dir = $GLOBALS['WWW_ROOT_DISK'] .'images/custom_avatars/';\n\t}\n\n\t$ext = strtolower(substr(strrchr($avatar['file'], '.'),1));\n\tif ($ext != 'jpeg' && $ext != 'jpg' && $ext != 'png' && $ext != 'gif') {\n\t\tpf('...Skip invalid avatar ['. $avatar['descr'] .']');\n\t\treturn;\n\t}\n\n\tif ($GLOBALS['VERBOSE']) pf('...'. $avatar['descr']);\n\n\t$old_umask=umask(0);\n\tif( !copy($avatar['file'], $avatar_dir . $avatar_file) ) {\n\t\tpf('WARNING: Couldn\\'t copy avatar ['. $file .'] to ['. $avatar_dir . $avatar_file .')');\n\t\treturn;\n\t}\n\tumask($old_umask);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'avatar (img, descr) VALUES('. _esc($avatar_file) .','. _esc($avatar['descr']) .')');\n}",
"public function setOppoAvatar($value)\n {\n return $this->set(self::_OPPO_AVATAR, $value);\n }",
"public function getAvatar()\n {\n return $this->getProfilePicture();\n }",
"public function getAvatar()\n {\n return $this->user['avatar'];\n }",
"function scribbles_add_author_avatar() {\n\n\t?>\n\t<div class=\"avatar-container\">\n\n\t\t<?php echo get_avatar( get_the_author_meta( 'user_email' ), '128' ); ?>\n\n\t</div>\n\t<?php\n\n}",
"public function uploadAvatar($file) {\n\t\tif ( $file['error']!=UPLOAD_ERR_OK ) {\n\n\t\t\treturn false;\n\n\t\t} else {\n\t\t\t$avatar = $this->avatar;\n\n\t\t\tif ( !empty($avatar) && file_exists(SITE_ROOT . '/uploads/avatars/' . $avatar) ) {\n\t\t\t\tunlink(SITE_ROOT . '/uploads/avatars/' . $avatar);\n\t\t\t}\n\t\t\t$avatar = $this->getId() . '.' . pathinfo($file['name'], PATHINFO_EXTENSION);\n\n\t\t\tif ( move_uploaded_file($file['tmp_name'], 'uploads/avatars/' . $avatar) ) {\n\t\t\t\treturn $avatar;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t}",
"function caldol_bbp_get_topic_author_avatar($author_avatar, $topic_id, $size ) {\n\tglobal $bp;\n\t$author_avatar = '';\n\t$size = 30;\n\t$topic_id = bbp_get_topic_id( $topic_id );\n\tif ( !empty( $topic_id ) ) {\n\t\tif ( !bbp_is_topic_anonymous( $topic_id ) ) {\n\t\t\t$author_avatar = bp_core_fetch_avatar( 'item_id=' . bbp_get_topic_author_id( $topic_id ) ); //bbp_get_topic_author_avatar( bbp_get_topic_author_id( $topic_id ), $size );\n\t\t} else {\n\t\t\t$author_avatar = bp_core_fetch_avatar(bbp_get_topic_author_id( $topic_id ) );//bbp_get_topic_author_avatar( bbp_get_topic_author_id( $topic_id ), $size );\n\t\t\t//$author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );\n\t\t}\n\t}\n\treturn $author_avatar;\n\n}",
"public function availablePhoto(){\n\t\t$this->query->save(\"pmj_member_photo\",array(\"registration_id\"=>getSessionUser(),\"filename_ori\"=>$this->input->post('radio-avatar'),\"filename\"=>$this->input->post('radio-avatar'),\"filename_thumb\"=>$this->input->post('radio-avatar'),\"type\"=>\"main\",\"avatar\"=>\"1\",\"submit_date\"=> date(\"Y-m-d H:i:s\"),\"status\"=>\"online\"));\n\t\t\n\t\tredirect(base_url().\"profile\");\n\t}",
"public function getAvatar()\n {\n return $this->Avatar;\n }",
"public function getAvatar()\n {\n return $this->Avatar;\n }",
"function _getAvatarImg($data) {\n\t\tglobal $_JC_CONFIG, $mosConfig_live_site, $grav_link, $database, $mosConfig_absolute_path,\n\t\t\t\t$mosConfig_db;\n\t\t\n\t\t$grav_url = $mosConfig_live_site . \"/components/com_jomcomment/smilies/guest.gif\";\n\t\t\n\t\t$gWidth = ($_JC_CONFIG->get('gWidth')) ? intval($_JC_CONFIG->get('gWidth')) : \"\";\n\t\t$gHeight = ($_JC_CONFIG->get('gHeight')) ? intval($_JC_CONFIG->get('gHeight')) : \"\";\n\t\t\n\t\tswitch ($_JC_CONFIG->get('gravatar')) {\n\t\t\tcase \"gravatar\" :\n\t\t\t\t$gWidth = ($gWidth) ? $gWidth : \"40\";\n\t\t\t\t$grav_url = \"http://www.gravatar.com/avatar.php?gravatar_id=\" . md5($data->email) .\n\t\t\t\t\"&default=\" . urlencode($mosConfig_live_site . \"/components/com_jomcomment/smilies/guest.gif\") .\n\t\t\t\t\"&size=$gWidth\";\n\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"cb\" :\n\t\t\t\t$database->setQuery(\"SELECT avatar FROM #__comprofiler WHERE user_id=\" . $data->user_id . \" AND avatarapproved=1\");\n\t\t\t\t$result = $database->loadResult();\n\t\t\t\tif ($result) {\n\t\t\t\t\t// CB might store the images in either of this 2 folder\n\t\t\t\t\tif (file_exists($mosConfig_absolute_path . \"/components/com_comprofiler/images/\" . $result))\n\t\t\t\t\t\t$grav_url = $mosConfig_live_site . \"/components/com_comprofiler/images/\" . $result;\n\t\t\t\t\telse\n\t\t\t\t\t\tif (file_exists($mosConfig_absolute_path . \"/images/comprofiler/\" . $result))\n\t\t\t\t\t\t\t$grav_url = $mosConfig_live_site . \"/images/comprofiler/\" . $result;\n\t\t\t\t} \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"smf\" :\n\t\t\t\t$smfPath = $_JC_CONFIG->get('smfPath');\n\t\t\t\t$smfPath = trim($smfPath);\n\t\t\t\t$smfPath = rtrim($smfPath, '/');\n\t\t\t\tif (!$smfPath or $smfPath == \"\" or !file_exists(\"$smfPath/Settings.php\"))\n\t\t\t\t\t$smfPath = \"$mosConfig_absolute_path/forum\";\n\t\t\t\tif (!$smfPath or $smfPath == \"\" or !file_exists(\"$smfPath/Settings.php\")) {\n\t\t\t\t\t$database->setQuery(\"select id from #__components WHERE `option`='com_smf'\");\n\t\t\t\t\tif ($database->loadResult()) {\n\t\t\t\t\t\t$database->setQuery(\"select value1 from #__smf_config WHERE variable='smf_path'\");\n\t\t\t\t\t\t$smfPath = $database->loadResult();\n\t\t\t\t\t\t$smfPath = str_replace(\"\\\\\", \"/\", $smfPath);\n\t\t\t\t\t\t$smfPath = rtrim($smfPath, \"/\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (file_exists(\"$smfPath/Settings.php\")) {\n\t\t\t\t\tinclude(\"$smfPath/Settings.php\");\n\t\t\t\t\tmysql_select_db($mosConfig_db, $database->_resource);\n\t\t\t\t\t$useremail = $data->email;\n\t\t\t\t\tmysql_select_db($db_name, $database->_resource);\n\t\t\t\t\t$q = sprintf(\"SELECT avatar,ID_MEMBER FROM $db_prefix\" . \"members WHERE emailAddress='$useremail'\");\n\t\t\t\t\t$result = mysql_query($q);\n\t\t\t\t\tif ($result)\n\t\t\t\t\t{\n\t\t\t\t\t\t$result_row = mysql_fetch_array($result);\n\t\t\t\t\t\tmysql_select_db($mosConfig_db, $database->_resource);\n\t\t\t\t\t\tif ($result_row) {\n\t\t\t\t\t\t\t$id_member = $result_row[1];\n\t\t\t\t\t\t\tif (trim($result_row[0]) != \"\") {\n\t\t\t\t\t\t\t\tif (substr($result_row[0], 0, 7) != \"http://\")\n\t\t\t\t\t\t\t\t\t$grav_url = $boardurl . \"/avatars/$result_row[0]\";\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$grav_url = $result_row[0];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmysql_select_db($db_name);\n\t\t\t\t\t\t\t\t$q = sprintf(\"SELECT ID_ATTACH FROM $db_prefix\" . \"attachments WHERE ID_MEMBER='$id_member' and ID_MSG=0 and attachmentType=0\");\n\t\t\t\t\t\t\t\t$result = mysql_query($q);\n\t\t\t\t\t\t\t\tif ($result)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$result_avatar = mysql_fetch_array($result);\n\t\t\t\t\t\t\t\t\tmysql_select_db($mosConfig_db, $database->_resource);\n\t\t\t\t\t\t\t\t\tif ($result_avatar[0])\n\t\t\t\t\t\t\t\t\t\t$grav_url = \"$boardurl/index.php?action=dlattach;attach=\" . $result_avatar[0] . \";type=avatar\";\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\t\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $grav_url;\n\t}",
"function addavatar ( $avatar_defaults ) {\n\t\t//js is used to create a live preview\n\t\t$options = get_option( 'robohash_options', array( 'bot' => 'set1', 'bg' => 'bg1' ) );\n\n\t\t$bots = '<label for=\"robohash_bot\">Body</label> <select id=\"robohash_bot\" name=\"robohash_bot\">';\n\t\t$bots .= '<option value=\"set1\" '.selected( $options['bot'], 'set1', false ).'>Robots</option>';\n\t\t$bots .= '<option value=\"set2\"'.selected( $options['bot'], 'set2', false ).'>Monsters</option>';\n\t\t$bots .= '<option value=\"set3\"'.selected( $options['bot'], 'set3', false ).'>Robot Heads</option>';\n\t\t$bots .= '<option value=\"any\"'.selected( $options['bot'], 'any', false ).'>Any</option>';\n\t\t$bots .= '</select> ';\n\n\t\t$bgs = '<label for=\"robohash_bg\">Background</label> <select id=\"robohash_bg\" name=\"robohash_bg\">';\n\t\t$bgs .= '<option value=\"\" '.selected( $options['bg'], '', false ).'>None</option>';\n\t\t$bgs .= '<option value=\"bg1\" '.selected( $options['bg'], 'bg1', false ).'>Scene</option>';\n\t\t$bgs .= '<option value=\"bg2\" '.selected( $options['bg'], 'bg2', false ).'>Abstract</option>';\n\t\t$bgs .= '<option value=\"any\" '.selected( $options['bg'], 'any', false ).'>Any</option>';\n\t\t$bgs .= '</select>';\n\t\t$hidden = '<input type=\"hidden\" id=\"spinner\" value=\"'. admin_url('images/wpspin_light.gif') .'\" />';\n\n\t\t//current avatar, based on saved options\n\t\t$avatar_url = \"{$this->url}?set={$options['bot']}&bgset={$options['bg']}\";\n\n\t\t$avatar_defaults[ $avatar_url ] = \t$bots.$bgs.$hidden;\n\n\t\treturn $avatar_defaults;\n\t}",
"function getAvatarImg($img)\n{\n\t$ret = $img ? makeImg($img, ARC_AVATAR_PATH) : '';\n\n\treturn $ret;\n}",
"public function ThisUserAvatar( $size ){\r\n\t\tif( is_user_logged_in() ){\r\n\t\t\treturn get_avatar(get_current_user_id(), $size);\r\n\t\t}\r\n\t}",
"function fetch_user_info($id){\n\t\t$id = (int)$id;\n\t\t\n\t\t$sql = \"SELECT * FROM users WHERE id = {$id}\";\n\t\t$result = mysql_query($sql);\n\t\t\n\t\t$info = mysql_fetch_assoc($result);\n\t\t$info['avatar'] = (file_exists(\"{$GLOBALS['path']}/user_avatars/{$info['id']}.jpg\")) ? \"core/user_avatars/{$info['id']}.jpg\" : \"core/user_avatars/default.jpg\";\n\t\t\n\t\treturn $info;\n\t}",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function setAvatar($value)\n {\n return $this->set(self::_AVATAR, $value);\n }",
"public function getAvatar()\n {\n return $this->profile->getAvatar();\n }",
"public function getAvatarImage() : string\n {\n $imagePlaceholder = asset('storage/images/profiles') . '/' . Auth::user()->avatar;\n\n if(empty(Auth::user()->avatar)) {\n $imagePlaceholder = asset('img/user-image-placeholder.png');\n }\n\n return $imagePlaceholder;\n }",
"public function outputAvatarImage()\n\t{\n\t\techo $this->app->html->img($this->avatar_url, $this->avatar_width, $this->avatar_height, $this->username);\n\t}",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public static function getUserLoginAvatar() {\n return Yii::$app->session->get(UserHelper::SESSION_AVATAR);\n }",
"public function hasAvatar(){\n return $this->_has(6);\n }",
"public function avatar($id){\n \n Auth::userAuth();\n $data['title1'] = 'Edit Avatar';\n if($_SERVER['REQUEST_METHOD']=='POST' && $_POST['addAvatar']){\n\n echo $pro_img = $_FILES['image']['name'];\n $pro_tmp = $_FILES['image']['tmp_name'];\n $pro_type = $_FILES['image']['type'];\n if(!empty($pro_img)){\n $uploaddir = dirname(ROOT).'\\public\\uploads\\\\' ;\n $pro_img = explode('.',$pro_img);\n $pro_img_ext = $pro_img[1];\n $pro_img = $pro_img[0].time().'.'.$pro_img[1];\n\n if($pro_img_ext != \"jpg\" && $pro_img_ext != \"png\" && $pro_img_ext != \"jpeg\"\n && $pro_img_ext != \"gif\" ) {\n $data['errImg']= \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n }\n }else {\n $data['errImg'] = 'You must choose an image';\n }\n \n\n if(empty($data['errImg'])){\n move_uploaded_file($pro_tmp, $uploaddir.$pro_img);\n unlink($uploaddir.Session::name('user_img'));\n $this->userModel->avatar($id,$pro_img);\n Session::set('user_img',$pro_img );\n Session::set('success', 'Your avatar has been uploaded successfully');\n Redirect::to('users/profile');\n }else {\n $this->view('users.avatar', $data);\n }\n }else {\n $this->view('users.avatar',$data);\n }\n }",
"protected function saveUserProfile(){\n\t\t$req = $this->postedData;\n\t\t$avatar = $req['avatar'];\n\t\t// Si un fichier est chargé, alors l'utilisateur veut certainement celui-ci comme avatar...\n\t\tif (isset($_FILES['field_string_avatarFile']) and !empty($_FILES['field_string_avatarFile']['name'])) $avatar = 'user';\n\n\t\tswitch ($avatar){\n\t\t\tcase 'default': $this->user->setAvatar('default'); break;\n\t\t\tcase 'gravatar': $this->user->setAvatar('gravatar'); break;\n\t\t\tcase 'user':\n\t\t\t\t$userAvatarFile = Sanitize::sanitizeFilename($this->user->getName()).'.png';\n\t\t\t\tif ((!isset($_FILES['field_string_avatarFile']) or empty($_FILES['field_string_avatarFile']['name'])) and !file_exists(\\Settings::AVATAR_PATH.$userAvatarFile)){\n\t\t\t\t\t// Si l'utilisateur n'a pas d'image déjà chargée et qu'il n'en a pas indiqué dans le champ adéquat, on retourne false\n\t\t\t\t\tnew Alert('error', 'Impossible de sauvegarder l\\'avatar, aucune image n\\'a été chargée !');\n\t\t\t\t\treturn false;\n\t\t\t\t}elseif(isset($_FILES['field_string_avatarFile']) and !empty($_FILES['field_string_avatarFile']['name'])){\n\t\t\t\t\t// Chargement de l'image\n\t\t\t\t\t$args = array();\n\t\t\t\t\t$args['resize'] = array('width' => 80, 'height' => 80);\n\t\t\t\t\t// Les avatars auront le nom des utilisateurs, et seront automatiquement transformés en .png par SimpleImages\n\t\t\t\t\t$args['name'] = $this->user->getName().'.png';\n\t\t\t\t\t$avatarFile = Upload::file($_FILES['field_string_avatarFile'], \\Settings::AVATAR_PATH, \\Settings::AVATAR_MAX_SIZE, \\Settings::ALLOWED_IMAGES_EXT, $args);\n\t\t\t\t\tif (!$avatar) {\n\t\t\t\t\t\tnew Alert('error', 'L\\'avatar n\\'a pas été pris en compte !');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$this->user->setAvatar($avatarFile);\n\t\t\t\t}else{\n\t\t\t\t\t// Si l'utilisateur a déjà une image chargée et qu'il n'en a pas indiqué de nouvelle, on lui remet celle qu'il a déjà.\n\t\t\t\t\t$this->user->setAvatar($userAvatarFile);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ldap': $this->user->setAvatar('ldap');\n\t\t}\n\t\t// L'authentification via LDAP ramène déjà le nom l'adresse email et la gestion du mot de passe\n\t\tif (AUTH_MODE == 'sql'){\n\t\t\tif (!isset($req['name'])){\n\t\t\t\tnew Alert('error', 'Vous n\\'avez pas indiqué le nom d\\'utilisateur !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!isset($req['email'])){\n\t\t\t\tnew Alert('error', 'Vous n\\'avez pas indiqué l\\'adresse email !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$name = htmlspecialchars($req['name']);\n\t\t\tif (UsersManagement::getDBUsers($name) != null and $name != $this->user->getName()){\n\t\t\t\tnew Alert('error', 'Ce nom d\\'utilisateur est déjà pris !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$email = $req['email'];\n\t\t\tif (!\\Check::isEmail($email)){\n\t\t\t\tnew Alert('error', 'Le format de l\\'adresse email que vous avez saisi est incorrect !');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$currentPwd = (isset($req['currentPwd'])) ? $req['currentPwd'] : null;\n\t\t\t$newPwd = (isset($req['newPwd'])) ? $req['newPwd'] : null;\n\t\t\tif (!empty($newPwd)){\n\t\t\t\t// On vérifie que le mot de passe actuel a bien été saisi\n\t\t\t\tif (!ACL::canAdmin('admin', 0) and empty($currentPwd)){\n\t\t\t\t\tnew Alert('error', 'Vous avez saisi un nouveau mot de passe sans saisir le mot de passe actuel !');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// On vérifie que le mot de passe actuel est correct\n\t\t\t\tif (!ACL::canAdmin('admin', 0) and Login::saltPwd($currentPwd) != $this->user->getPwd()){\n\t\t\t\t\tnew Alert('error', 'Le mot de passe actuel que vous avez saisi est incorrect !');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// On vérifie que le nouveau mot de passe comporte bien le nombre minimum de caractères requis\n\t\t\t\tif (strlen($newPwd) < \\Settings::PWD_MIN_SIZE){\n\t\t\t\t\tnew Alert('error', 'Le mot de passe doit comporter au moins '.\\Settings::PWD_MIN_SIZE.' caractères !');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$this->user->setPwd($newPwd);\n\t\t\t}\n\t\t}\n\n\t\tif (UsersManagement::updateDBUser($this->user)){\n\t\t\t$msg = ($this->user->getId() == $GLOBALS['cUser']->getId()) ? '' : 'de '.$this->user->getName().' ';\n\t\t new Alert('success', 'Les paramètres du profil '.$msg.'ont été correctement sauvegardés !');\n\t\t\treturn true;\n\t\t}else{\n\t\t\tnew Alert('error', 'Echec de la sauvegarde des paramètres !');\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getOppoAvatar()\n {\n return $this->get(self::_OPPO_AVATAR);\n }",
"public function getAvatar(): Avatar {\n return $this->avatar;\n }",
"public function getAvatar() {\n\t\treturn $this->avatar;\n\t}",
"protected function defaultProfilePhotoUrl()\n {\n return 'https://ui-avatars.com/api/?name='.urlencode($this->name).'&color=252f3f&background=EBF4FF';\n }",
"public function getAvatar()\n {\n return $this->avatar;\n }",
"public function getAvatarList(){\n return $this->_get(5);\n }",
"public function getSetAvatarReply()\n {\n return $this->get(self::_SET_AVATAR_REPLY);\n }",
"public function soumettre(Request $request)\n {\n $avatarPath = $request->session()->get('avatarPath');\n\n $dossier = 'storage/imagesSubmits/';\n $user=Auth::User()->id;\n $avatars=Avatar::all();\n foreach($avatars as $avatar){\n $userId = $avatar->user_id;\n $imageValide = $avatar->imageValider;\n if ($userId==$user and $imageValide == false){\n $avatar->delete();\n }\n /*if($avatar==$user){\n echo ('trouve doublon de '.$username);\n }*/\n }\n $avatarName=$_POST['publierNom'];\n $avatar = new Avatar();\n $avatar->user_id = $user;\n $avatar->imageUrl = $avatarName;\n $avatar->save();\n //recupere l'extension du nom de l'image\n $avatarHeader = 'image/'.substr(strrchr($avatarName, '.'),1);\n //sauvegarde de l'image cropped apres encodage(balise canvas)/decodage Base64\n \\header($avatarHeader);\n $avatarBase64=$_POST['publierHref'];\n //on retire le MINE-type et le mot clé present pour ne recuperer que la data de l'encodage\n $avatarBase64= substr(strrchr($avatarBase64,','),1);\n $avatarData=base64_decode($avatarBase64);\n $avatarImage=imagecreatefromstring($avatarData);\n imagejpeg($avatarImage,$dossier.$avatarName);\n\n return view ('profile.profile',compact('avatarPath'));\n }",
"static function showAvatar($userId=-1,$linkTo='finfo'){\r\n\t\t\t\r\n\t\t$avatarUserId = $userId;\r\n\t\tif( $avatarUserId == -1) {\r\n\t\t\t$user = FUser::getInstance();\r\n\t\t\t$avatarUserId = $user->userVO->userId;\r\n\t\t}\r\n\t\t$cacheId = $avatarUserId;\r\n\t\t$cacheGrp = 'avatar';\r\n\t\t\r\n\t\t$cache = FCache::getInstance('l');\r\n\t\t$ret = $cache->getData($cacheId,$cacheGrp);\r\n\t\tif(false !== $ret) return $ret;\r\n\r\n\t\t//set cache\r\n\t\tif(!isset($user)) $user = FUser::getInstance();\r\n\r\n\t\tif($userId == -1 ) $avatarUserName = $user->userVO->name;\r\n\t\telseif($userId > 0) $avatarUserName = FUser::getgidname($avatarUserId);\r\n\t\telse $avatarUserName = '';\r\n\t\t\r\n\t\t$ret = '<img src=\"'.FAvatar::getAvatarUrl(($userId==-1)?(-1):($avatarUserId)).'\" alt=\"'.$avatarUserName.'\" class=\"userAvatar\" />';\r\n\t\tif($userId > 0) {\r\n\t\t\t$ret = '<a href=\"'.FSystem::getUri('who='.$userId.'#tabs-profil',$linkTo).'\">'.$ret.'</a>';\r\n\t\t}\r\n\t\t$cache->setData($ret, $cacheId, $cacheGrp);\r\n\t\treturn $ret;\r\n\t}",
"public function updateAvatar(Request $request){\n \tif($request->hasFile('avatar')){\n \t\t$avatar = $request->file('avatar');\n \t\t$filename = preg_replace('/\\s+/', '', Auth::user()->name) . time() . '.' . $avatar->getClientOriginalExtension();\n\n \t\t// Delete current image before uploading new image\n if (Auth::user()->avatar !== 'default.jpg') {\n $file = public_path('/uploads/avatars/' . Auth::user()->avatar);\n if (File::exists($file)) {\n unlink($file);\n }\n }\n\n \t\tImage::make($avatar)->resize(300, 300)->save( public_path('/uploads/avatars/' . $filename ) );\n\n \t\t$user = Auth::user();\n \t\t$user->avatar = $filename;\n \t\t$user->save();\n \t}\n\n \t//return view('user.profile', array('user' => Auth::user()) );\n return back();\n\n }",
"public function diviroids_user_avatar($atts)\n {\n extract(shortcode_atts(array( 'size' => 64, 'class' => null, 'extra_attr' => ''), $atts));\n $userId = DiviRoids_Security::get_current_user('ID');\n $avatar = (0 !== $userId) ? get_avatar($userId, $size, '', '', array('class' => $class, 'extra_attr' => $extra_attr)) : '';\n\n return $avatar;\n }",
"public function getProfilePicture();",
"public function getAvatarAttribute($value)\n {\n return $this->timeline->avatar ? $this->timeline->avatar->source : url('user/avatar/default-'.$this->gender.'-avatar.png');\n }",
"function supportDefaultAvatar()\n {\n\n // Check if a default avatar is defined\n $default = $this->getDefaultImageConfiguration();\n if (empty($default['defaultavatar'])) {\n return false;\n }\n\n // check if default avatar method is configured as one of the avatar methods.\n for($methodnr = 1; $methodnr <= PLUGIN_EVENT_GRAVATAR_METHOD_MAX; $methodnr++){\n $method = $this->get_config(\"method_\" . $methodnr);\n\n // if none is configured, ignore later methods!\n if ($method == 'none'){\n return false;\n }\n\n // return true if default avatar method is found\n if ($method == 'default'){\n return true;\n }\n }\n return false;\n }",
"public function userAvatar(Request $request)\n {\n // validate\n $this->validate($request, [\n 'photo' => ['required', 'image', Rule::dimensions()->minWidth(250)->minHeight(250)->ratio(1 / 1)],\n ]);\n\n // fill variables\n $filename = time() . str_random(16) . '.png';\n $image = Image::make($request->file('photo')->getRealPath());\n $folder = 'users/avatars';\n\n // crop it\n $image = $image->resize(250, 250);\n\n // optimize it\n $image->encode('png', 60);\n\n // upload it\n Storage::put($folder . '/' . $filename, $image);\n $imageAddress = $this->webAddress() . $folder . '/' . $filename;\n\n // delete the old avatar\n if (isset(Auth::user()->avatar)) {\n Storage::delete('users/avatars/' . str_after(Auth::user()->avatar, 'users/avatars/'));\n }\n\n // update user's avatar\n Auth::user()->update([\n 'avatar' => $imageAddress,\n ]);\n\n return $imageAddress;\n }",
"public function getAvatarUrl()\n {\n if (!is_null($this->getLastAvatar()) && Storage::disk('s3')->exists($this->getLastAvatar()->link)) {\n return Storage::disk('s3')->url($this->getLastAvatar()->link);\n }\n\n return $this->sex ? Storage::disk('s3')->url('avatars/user_woman.png') : Storage::disk('s3')->url('avatars/user_man.png');\n }",
"function UserPicture(){\r\n echo \"<img class='user_image' id='user_image' src='../RSAS.net/profile_pictures/$this->picture' onclick='my_account()' />\";\r\n }",
"function update_user_avatar() {\n\n global $DB,$CFG;\n require_once($CFG->dirroot . '/local/elggsync/classes/curl.php');\n $config = get_config('local_elggsync');\n $elggmethod = 'get.user.info';\n $moodlefunctionname = 'core_files_upload';\n $elgg_api_key = $config->elggapikey;\n $moodle_token = $config->moodleapikey;\n $serverurl = $CFG->wwwroot .'/webservice/rest/server.php' . '?wstoken=' . $moodle_token .'&wsfunction=' . $moodlefunctionname;\n $restformat = '&moodlewsrestformat=json';\n\n $curl = new local_elggsync\\easycurl;\n\n $results = $DB->get_records_sql(\"SELECT u.id,u.username,u.city, u.description FROM {user} AS u WHERE u.suspended = 0\");\n foreach($results as $result) {\n $url = $CFG->wwwroot.$config->elggpath.'/services/api/rest/json/?method='.$elggmethod.'&api_key='.$elgg_api_key;\n $fetched = $curl->post($url,array('username'=>$result->username));\n $fetched = json_decode($fetched);\n if(isset($fetched) && $fetched->status == 0) {\n if(isset($fetched->result) && $fetched->result->success == true) {\n $avatar_url = (string) $fetched->result->url;\n if(strpos($avatar_url,'/user/default/') !== false) {\n continue;\n }\n else {\n $tmp = explode('/',$avatar_url);\n $imagename = end($tmp);\n unset($tmp);\n $params = array(\n 'component' => 'user',\n 'filearea' => 'draft',\n 'itemid' => 0,\n 'filepath' => '/',\n 'filename' => $result->id.'_'.$imagename,\n 'filecontent' => base64_encode(file_get_contents($avatar_url)),\n 'contextlevel' => 'user',\n 'instanceid' => 2,\n );\n $upload_file = $curl->post($serverurl . $restformat, $params);\n $upload_file = json_decode($upload_file);\n if(isset($upload_file->itemid)) {\n $update_picture = $curl->post($CFG->wwwroot .'/webservice/rest/server.php' . '?wstoken=' . $moodle_token .'&wsfunction=core_user_update_picture' . $restformat, array('draftitemid'=>$upload_file->itemid,'userid'=>$result->id));\n }\n }\n }\n } \n }\n return true;\n}",
"function upload_avatar() {\n\t\t$config['upload_path'] = './'.URL_AVATAR;\n\t\t$config['allowed_types'] = 'gif|jpg|png';\n\t\t$config['max_size']\t\t = 1500;\n\t\t$config['encrypt_name'] = TRUE;\n\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('upload', $config);\n\t\t$CI->upload->do_upload();\n\t\t$image_data = $CI->upload->data();\n\n\t\t$config = array(\n\t\t\t'image_library' => 'gd2',\n\t\t\t'source_image' => $image_data['full_path'], \n\t\t\t'new_image' \t => APPPATH.'../'.URL_AVATAR,\n\t\t\t'maintain_ratio' => TRUE, \n\t\t\t'width' \t\t => 150,\n\t\t\t'height' \t\t => 150\n\t\t);\n\n\t\t$CI->load->library('image_lib', $config);\n\t\t$CI->image_lib->resize();\n\n\t\treturn $image_data['file_name'];\n\t}"
] | [
"0.70023024",
"0.688273",
"0.6747269",
"0.6639116",
"0.6501792",
"0.64527416",
"0.63555056",
"0.6314505",
"0.6301981",
"0.62796444",
"0.6186766",
"0.6168689",
"0.6125713",
"0.6122509",
"0.61195284",
"0.61110526",
"0.610642",
"0.6095513",
"0.60889924",
"0.60870713",
"0.608177",
"0.6077544",
"0.6075071",
"0.60677266",
"0.60583645",
"0.6057739",
"0.60481316",
"0.60335433",
"0.60240895",
"0.6019282",
"0.6008527",
"0.595382",
"0.5949707",
"0.5947539",
"0.5946073",
"0.59430283",
"0.58972156",
"0.5896237",
"0.58867496",
"0.58717686",
"0.58646613",
"0.5851626",
"0.58465594",
"0.5841041",
"0.5820208",
"0.58129644",
"0.58060867",
"0.580237",
"0.5799375",
"0.5799368",
"0.57914776",
"0.57874346",
"0.5780555",
"0.5778056",
"0.5762366",
"0.5744621",
"0.57414836",
"0.57230616",
"0.57230616",
"0.5722605",
"0.57093334",
"0.5676497",
"0.56749594",
"0.5669077",
"0.56536305",
"0.56536305",
"0.56536305",
"0.56536305",
"0.56536305",
"0.56507444",
"0.5644175",
"0.56201303",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56088877",
"0.56078786",
"0.5605596",
"0.56049895",
"0.56047946",
"0.5599017",
"0.5585323",
"0.5581588",
"0.5579966",
"0.5579463",
"0.55791044",
"0.5576888",
"0.5571125",
"0.5554173",
"0.55511445",
"0.5549996",
"0.5546569",
"0.55444396",
"0.55414253",
"0.5539731",
"0.55394334",
"0.5538197",
"0.5535401",
"0.55279535"
] | 0.0 | -1 |
Interested page allows users to sign up to be contacted | public function interested() {
if ($this->user->is_logged_in()) {
$this->session->set_flashdata('login', 'already_logged_in');
redirect('account/');
}
$this->load->helper('form');
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
if ($this->form_validation->run() === FALSE) {
$this->load->view('account/login');
}
else {
$this->user->save_interested();
$this->load->view('account/thank_you');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _signUpPageRequested()\n {\n $this->utility->redirect('signup');\n }",
"public function onSignUp()\n {\n $data = post();\n $data['requires_confirmation'] = $this->requiresConfirmation;\n\n if (app(SignUpHandler::class)->handle($data, (bool)post('as_guest'))) {\n if ($this->requiresConfirmation) {\n return ['.mall-signup-form' => $this->renderPartial($this->alias . '::confirm.htm')];\n }\n\n return $this->redirect();\n }\n }",
"public function signup(){\n \n $this->data[\"title_tag\"]=\"Lobster | Accounts | Signup\";\n \n $this->view(\"accounts/signup\",$this->data);\n }",
"public function signupForm()\n {\n \t# code...\n \treturn view(\"external-pages.sign-up\");\n }",
"public function signupAction()\n {\n $this->tag->setTitle(__('Sign up'));\n $this->siteDesc = __('Sign up');\n\n if ($this->request->isPost() == true) {\n $user = new Users();\n $signup = $user->signup();\n\n if ($signup instanceof Users) {\n $this->flash->notice(\n '<strong>' . __('Success') . '!</strong> ' .\n __(\"Check Email to activate your account.\")\n );\n } else {\n $this->view->setVar('errors', new Arr($user->getMessages()));\n $this->flash->warning('<strong>' . __('Warning') . '!</strong> ' . __(\"Please correct the errors.\"));\n }\n }\n }",
"public function sign_up()\n {\n\n }",
"public function signup() {\n $this->template->content = View::instance(\"v_users_signup\");\n \n # Render the view\n echo $this->template;\n }",
"public function p_signup() {\n\n $q= 'Select email \n From users \n WHERE email=\"'.$_POST['email'].'\"';\n # see if the email exists\n $emailexists= DB::instance(DB_NAME)->select_field($q);\n \n # email exists, throw an error\n if($emailexists){ \n \n Router::redirect(\"/users/signup/error\"); \n \n }\n \n #requires all fields to be entered if java script is disabled, otherwise thow a different error\n \n elseif (!$_POST['email'] OR !$_POST['last_name'] OR !$_POST['first_name'] OR !$_POST['password']) {\n Router::redirect(\"/users/signup/error2\"); \n }\n # all is well , proceed with signup\n else{\n \n $_POST['created']= Time::now();\n $_POST['password']= sha1(PASSWORD_SALT.$_POST['password']); \n $_POST['token']= sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n # add user to the database and redirect to users login page \n $user_id=DB::instance(DB_NAME)->insert_row('users',$_POST);\n # Create users first Notebook\n $notebook['name']= $_POST['first_name'].' Notebook';\n $notebook['user_id']= $user_id;\n $notebook['created']= Time::now(); \n $notebook['modified']= Time::now(); \n DB::instance(DB_NAME)->insert_row('notebooks',$notebook); \n\n Router::redirect('/users/login');\n }\n \n }",
"public function showSignUpForm() {\n if(!config('springintoaction.signup.allow')) {\n return view('springintoaction::frontend.signup_closed');\n }\n\n return view('springintoaction::frontend.signup');\n }",
"public function please_sign_up() {\n\t\t$this->infoAlert(\"You're not signed in, or not signed up, either way - head this way! <a href='\"\n\t\t\t.site_url('/wp-login.php?action=register&redirect_to='.get_permalink()).\n\t\t\t\"'>Login/Register</a>\");\n\t}",
"public function signup() {\n // set third param to 1 so header/footer isn't displayed again\n $this->view->render('index/signup', null, 1);\n }",
"public function signup() {\n $this->template->content = View::instance('v_users_signup');\n $this->template->title = \"Sign Up\";\n\n // Render the view\n echo $this->template;\n\n }",
"public function sign_up()\n\t{\n\t\t$this->view('/');\n\t}",
"public function RegistrationUnderApproval() {\n $this->Render();\n }",
"public function handleSignUp()\n {\n $data = \\Request::all();\n $result = \\DB::transaction(function() use($data) {\n $data['type'] = Member::USER_TYPE_ID;\n // honeypot checking for valid submission\n $this->companyService->honeypotCheck($data);\n // get the plan\n $plan = Plan::findOrFail($data['plan_id']);\n // create the company\n list($company, $role) = $this->companyService->create($data);\n // create the user\n $data['company_id'] = $company->id;\n $data['roles'] = [$role->id];\n $data['is_owner'] = true;\n $user = $this->userService->create($data);\n // send confirmation email\n $mail_data = [\n 'plan' => $plan->name,\n 'price_month' => \\Format::currency($plan->price_month),\n 'price_year' => \\Format::currency($plan->price_year),\n 'trial_end_date' => \\Carbon::now()->addDays(14)->toFormattedDateString()\n ];\n \\Mail::to($company->email)->send(new SignUpConfirmation($mail_data));\n // find the user and log them in\n $auth_user = \\Auth::findById($user->id);\n \\Auth::login($auth_user, true);\n // set message and redirect\n \\Msg::success('Thank you for signing up with Tellerr!');\n return [\n 'route' => 'account'\n ];\n });\n return redir($result['route']);\n }",
"public function authorSignUp(Request $request)\n {\n return view('web.author.signUp');\n }",
"function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show the home page instead (unless we just completed registering an account) */\n if ($this->Model_Account->amILoggedIn()) {\n if (!array_key_exists( 'registerMsg', $_SESSION )) {\n redirect( \"mainpage/index\", \"refresh\" );\n }\n }\n\n/* ... define values for template variables to display on page */\n $data['title'] = \"Account Registration - \".$this->config->item( 'siteName' );\n\n/* ... set the name of the page to be displayed */\n $data['main'] = \"register\";\n\n/* ... complete our flow as we would for a normal page */\n $this->index( $data );\n\n/* ... time to go */\n return;\n }",
"public function index()\n {\n $this->data['pagebody'] = 'sign_up';\n\t$this->render();\n echo \"this is the most pointless thing I have ever done\";\n \n }",
"public function completeSignup()\n\t{\n\t\t$data = array(\n 'email'=>$_GET['email'],\n 'phone'=>$_GET['phone_number'],\n 'cityName'=>$_GET['city']\n );\n\t\t//print_r($data);\n\t\t$cities = Location::where(['Type' => 'City', 'visible' =>1,'name' =>$data['cityName']])->pluck('id');\n\t\t\n\t\t$data['city'] = $cities;\n\t\t$count = count($cities);\n\t\tif($count=='0')\n\t\t{\n\t\t\tdie(\"City name doesn't exist.\");\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn view('frontend.pages.completesignup',$data);\n\t\t}\n\t}",
"public function p_signup(){\n\t\tforeach($_POST as $field => $value){\n\t\t\tif(empty($value)){\n\t\t\t\tRouter::redirect('/users/signup/empty-fields');\n\t\t\t}\n\t\t}\n\n\t\t#check for duplicate email\n\t\tif ($this->userObj->confirm_unique_email($_POST['email']) == false){\n\t\t\t#send back to signup page\n\t\t\tRouter::redirect(\"/users/signup/duplicate\");\n\t\t}\n\n\t\t#adding data to the user\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\n\t\t#encrypt password\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t#create encrypted token via email and a random string\n\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t#Insert into the db\n\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t# log in the new user\n\n\t\tsetcookie(\"token\", $_POST['token'], strtotime('+2 weeks'), '/');\n\n\t\t# redirect to home\n\t\tRouter::redirect('/users/home');\n\t\t\n\t}",
"public function signup(){\n /* echo \"Signup called.\";*/\n\t# First, set the content of the template with a view file\n\t$this->template->content = View::instance('v_users_signup');\n\n\t# Now set the <title> tag\n\t$this->template->title = \"OPA! Signup\";\n\n\t# Render the view\n\techo $this->template;\n }",
"public function registration() {\r\n \r\n if (isset($_GET[\"submitted\"])) {\r\n $this->registrationSubmit();\r\n } else {\r\n \r\n }\r\n }",
"function doSignup(){\n\t\t$data = $_POST;\n\t\t//Stop sign-up if the user does not check the chebox\n\t\tif(!isset($data['Agreement']))\n\t\t\treturn \"inlineMsg5\";\n\t\tif($this->isCCUsedForTrial(\"{$data['CreditCardNumber']}\") && ($data['SubscriptionType'] == 1))\n\t\t\treturn \"inlineMsg1\";\n\t\t$currentYear = date('Y');\n\t\t$currentMonth = date('n');\n\t\t//Stop sign-up when the credit card is expired\n\t\tif($data['ExpirationYear'] < $currentYear){\n\t\t\treturn \"inlineMsg4\";\n\t\t}\n\t\tif ($data['ExpirationYear'] == $currentYear){\n\t\t\tif($data['ExpirationMonth'] < $currentMonth)\n\t\t\t\treturn \"inlineMsg4\";\n\t\t}\n\t\t//Get InfusionSoft Api\n\t\t$app = $this->getInfusionSoftApi();\n\t\t//Get current date\n\t\t$curdate = $app->infuDate(date('j-n-Y'));\n\t\t//Get the registration form from session\n\t\t$regFormData = Session::get('RegistrationFormData');\n\t\t// Get country text from code\n\t\t$country = Geoip::countryCode2name($data['Country']);\n\t\t// Get InfusionSoft Contact ID\n\t\t$returnFields = array('Id','Leadsource');\n\t\t$conInfo = $app->findByEmail($regFormData['Email'], $returnFields);\n\t\tif(empty($conInfo)){\n\t\t\t// If IS contact doesn't exist create one\n\t\t\t$conDat = array(\n\t\t\t\t\t'FirstName' => $data['FirstName'],\n\t\t\t\t\t'LastName' => $data['LastName'],\n\t\t\t\t\t'Company' => $data['Company'],\n\t\t\t\t\t'StreetAddress1' => $data['StreetAddress1'],\n\t\t\t\t\t'StreetAddress2' => $data['StreetAddress2'],\n\t\t\t\t\t'City' => $data['City'],\n\t\t\t\t\t'State' => $data['State'],\n\t\t\t\t\t'PostalCode' => $data['PostalCode'],\n\t\t\t\t\t'Country' => $country,\n\t\t\t\t\t'Email' => $regFormData['Email']\n\t\t\t);\n\t\t\tif(empty($conInfo))\n\t\t\t\t$conDat['Leadsource'] = 'AttentionWizard';\n\t\t\t$isConID = $app->addCon($conDat);\n\t\t}else{\n\t\t\t$isConID = $conInfo[0]['Id'];\n\t\t}\n\t\t// Locate existing credit card\n\t\t$ccID = $app->locateCard($isConID,substr($data['CreditCardNumber'],-4,4));\n\t\t$creditCardType = $this->getISCreditCardType($data['CreditCardType']);\n\t\tif(!$ccID){\n\t\t\t//Validate the credit card\n\t\t\t$card = array(\n\t\t\t\t'CardType' => $creditCardType,\n\t\t\t\t'ContactId' => $isConID,\n\t\t\t\t'CardNumber' => $data['CreditCardNumber'],\n\t\t\t\t'ExpirationMonth' => sprintf(\"%02s\", $data['ExpirationMonth']),\n\t\t\t\t'ExpirationYear' => $data['ExpirationYear'],\n\t\t\t\t'CVV2' => $data['CVVCode']\n\t\t\t);\n\t\t\t$result = $app->validateCard($card);\n\t\t\tif($result['Valid'] == 'false')\n\t\t\t\treturn \"inlineMsg3\";\n\t\t\t$ccData = array(\n\t\t\t\t\t'ContactId' => $isConID,\n\t\t\t\t\t'FirstName' => $data['FirstName'],\n\t\t\t\t\t'LastName' => $data['LastName'],\n\t\t\t\t\t'BillAddress1' => $data['StreetAddress1'],\n\t\t\t\t\t'BillAddress2' => $data['StreetAddress2'],\n\t\t\t\t\t'BillCity' => $data['City'],\n\t\t\t\t\t'BillState' => $data['State'],\n\t\t\t\t\t'BillZip' => $data['PostalCode'],\n\t\t\t\t\t'BillCountry' => $country,\n\t\t\t\t\t'CardType' => $creditCardType,\n\t\t\t\t\t'NameOnCard' => $data['NameOnCard'],\n\t\t\t\t\t'CardNumber' => $data['CreditCardNumber'],\n\t\t\t\t\t'CVV2' => $data['CVVCode'],\n\t\t\t\t\t'ExpirationMonth' => sprintf(\"%02s\", $data['ExpirationMonth']),\n\t\t\t\t\t'ExpirationYear' => $data['ExpirationYear']\n\t\t\t);\n\t\t\t$ccID = $app->dsAdd(\"CreditCard\", $ccData);\n\t\t}\n\t\t// Create AttentionWizard member\n\t\t$member = new Member();\n\t\t$member->FirstName = $data['FirstName'];\n\t\t$member->Surname = $data['LastName'];\n\t\t$member->Email = $regFormData['Email'];\n\t\t$member->Password = $regFormData['Password']['_Password'];\n\t\t$member->ISContactID = $isConID;\n\t\t$memberID = $member->write();\n\t\t//Find or create the 'user' group and add the member to the group\n\t\tif(!$userGroup = DataObject::get_one('Group', \"Code = 'customers'\")){\n\t\t\t$userGroup = new Group();\n\t\t\t$userGroup->Code = \"customers\";\n\t\t\t$userGroup->Title = \"Customers\";\n\t\t\t$userGroup->Write();\n\t\t\t$userGroup->Members()->add($member);\n\t\t}else{\n\t\t\t$userGroup->Members()->add($member);\n\t\t}\n\t\t//Get product details\n\t\t$product = Product::get()->byID($data['SubscriptionType']);\n\t\t$credits = $product->Credits;\n\t\tif($data['SubscriptionType'] == 1){\n\t\t\t$orderAmount = $product->TrialPrice;\n\t\t\t$productName = \"30 days 1-dollar Trial\";\n\t\t\t$isProductID = 38;\n\t\t}else{\n\t\t\t$productName = $product->Name;\n\t\t\t$orderAmount = $product->RecurringPrice;\n\t\t\t$isProductID = $product->ISInitialProductID;\n\t\t}\n\t\t// Store credit card info\n\t\t$creditCard = new CreditCard();\n\t\t$creditCard->CreditCardType = $data['CreditCardType'];\n\t\t$creditCard->CreditCardNumber = $data['CreditCardNumber'];\n\t\t$creditCard->NameOnCard = $data['NameOnCard'];\n\t\t$creditCard->CreditCardCVV = $data['CVVCode'];\n\t\t$creditCard->ExpiryMonth = $data['ExpirationMonth'];\n\t\t$creditCard->ExpiryYear = $data['ExpirationYear'];\n\t\t$creditCard->Company = $data['Company'];\n\t\t$creditCard->StreetAddress1 = $data['StreetAddress1'];\n\t\t$creditCard->StreetAddress2 = $data['StreetAddress2'];\n\t\t$creditCard->City = $data['City'];\n\t\t$creditCard->State = $data['State'];\n\t\t$creditCard->PostalCode = $data['PostalCode'];\n\t\t$creditCard->Country = $data['Country'];\n\t\t$creditCard->Current = 1;\n\t\t$creditCard->ISCCID = $ccID;\n\t\t$creditCard->MemberID = $memberID;\n\t\t$creditCardID = $creditCard->write();\n\t\t// Create an order\n\t\t$order = new Order();\n\t\t$order->OrderStatus = 'P';\n\t\t$order->Amount = $orderAmount;\n\t\t$order->MemberID = $memberID;\n\t\t$order->ProductID = $data['SubscriptionType'];\n\t\t$order->CreditCardID = $creditCardID;\n\t\t$orderID = $order->write();\n\t\t//Create the Infusionsoft subscription\n\t\t$subscriptionID = $this->createISSubscription($isConID, $product->ISProductID, $product->RecurringPrice, $ccID, 30);\n\t\tif($subscriptionID && is_int($subscriptionID)){\n\t\t\t//Create an infusionsoft order\n\t\t\t$config = SiteConfig::current_site_config();\n\t\t\t$invoiceId = $app->blankOrder($isConID,$productName, $curdate, 0, 0);\n\t\t\t$orderItem = $app->addOrderItem($invoiceId, $isProductID, 9, floatval($orderAmount), 1, $productName, $productName);\n\t\t\t$result = $app->chargeInvoice($invoiceId,$productName,$ccID,$config->MerchantAccount,false);\n\t\t\tif($result['Successful']){\n\t\t\t\t// Create a Subscription record\n\t\t\t\t$nextBillDate = $this->getSubscriptionNextBillDate($subscriptionID);\n\t\t\t\t$expireDate= date('Y-m-d H:i:s', strtotime($nextBillDate));\n\t\t\t\t$startDate= date('Y-m-d H:i:s', strtotime($expireDate. \"-30 days\"));\n\t\t\t\t$subscription = new Subscription();\n\t\t\t\t$subscription->StartDate = $startDate;\n\t\t\t\t$subscription->ExpireDate = $expireDate;\n\t\t\t\t$subscription->MemberID = $memberID;\n\t\t\t\t$subscription->ProductID = $data['SubscriptionType'];\n\t\t\t\t$subscription->OrderID = $orderID;\n\t\t\t\t$subscription->Status = 1;\n\t\t\t\t$subscription->SubscriptionID = $subscriptionID;\n\t\t\t\t$subscription->write();\n\t\t\t\t// Create a MemberCredits record\n\t\t\t\t$memberCredits = new MemberCredits();\n\t\t\t\t$memberCredits->Credits = $credits;\n\t\t\t\t$memberCredits->ExpireDate = $expireDate;\n\t\t\t\t$memberCredits->MemberID = $memberID;\n\t\t\t\t$memberCredits->ProductID = $data['SubscriptionType'];\n\t\t\t\t$memberCredits->SubscriptionID = $subscription->ID;\n\t\t\t\t$memberCredits->write();\n\t\t\t\t// Update order\n\t\t\t\t$order->OrderStatus = 'c';\n\t\t\t\t$order->write();\n\t\t\t\t// If product selected is bronze do a trial signup\n\t\t\t\tif($data['SubscriptionType'] == 1){\n\t\t\t\t\t//Add the InfusionSoft tag\n\t\t\t\t\t$app->grpAssign($isConID, 2216);\n\t\t\t\t\t//Update the InfusionSoft contact details\n\t\t\t\t\t$conDat = array(\n\t\t\t\t\t\t\t'ContactType' => 'AW Customer',\n\t\t\t\t\t\t\t'_AWstartdate' => $curdate,\n\t\t\t\t\t\t\t'_AttentionWizard' => 'Free'\n\t\t\t\t\t);\n\t\t\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t\t\t// Update Subscription\n\t\t\t\t\t$subscription->IsTrial = 1;\n\t\t\t\t\t$subscription->SubscriptionCount = 0;\n\t\t\t\t\t$subscription->write();\n\t\t\t\t\t// Update Member\n\t\t\t\t\t$member->SignUpTrial = 1;\n\t\t\t\t\t$member->write();\n\t\t\t\t\t// Update Order\n\t\t\t\t\t$order->IsTrial = 1;\n\t\t\t\t\t$order->write();\n\t\t\t\t\t// Update credit card\n\t\t\t\t\t$creditCard->UsedForTrial = 1;\n\t\t\t\t\t$creditCard->write();\n\t\t\t\t}else{\n\t\t\t\t\t// Update Subscription\n\t\t\t\t\t$subscription->SubscriptionCount = 1;\n\t\t\t\t\t$subscription->write();\n\t\t\t\t\t// Add the InfusionSoft tag\n\t\t\t\t\t$isTagId = $this->getISTagIdByProduct($data['SubscriptionType']);\n\t\t\t\t\t$app->grpAssign($isConID, $isTagId);\n\t\t\t\t\t//Update the InfusionSoft contact details\n\t\t\t\t\t$returnFields = array('_AWofmonths');\n\t\t\t\t\t$conDat1 = $app->loadCon($isConID,$returnFields);\n\t\t\t\t\tif(!isset($conDat1['_AWofmonths']))\n\t\t\t\t\t\t$conDat1['_AWofmonths'] = 0;\n\t\t\t\t\t$conDat = array(\n\t\t\t\t\t\t\t'_AWofmonths' => $conDat1['_AWofmonths']+1,\n\t\t\t\t\t\t\t'ContactType' => 'AW Customer',\n\t\t\t\t\t\t\t'_AttentionWizard' => 'Paid and Current',\n\t\t\t\t\t\t\t'_AWstartdate' => $curdate\n\t\t\t\t\t);\n\t\t\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t\t\t//Add a note\n\t\t\t\t\t$conActionDat = array('ContactId' => $isConID,\n\t\t\t\t\t\t\t'ActionType' => 'UPDATE',\n\t\t\t\t\t\t\t'ActionDescription' => \"Payment made for AW service\",\n\t\t\t\t\t\t\t'CreationDate' => $curdate,\n\t\t\t\t\t\t\t'ActionDate' => $curdate,\n\t\t\t\t\t\t\t'CompletionDate' => $curdate,\n\t\t\t\t\t\t\t'CreationNotes' => \"{$product->Name} Subscription\",\n\t\t\t\t\t\t\t'UserID' => 1\n\t\t\t\t\t);\n\t\t\t\t\t$app->dsAdd(\"ContactAction\", $conActionDat);\n\t\t\t\t}\n\t\t\t\t$member->logIn();\n\t\t\t\t$this->setMessage('Success', 'You have signed-up & the Subscription is created successfully');\n\t\t\t\treturn 'url1';\n\t\t\t}else{\n\t\t\t\t//Set the subscription to Inactive\n\t\t\t\t$this->setSubscriptionStatus($subscriptionID, 'Inactive');\n\t\t\t\t//Update InfusionSoft contact\n\t\t\t\tif($data['SubscriptionType'] == 1){\n\t\t\t\t\t$aw = 'Unsuccessful trial sign-up';\n\t\t\t\t}else{\n\t\t\t\t\t$aw = 'Unsuccessful paid sign-up';\n\t\t\t\t}\n\t\t\t\t$conDat = array(\n\t\t\t\t\t\t'ContactType' => 'AW Prospect',\n\t\t\t\t\t\t'_AttentionWizard' => $aw\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t\t// Add an AW prospect tag\n\t\t\t\t//$app->grpAssign($isConID, $this->getISTagIdByPaymentCode(strtoupper($result['Code'])));\n\t\t\t\t$app->grpAssign($isConID, $this->getISTagIdByPaymentCode('DECLINED'));\n\t\t\t\t// Add a note\n\t\t\t\t$conActionDat = array('ContactId' => $isConID,\n\t\t\t\t\t\t'ActionType' => 'UPDATE',\n\t\t\t\t\t\t'ActionDescription' => \"Unsuccessful attempt to sign-up for AW\",\n\t\t\t\t\t\t'CreationDate' => $curdate,\n\t\t\t\t\t\t'ActionDate' => $curdate,\n\t\t\t\t\t\t'CompletionDate' => $curdate,\n\t\t\t\t\t\t'UserID' => 1\n\t\t\t\t);\n\t\t\t\t$conActionID = $app->dsAdd(\"ContactAction\", $conActionDat);\n\t\t\t\t$member->logIn();\n\t\t\t\t$this->setMessage('Error', 'Sorry,the payment failed due to some reason.please update your credit card');\n\t\t\t\treturn \"url2\";\n\t\t\t}\n\t\t}else{\n\t\t\t$member->logIn();\n\t\t\t// Add an AW prospect tag\n\t\t\t$app->grpAssign($isConID, 3097);\n\t\t\t//Update InfusionSoft contact\n\t\t\tif($data['SubscriptionType'] == 1){\n\t\t\t\t$aw = 'Unsuccessful trial sign-up';\n\t\t\t}else{\n\t\t\t\t$aw = 'Unsuccessful paid sign-up';\n\t\t\t}\n\t\t\t$conDat = array(\n\t\t\t\t\t'ContactType' => 'AW Prospect',\n\t\t\t\t\t'_AttentionWizard' => $aw\n\t\t\t);\n\t\t\t$app->updateCon($isConID, $conDat);\n\t\t\t// Add a note\n\t\t\t$conActionDat = array('ContactId' => $isConID,\n\t\t\t\t\t'ActionType' => 'UPDATE',\n\t\t\t\t\t'ActionDescription' => \"Unsuccessful attempt to sign-up for AW\",\n\t\t\t\t\t'CreationDate' => $curdate,\n\t\t\t\t\t'ActionDate' => $curdate,\n\t\t\t\t\t'CompletionDate' => $curdate,\n\t\t\t\t\t'UserID' => 1\n\t\t\t);\n\t\t\t$conActionID = $app->dsAdd(\"ContactAction\", $conActionDat);\n\t\t\t$this->setMessage('Error', 'You have signed-up successfully but the Subscription is not created,please try again.');\n\t\t\treturn \"url3\";\n\t\t}\n\t}",
"public function accountAction()\n {\n \tif(!in_array($this->_user->{User::COLUMN_STATUS}, array(User::STATUS_BANNED, User::STATUS_PENDING, User::STATUS_GUEST))){\n \t\t$this->_forward('homepage');\n \t\treturn;\n \t}\n \t$this->view->registerForm = new User_Form_Register();\n \t$this->view->loginForm = new User_Form_Login();\n }",
"public function index() {\n return view('springintoaction::frontend.signup');\n }",
"public function signup()\n {\n if ($this->model->signup())\n $this->redirect(\"home\");\n }",
"public function post_join()\n\t{\n\t\tif(Service\\Validation\\Register::passes(Input::all()))\n\t\t{\n\t\t\tif($user = Repository\\User::register(Input::all()))\n\t\t\t{\n\t\t\t\t// Users must confirm their e-mail address once they have registered. We\n\t\t\t\t// will now send them an e-mail with their activation code.\n\t\t\t\tif(Config::get('feather.registration.confirm_email'))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t// Log the user in and redirect back to the home page.\n\t\t\t\tService\\Security::authorize($user);\n\n\t\t\t\treturn Redirect::home();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to_route('register')->with_input()->with_errors(new Messages(array(\n\t\t\t\t\t__('register.failed')->get()\n\t\t\t\t)));\n\t\t\t}\n\t\t}\n\n\t\treturn Redirect::to_route('register')->with_input()->with_errors(Service\\Validation::errors());\n\t}",
"public function sign_up()\n\t{\n\t\t$post = $this->input->post();\n\t\t$return = $this->accounts->register($post, 'settings'); /*this will redirect to settings page */\n\t\t// debug($this->session);\n\t\t// debug($return, 1);\n\t}",
"public function viewed_signup() {\n\t\tif ( $this->not_page_reload() ) {\n\t\t\t$this->js_record_event( $this->event_name['viewed_signup'] );\n\t\t}\n\t}",
"protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }",
"public function signup()\n\t{\n\t\treturn View::make('users.signup');\n\t}",
"public function signup_page(Request $request){\n if($request->cookie('_uid')){\n $acc = employees::find($request->cookie('_uid'));\n if($acc->pos_id==1){\n return view('page.auth.signup');\n }\n return redirect('/');\n }\n return redirect('/');\n }",
"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 }",
"public function regNewCommercialUser()\n {\n $this->view('Registration/commercial_user_registration');\n }",
"function do_signup_header()\n {\n }",
"public function register() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->register();\n }\n }",
"public function signup($params = null)\n\t{\n\t\t// On set la variable a afficher sur dans la vue\n\t\t$this->set('title', 'Sign up');\n\t\t// On fait le rendu de la vue signup.php\n\t\t$this->render('signup');\n\t}",
"public function signupAction()\n {\n $form = new \\RTB\\Core\\ShopFrontOffice\\Forms\\RegisterForm;\n if ($this->request->isPost()) {\n $email = $this->request->getPost('email', 'email');\n $password = $this->request->getPost('password', 'string');\n $repeatPassword = $this->request->getPost('repeatPassword', 'string');\n $response = $this->userService->createContact($email, $password, $repeatPassword);\n if($response == UserServices::SIGNUPSUCCESS){\n if ($this->request->isAjax()) {\n return $response;\n }\n $this->flash->success((string) $response);\n return $this->response->redirect('login');\n }else{\n if ($this->request->isAjax()) {\n return $response;\n }\n $this->flash->error($response);\n }\n }\n $this->view->form = $form;\n }",
"public function getSignUp(){\n\t\t//make the sign up view\n\t\treturn View::make('account.signup');\n\t}",
"public function post()\n\t{\n// \t\t$this->viewParams->signupErrors = ['New accounts are not accepted at this time.'];\n// \t\treturn $this->renderView('home');\n\t\t\n\t\t$orgTitle = $this->trimPostVar('title');\n\t\t$orgName = $this->trimPostVar('name');\n\t\t$username = $this->trimPostVar('username');\n\t\t$password = $this->postVar('password');\n\t\t$confirmPass = $this->postVar(\"confirm-password\");\n\t\t\n\t\t$errors = [];\n\t\t\n\t\tif(strlen($password) < 8){\n\t\t\t$errors[] = \"Password must be at least 8 characters long.\";\n\t\t}\n\t\tif($password !== $confirmPass){\n\t\t\t$errors[] = \"Passwords did not match.\";\n\t\t}\n\t\t\n\t\tif(Org::findByName($orgName)){\n\t\t\t$errors[] = \"Identifier is already taken. Please choose another.\";\n\t\t}\n\t\t\n\t\tif(!filter_var($username, FILTER_VALIDATE_EMAIL)){\n\t\t\t$errors[] = \"Invalid email address provided.\";\n\t\t}\n\t\t\n\t\tif(!count($errors)){\n\t\t\tif($admin = Admin::signup($username, $password)){\n\t\t\t\tif($org = Org::create($admin, $orgName, $orgTitle)){\n\t\t\t\t\tLogin::adminLogin($admin);\n\t\t\t\t\t$this->localRedirect(\"orgs/\".$org->getName());\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$errors[] = \"Organization could not be created.\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$errors[] = \"Admin email is already taken.\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->viewParams->signupOrgTitle = $orgTitle;\n\t\t$this->viewParams->signupOrgName = $orgName;\n\t\t$this->viewParams->signupUsername = $username;\n\t\t$this->viewParams->signupErrors = $errors;\n\t\t\n\t\treturn $this->renderView('Home');\n\t\t\n\t\t\n\t\t\n\t}",
"function url_signup($person): string\n{\n $base = getOption('page_signup', 'signup');\n $params = 'pkey=' . $person->web_key;\n return url_build($base, $params);\n}",
"public function signInPage() {\n $view = new View('inscription');\n $view->generate();\n }",
"public function p_signup() \n {\n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n $q = 'SELECT user_id\n FROM users \n WHERE email = \"'.$_POST['email'].'\"';\n $user_id = DB::instance(DB_NAME)->select_field($q);\n if ($user_id!=NULL)\n {\n $error=\"User account already exists.\";\n $this->template->content = View::instance('v_users_signup');\n $this->template->content->error=$error;\n echo $this->template;\n }\n else\n {\n\t\t\n //Inserting the user into the database\n\t\t\t$_POST['created']=Time::now();\n\t\t\t$_POST['modified']=Time::now();\n\t\t\t$_POST['password']=sha1(PASSWORD_SALT.$_POST['password']);\n\t\t\t$_POST['token']=sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\t\t\t$_POST['activation_key']=str_shuffle($_POST['password'].$POST['token']);\n\t\t\t$activation_link=\"http://\".$_SERVER['SERVER_NAME'].\"/users/p_activate/\".$_POST['activation_key'];\n\t\t\t$name=$_POST['first_name'];\n\t\t\t$name.=\" \";\n\t\t\t$name.=$_POST['last_name'];\n\t\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\t\t\t\n\t\t//Sending the confirmation mail\n\t\t\t$to[]=Array(\"name\"=>$name, \"email\"=>$_POST['email']);\n\t\t\t$subject=\"Confirmation letter\";\n\t\t\t$from=Array(\"name\"=>APP_NAME, \"email\"=>APP_EMAIL); \n $body = View::instance('signup_email');\n $body->name=$name;\n $body->activation_link=$activation_link;\n\n\n\t\t\t$email = Email::send($to, $from, $subject, $body, false, $cc, $bcc);\n\t\t\t\n\t\t\tRouter::redirect('/');\n } \n }",
"public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }",
"public function signup() {\n\t\t//$this->set('title_for_layout','Sign Up');\n\t\t//$this->layout = 'clean';\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data['User']['username'] = strip_tags($this->request->data['User']['username']);\n\t\t\t$this->request->data['User']['fullname'] = strip_tags($this->request->data['User']['fullname']);\n\t\t\t$this->request->data['User']['location'] = strip_tags($this->request->data['User']['location']);\n\t\t\t//$this->request->data['User']['slug'] = $this->toSlug($this->request->data['User']['username']); //Should happen automagically with the Sluggable plugin\n\t\t\t\n\t\t\t//Register the user\n\t\t\t$user = $this->User->register($this->request->data,true,false);\n\t\t\tif (!empty($user)) {\n\t\t\t\t//Generate a public key that the user can use to login later (without username and password)\n\t\t\t\t//$this->User->generateAndSavePublicKey($user);\n\t\t\t\t\n\t\t\t\t//Send the user their activation email\n\t\t\t\t$options = array(\n\t\t\t\t\t\t\t\t\t'layout'=>'signup_activate',\n\t\t\t\t\t\t\t\t\t'subject'=>__('Activate your account at Prept!', true),\n\t\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$viewVars = array('user'=>$user,'token'=>$user['User']['email_token']);\n\t\t\t\t$this->_sendEmail($user['User']['email'],$options,$viewVars);\n\t\t\t\t$this->User->id = $user['User']['id'];\n\t\t\t\t$this->request->data['User']['id'] = $this->User->id; \n\t\t\t\t$this->Auth->autoRedirect = false;\n\t\t\t\tif($this->Auth->login($this->request->data['User'])){\n\t\t\t\t\t//The login was a success\n\t\t\t\t\tunset($this->request->data['User']);\n\t\t\t\t\t$this->Session->setFlash(__('You have successfully created an account — now get to studying.', true));\n\t\t\t\t\t$this->Auth->loginRedirect = array('admin'=>false,'controller'=>'users','action'=>'backpack');\n\t\t\t\t\treturn $this->redirect($this->Auth->loginRedirect);\n\t\t\t\t}else{\n\t\t\t\t\t$this->Session->setFlash(__(\"There was an error logging you in.\", true));\n\t\t\t\t\t$this->redirect(array('admin'=>false,'action' => 'login'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function index()\n {\n return $this->signup();\n }",
"static function signup($app) {\n $result = AuthControllerNative::signup($app->request->post());\n if($result['registered']) {\n return $app->render(200, $result);\n } else {\n return $app->render(400, $result);\n }\n }",
"function signUp($form, &$form_state)\n{\n global $user;\n $UID = $user->uid;\n $new = $form_state['new'] = true;\n $params = drupal_get_query_parameters();\n\n // various checks for permissions\n if(dbGetTeamsForUser($user->uid) == false){\n drupal_set_message(\"You don't have a team assigned.\", 'error');\n drupal_goto($_SERVER['HTTP_REFERER']);\n }\n\n // getting the outreach ID from the URL parameters and setting that and the team ID into local variables\n if(isset($params['OID']) && $params['OID'] > 0){ \n $OID = $params['OID'];\n $TID = dbGetTeamForOutreach($OID);\n\n if(!dbIsUserApprovedForTeam($UID, $TID)) {\n drupal_set_message('You do not have the permission to contribute to this event.', 'error');\n drupal_goto($_SERVER['HTTP_REFERER']);\n }\n if(dbIsOutreachOver($OID)){\n drupal_set_message('You can not contribute to this event. It has already ended.', 'error');\n drupal_goto($_SERVER['HTTP_REFERER']);\n }\n \n $outreach = dbGetOutreach($OID); \n \n if(dbIsUserSignedUp($UID, $OID)){ // if user is already signed up for outreach then sets \"new\" to false\n $new = $form_state['new'] = false;\n $data = dbGetUserSignUpType($UID, $OID); // getting data related to sign up\n }\n\n $types = array('prep'=>'Preparation','atEvent'=>'At Event','writeUp'=>'Write Up','followUp'=>'Follow Up');\n\n $form = array();\n\n $form['fields']=array(\n\t\t\t '#type'=>'fieldset',\n\t\t\t '#title'=>t('Sign Up For Outreach: ' . dbGetOutreachName($OID)),\n\t\t\t );\n\n // displays outreach owner's name and email (unless they are no longer on the team)\n $ownerUID = dbGetOutreachOwner($OID);\n $email = dbGetUserPrimaryEmail($ownerUID);\n if(dbGetUserName($ownerUID) != -1){\n $markup = '<b>Owner of Outreach: </b>' . dbGetUserName($ownerUID);\n if(dbIsUserApprovedForTeam($ownerUID, $TID)){\n\t$markup .= \"<br><b>Email of Owner: </b><a href=\\\"mailto:$email\\\" target=\\\"_top\\\">$email</a>\";\n } else {\n\t$markup .= ' (no longer on this team)<br>';\n }\n }\n else{\n $markup = '<b>Owner of Outreach: </b>[none]<br>';\n $markup .= '<b>Email of Owner: </b>[none]';\n }\n\n $form['tableHeader']=array(\n\t\t\t '#markup' => $markup\n\t\t\t );\n\n // signing up for time slots listed in the array above (local variable --> \"types\")\n $form['fields']['times']=array(\n\t\t\t\t '#prefix'=>'<table colspan=\"4\"><tr><td colspan=\"2\">',\n\t\t\t\t '#type'=>'checkboxes',\n\t\t\t\t '#title'=>t('<h4>Which time(s) would you like to sign up for?</h4>'),\n\t\t\t\t '#options'=> $types,\n\t\t\t\t '#default_value'=>$new?array():$data,\n\t\t\t\t '#suffix'=>'</td>',\n\t\t\t\t );\n\n // obligatory confirmation for the user to understand their commitment\n $form['fields']['confirmation']=array(\n\t\t\t\t\t '#prefix'=>'<td colspan=\"2\">',\n\t\t\t\t\t '#type'=>'checkbox',\n\t\t\t\t\t '#title'=>t('<b>By checking this box, I understand that I am signing up for this event and am committed to the time(s) I agreed to.</b>'),\n\t\t\t\t\t '#suffix'=>'</td></tr>',\n\t\t\t\t\t );\n\n $form['fields']['html1'] = array('#markup'=>'<tr>');\n\n // allows a user to cancel their commitment to their outreach times\n if(!$new){\n $form['fields']['cancel']=array(\n\t\t\t\t '#prefix'=>'<td colspan=\"2\">',\n\t\t\t\t '#type'=>'submit',\n\t\t\t\t '#value'=>'Remove Commitment',\n\t\t\t\t '#limit_validation_errors' => array(),\n\t\t\t\t '#submit'=>array('cancelCommit'),\n\t\t\t\t '#suffix'=>'</td>'\n\t\t\t\t );\n } else {\n $form['fields']['html'] = array('#markup'=>'<td></td>');\n }\n\n $form['fields']['submit']=array(\n\t\t\t\t '#prefix'=>'<td colspan=\"2\" style=\"text-align:right\">',\n\t\t\t\t '#type'=>'submit',\n\t\t\t\t '#value'=>t('Submit'),\n\t\t\t\t '#suffix'=>'</td>'\n\t\t\t\t );\n\n\n $form['fields']['footer'] = array('#markup'=>'</tr></table>');\n\n return $form;\n\n } else { // in case the parameter passed was an invalid OID\n drupal_set_message('Invalid outreach event. Click <a href=\"?q=teamDashboard\">here</a> to naviagte back to events in Team Dashboard.', 'error');\n }\n\n}",
"function viewSignUpForm() {\n\t$view = new viewModel();\n\t$view->showSignUpForm();\t\n}",
"function SignupAction($data, $form) {\n \n\t\t\n\t\t// Create a new object and load the form data into it\n\t\t$entry = new SearchContestEntry();\n\t\t$form->saveInto($entry);\n \n\t\t// Write it to the database.\n\t\t$entry->write();\n\t\t\n\t\tSession::set('ActionStatus', 'success'); \n\t\tSession::set('ActionMessage', 'Thanks for your entry!');\n\t\t\n\t\t//print_r($form);\n\t\tDirector::redirectBack();\n \n\t}",
"function user_signup($Oau_postgrads)\n\t{\n\n\t\tglobal $Oau_auth;\n\n\t\tarray_walk($Oau_postgrads, 'array_sanitize');\n\t\t$Oau_postgrads['password'] = md5($Oau_postgrads['password']);\n\t\t$fields = '`' .implode('`, `', array_keys($Oau_postgrads)) . '`';\n\t\t$data = '\\'' .implode('\\', \\'', $Oau_postgrads) . '\\'';\n\t\t$query = \"INSERT INTO `student` ($fields) VALUES ($data)\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\temail($Oau_postgrads['email'], 'Activate your account', \"\n\t\tHello \" . $Oau_postgrads['fname'] .\", \\n\\n\n\n\t\tYou need to activate your student login account, so use the link below:\\n\\n\n\n\t\thttp://www.oau-pgtranscript.senttrigg.com/activate.php?email=\" .$Oau_postgrads['email']. \"&email_code=\" .$Oau_postgrads['email_code']. \"\\n\\n\n\n\t\t--Oau PG Transcript\\n\\n\n\t\thttps://wwww.oau-pgtranscript.senttrigg.com\n\t\t\");\n\n\t}",
"public function guest_completed_registration_form_Successfully_registered_and_checked_in_DB()\n {\n $this->visit('/register')\n ->seePageIs('/register')\n ->type($this->user->name, 'name')\n ->type($this->user->email, 'email')\n ->type($this->user->password, 'password')\n ->type($this->user->password, 'password_confirmation')\n ->press('Register');\n\n\n $this->seeInDatabase('users', ['name' => $this->user->name]);\n }",
"protected function display() {\n\t\t\t$objUrl = AppRegistry::get('Url');\n\t\t\t$strActionType = 'signup';\n\t\t\t\n\t\t\tif ($objUrl->getMethod() == 'POST' && $objUrl->getVariable('action') == $strActionType) {\n\t\t\t\tif (!empty($_POST['promo'])) {\n\t\t\t\t\tif (!($blnValidCode = in_array($_POST['promo'], AppConfig::get('BetaPromoCodes')))) {\n\t\t\t\t\t\tAppLoader::includeModel('PromoModel');\n\t\t\t\t\t\t$objPromo = new PromoModel();\n\t\t\t\t\t\tif ($objPromo->loadByCodeAndType($_POST['promo'], 'beta')) {\n\t\t\t\t\t\t\tif ($objPromoRecord = $objPromo->current()) {\n\t\t\t\t\t\t\t\tif (!$objPromoRecord->get('claimed')) {\n\t\t\t\t\t\t\t\t\t$blnValidCode = true;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('That promo code has already been claimed'));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid promo code'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error verifying the promo code'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('A promo code is required to register during the private beta'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!empty($blnValidCode)) {\n\t\t\t\t\t$objUser = new UserModel(array('Validate' => true));\n\t\t\t\t\t$objUser->import(array(\n\t\t\t\t\t\t'username'\t=> !empty($_POST['username']) ? $_POST['username'] : null,\n\t\t\t\t\t\t'email'\t\t=> !empty($_POST['email']) ? $_POST['email'] : null,\n\t\t\t\t\t));\n\t\t\t\t\t$objUser->current()->set('password_plaintext', !empty($_POST['password']) ? $_POST['password'] : null);\n\t\t\t\t\t$objUser->current()->set('password_plaintext_again', !empty($_POST['password_again']) ? $_POST['password_again'] : null);\n\t\t\t\t\t\n\t\t\t\t\tif ($objUser->save()) {\n\t\t\t\t\t\tif (isset($objPromoRecord)) {\n\t\t\t\t\t\t\t$objPromoRecord->set('userid', $objUser->current()->get('__id'));\n\t\t\t\t\t\t\t$objPromoRecord->set('claimed', date(AppRegistry::get('Database')->getDatetimeFormat()));\n\t\t\t\t\t\t\t$objPromo->save();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($objUserLogin = AppRegistry::get('UserLogin', false)) {\n\t\t\t\t\t\t\t$objUserLogin->handleFormLogin($objUser->current()->get('username'), $objUser->current()->get('password_plaintext'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tCoreAlert::alert(AppLanguage::translate('Welcome to %s, %s!', AppConfig::get('SiteTitle'), $objUser->current()->get('displayname')), true);\t\n\t\t\t\t\t\tAppDisplay::getInstance()->appendHeader('location: ' . AppConfig::get('BaseUrl') . '/');\n\t\t\t\t\t\texit;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAppRegistry::get('Error')->error(AppLanguage::translate('There was an error signing up. Please try again'), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->validateFile($strTemplate = $this->strTemplateDir . $this->strThemeDir . 'beta.phtml')) {\n\t\t\t\tAppDisplay::getInstance()->appendTemplate('content', $strTemplate, array_merge($this->arrPageVars, array(\n\t\t\t\t\t'strCssUrl'\t\t\t=> AppConfig::get('CssUrl'),\n\t\t\t\t\t'strJsUrl'\t\t\t=> AppConfig::get('JsUrl'),\n\t\t\t\t\t'strSubmitUrl'\t\t=> AppRegistry::get('Url')->getCurrentUrl(),\n\t\t\t\t\t'strTokenField'\t\t=> AppConfig::get('TokenField'),\n\t\t\t\t\t'strUsernameField'\t=> AppConfig::get('LoginUsernameField'),\n\t\t\t\t\t'strPasswordField'\t=> AppConfig::get('LoginPasswordField'),\n\t\t\t\t\t'strLoginFlag'\t\t=> AppConfig::get('LoginFlag'),\n\t\t\t\t\t'strActionType'\t\t=> $strActionType,\n\t\t\t\t\t'blnSignupForm'\t\t=> !empty($_GET['promo']) || (!empty($_POST['action']) && $_POST['action'] == $strActionType) || (!empty($_GET['form']) && $_GET['form'] == 'signup'),\n\t\t\t\t\t'blnLoginForm'\t\t=> (!empty($_POST) && empty($_POST['action'])) || (!empty($_GET['form']) && $_GET['form'] == 'login'),\n\t\t\t\t\t'arrErrors'\t\t\t=> AppRegistry::get('Error')->getErrors()\n\t\t\t\t)));\n\t\t\t}\n\t\t}",
"public function onUserSignUp($event) \n {\n $event->user->notify(new NotifyUser($event->user, 'signup'));\n }",
"public function activateAccount()\n {\n // Récupération des variables nécessaires à l'activation\n $email = $_GET['email'];\n $activation_key = $_GET['key'];\n // On active le compte\n $activation = $this->Members->activateAccount($email, $activation_key);\n\n // Préparation de la page\n $page = new Page(array(\n 'title' => 'Inscription réussie',\n 'class_body' => 'signin'\n ));\n // Rendu du contenu\n $variables = compact('activation');\n $content = $this->render('members/signin/validation.php', $variables);\n // Rendu de la page\n echo $page->render($content);\n }",
"function draw_signup() { ?>\n <section id=\"signup\">\n\n <header><h2>New Account</h2></header>\n\n <form method=\"post\" action=\"../actions/action_signup.php\">\n <input type=\"text\" name=\"username\" placeholder=\"username\" required>\n <input type=\"password\" name=\"password\" placeholder=\"password\" required>\n <input type=\"submit\" value=\"Signup\">\n </form>\n\n <footer>\n <p>Already have an account? <a href=\"login.php\">Login!</a></p>\n </footer>\n\n </section>\n<?php }",
"function signUp() {\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\t\t\t$password = $_REQUEST['password'];\n\t\t\t$email = $_REQUEST['email'];\n\t\t\t$phone = $_REQUEST['phone'];\n\t\t\t\n\t\t\tinclude_once(\"users.php\");\n\n\t\t\t$userObj=new users();\n\t\t\t$r=$userObj->addUser($username,$password,$email,$phone);\n\t\t\t\n\t\t\tif(!$r){\n\t\t\t\techo '{\"result\":0, \"message\":\"Error signing up\"}';\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\techo '{\"result\":1,\"message\": \"You have successfully signed up for Proximity\"}'; \n\t\t\t}\n\t\t}\n\t}",
"function confirm_user_signup($user_name, $user_email)\n {\n }",
"public function signup()\n\t{\n\t\t$id_telefono = $this->session->userdata('username');\n\t\t$data['estado'] = $this->plataforma_model->getEstado($id_telefono); \n\t\t$data['saldo'] = $this->plataforma_model->getSaldo($id_telefono); \n\t\t$data['usuario'] = $this->plataforma_model->getUserInfo($id_telefono); \n\t\t$this->load->view('signup',$data);\n\t}",
"public function signUp()\n {\n switch ($_SERVER['REQUEST_METHOD'])\n {\n case 'GET':\n parent::view(\"Sign Up\", \"signup.php\");\n break;\n\n case 'POST':\n $newUser = new SignUpViewModel();\n $newUser->setEmail($_POST['email']);\n $newUser->setUsername($_POST['username']);\n $newUser->setPassword($_POST['password']);\n $newUser->setPassword2($_POST['password2']);\n\n $userManager = new UserManager($this->userRepository);\n $result = $userManager->signUp($newUser);\n if($result)\n {\n header(\"location:/\". APP_HOST . \"account/login\");\n }\n else\n {\n parent::view(\"Sign Up\",\"signup.php\",\n $newUser, null, $userManager->getMessages());\n }\n\n break;\n\n default:\n break;\n }\n }",
"public function p_signup() {\n\t#print_r($_POST);\n\n\t# Prevent SQL injection attacks by sanitizing user entered data\n\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t#encrypt\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t#can override password salt in application version in core config\n\n\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\t#token salt, users email, random string then hashed\n\n\t$_POST['created'] = Time::now(); #could mimic different time\n\t$_POST['modified'] = Time::now(); #time stamp\n\n\t#check if the address is not in use in the system\n\t$q = \"SELECT email\n\tFROM users WHERE email = '\".$_POST['email'].\"'\";\n\n\t$email = DB::instance(DB_NAME)->select_field($q);\n\n\tif($email == $_POST['email'] && $_POST['email' != \"\"]){\t\n\n\t\t$address_in_use = \"The email address you have entered is already in use. Please pick another.\";\n\t\tRouter::redirect(\"/users/signup/error=$address_in_use\");\n\t}\n\n\tif($_POST['email'] == \"\" || $_POST['first_name'] == \"\" || $_POST['last_name'] == \"\" || $_POST['password'] == \"\" ){\n\n\t\t$required = \"All fields on this form are required.\";\n\t\tRouter::redirect(\"/users/signup/error: $required\");\n\t}\n\telse{\n\n\t\t$user_id = DB::instance(DB_NAME)->insert(\"users\", $_POST);\n\n\n\t\t# For now, just confirm they've signed up - we can make this fancier later\n\t\techo \"You're registered! Now go <a href='/users/login'>add issue</a>\";\n\t\tRouter::redirect(\"/users/login\");\n\t}\t\n}",
"function dp_signup_button() { \n\tif(!is_user_logged_in() && get_option('users_can_register') && get_option('dp_header_signup')) {\n\t\techo '<a class=\"btn btn-green btn-signup\" href=\"'.site_url('wp-login.php?action=register', 'login').'\">'.__('Sign up', 'dp').'</a>';\n\t}\n\t\n\treturn;\n}",
"public function showSignup()\n\t{\n\t\treturn View::make('signup');\n\t}",
"public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&module=contact', 'forum_profil');\n\t}",
"public function signup()\n {\n if(isset($_SESSION['id'])) {\n return view('signup');\n }else {\n header('Location: login');\n }\n }",
"public function singUpPage()\n {\n return view('pages/signup');\n }",
"public function signup()\n {\n return view('auth.signup');\n }",
"public function contact(){\n\t\t//Se verifica que exista una sesión activa\n\t\t// if ( (!empty($_SESSION['role'])) && ($_SESSION['role'] == null ) ) {\n\t\t// \t//Se maneja la excepción en caso de que no haya un usuario en la sesión\n\t\t// \tthrow new NotFoundException(__('Es necesario estar registrado para esta sección.'));\n\t\t// \t//Se redirige al home de la página\n\t\t// \treturn $this->redirect(array('controller' => 'pages','action' => 'display'));\n\t\t// }\n\n\t}",
"public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n if($this->security->checkToken())\n {\n if ($form->isValid($this->request->getPost()) != false) {\n $tampemail = $this->request->getPost('email');\n $user = new Users([\n 'name' => $this->request->getPost('name', 'striptags'),\n 'lastname' => $this->request->getPost('lastname', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2,\n 'type' => $this->request->getPost('type'),\n 'skype' => $this->request->getPost('skype'),\n 'phone' => $this->request->getPost('phone'),\n 'company' => $this->request->getPost('company'),\n 'address' => $this->request->getPost('address'),\n 'city' => $this->request->getPost('city'),\n 'country' => $this->request->getPost('country'),\n ]);\n\n if ($user->save()) {\n $this->flashSess->success(\"A confirmation mail has been sent to \".$tampemail);\n $this->view->disable();\n return $this->response->redirect('');\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n else {\n $this->flash->error('CSRF Validation is Failed');\n }\n }\n\n $this->view->form = $form;\n }",
"public function registerFamilyAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authRegisterParent' );\n }",
"public function api_entry_signup() {\n\n parent::validateParams(array(\"username\", \"email\", \"password\", \"fullname\", \"church\", \"province\", \"city\", \"bday\"));\n\n $qbToken = $this->qbhelper->generateSession();\n\n if ($qbToken == null || $qbToken == \"\") parent::returnWithErr(\"Generating QB session has been failed.\");\n\n $qbSession = $this->qbhelper->signupUser(\n $qbToken,\n $_POST['username'],\n $_POST['email'],\n QB_DEFAULT_PASSWORD\n );\n /*\n\n */\n if ($qbSession == null)\n parent::returnWithErr($this->qbhelper->latestErr);\n\n $newUser = $this->Mdl_Users->signup(\n $_POST['username'],\n $_POST['email'],\n md5($_POST['password']),\n $_POST['fullname'],\n $_POST['church'],\n $_POST['province'],\n $_POST['city'],\n $_POST['bday'],\n $qbSession\n );\n\n if ($newUser == null) {\n parent::returnWithErr($this->qbhelper->latestErr);\n }\n\n $hash = hash('tiger192,3', $newUser['username'] . date(\"y-d-m-h-m-s\"));\n $baseurl = $this->config->base_url();\n\n $this->load->model('Mdl_Tokens');\n $this->Mdl_Tokens->create(array(\n \"token\" => $hash,\n \"user\" => $newUser['id']\n ));\n\n $content = '<html><head><base target=\"_blank\">\n <style type=\"text/css\">\n ::-webkit-scrollbar{ display: none; }\n </style>\n <style id=\"cloudAttachStyle\" type=\"text/css\">\n #divNeteaseBigAttach, #divNeteaseBigAttach_bak{display:none;}\n </style>\n <style type=\"text/css\">\n .ReadMsgBody{ width: 100%;} \n .ExternalClass {width: 100%;} \n .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} \n p { margin: 1em 0;} \n table td { border-collapse: collapse;} \n _-ms-viewport{ width: device-width;}\n _media screen and (max-width: 480px) {\n html,body { width: 100%; overflow-x: hidden;}\n table[class=\"container\"] { width:320px !important; padding: 0 !important; }\n table[class=\"content\"] { width:100% !important; }\n td[class=\"mobile-center\"] { text-align: center !important; }\n td[class=\"content-center\"] { text-align: center !important; padding: 0 !important; }\n td[class=\"frame\"] {padding: 0 !important;}\n [class=\"mobile-hidden\"] {display:none !important;}\n table[class=\"cta\"]{width: 100% !important;}\n table[class=\"cta\"] td{display: block !important; text-align: center !important;}\n *[class=\"daWrap\"] {padding: 20px 15px !important;}\n }\n </style>\n\n\n </head><body><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tbody><tr><td class=\"frame\" bgcolor=\"#f3f3f3\">\n <table width=\"576\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" class=\"container\" align=\"center\">\n <tbody><tr><td style=\"padding-left:5px;border-bottom: solid 2px #dcdcdc;\" class=\"mobile-center\"><font face=\"Helvetica, Arial, sans-serif\" size=\"3\" color=\"black\" style=\"font-size: 16px;\">\n <font size=\"4\" color=\"#3db01a\" style=\"font-size:40px;\"><b>iPray</b></font>\n </td></tr>\n </tbody></table>\n </td></tr>\n <tr><td class=\"frame\" bgcolor=\"#f3f3f3\"><div align=\"center\">\n \n <table border=\"0\" cellpadding=\"40\" cellspacing=\"0\" width=\"576\" class=\"container\" align=\"center\"> \n <tbody><tr><td class=\"daWrap\">\n <table width=\"80%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"content\">\n <tbody><tr>\n <td align=\"left\" valign=\"top\" style=\"padding-top:15px;\" class=\"content-center\"><font face=\"Helvetica, Arial, sans-serif\" size=\"3\" color=\"black\" style=\"font-size: 16px;\">\n <font size=\"4\" color=\"#3db01a\" style=\"font-size:22px;\"><b>You are almost verified.</b></font><br><br>\n People are looking for someone they can trust. With a verified email, you\"ll be instantly more approachable. Just click the link to finish up.</font>\n <br><br>\n <table cellspacing=\"0\" cellpadding=\"0\" align=\"left\" class=\"cta\">\n <tbody><tr><td style=\"font-size: 17px; color: white; background: #1a6599; background-image: -moz-linear-gradient(top, #2b88c8, #1a6599); background-image: -ms-linear-gradient(top, #2b88c8, #1a6599); background-image: -o-linear-gradient(top, #2b88c8, #1a6599); background-image: -webkit-gradient(linear, center top, center bottom, from(#2b88c8), to(#1a6599)); background-image: -webkit-linear-gradient(top, #2b88c8, #1a6599); background-image: linear-gradient(top, #2b88c8, #1a6599); text-decoration: none; font-weight: normal; display: inline-block; line-height: 25px; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; padding: 10px 40px; \">\n <font face=\"Helvetica, Arial, sans-serif\"><a href=\"'. $baseurl .'AdminLogin/verify?token=' . $hash . '\" style=\"color: #FFFFFF; text-decoration: none; text-shadow: 0px -1px 2px #333333; letter-spacing: 1px; display: block;\">Verify Your Email</a></font>\n </td></tr>\n </tbody></table>\n </td></tr>\n </tbody></table>\n <table width=\"80%\" cellpadding=\"5\" cellspacing=\"0\" border=\"0\" align=\"center\" class=\"content\">\n <tbody><tr><td> </td></tr>\n <tr><td align=\"center\" style=\"border-bottom: solid 1px #dcdcdc;\"><font face=\"Helvetica, Arial, sans-serif\" size=\"2\" color=\"#777\" style=\"font-size: 13px;\">\n <b>Questions?</b> Take a look at our <a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#488ac9;\">FAQs</a>, or contact<a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#488ac9;\"> Customer Care</a>.</font>\n </td></tr>\n </tbody></table>\n </td></tr>\n <tr><td align=\"center\" style=\"padding:15px;\"><font face=\"Arial, sans-serif\" size=\"2\" color=\"#333333\" style=\"font-size:12px;\">\n <em>Please add <a href=\"mailto:[email protected]\">[email protected]</a> to your address book to ensure our emails reach your inbox.</em><br><br>\n Please do not reply to this email. Replies will not be received. If you have a question, or need assistance, please contact<a href=\"http://www.match.com/help/help.aspx?emailid=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c\" target=\"_blank\" style=\"color:#8a8a8a;\"> Customer Service</a>.</font></td>\n </tr>\n </tbody></table>\n \n </div></td></tr>\n </tbody></table>\n\n <img src=\"http://www.match.com/email/open.aspx?EmailID=b8ba94ac-4dfc-4b5d-9cff-165003e5e85c&SrcSystem=3\" width=\"1\" height=\"1\" border=\"0\">\n <span style=\"padding: 0px;\"></span>\n\n \n\n <style type=\"text/css\">\n body{font-size:14px;font-family:arial,verdana,sans-serif;line-height:1.666;padding:0;margin:0;overflow:auto;white-space:normal;word-wrap:break-word;min-height:100px}\n td, input, button, select, body{font-family:Helvetica, \"Microsoft Yahei\", verdana}\n pre {white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;width:95%}\n th,td{font-family:arial,verdana,sans-serif;line-height:1.666}\n img{ border:0}\n header,footer,section,aside,article,nav,hgroup,figure,figcaption{display:block}\n </style>\n\n <style id=\"ntes_link_color\" type=\"text/css\">a,td a{color:#064977}</style>\n </body></html>';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, 'api:key-061710f7633b3b2e2971afade78b48ea');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_URL, \n 'https://api.mailgun.net/v3/sandboxa8b6f44a159048db93fd39fc8acbd3fa.mailgun.org/messages');\n curl_setopt($ch, CURLOPT_POSTFIELDS, \n array('from' => '[email protected] <[email protected]>',\n 'to' => $newUser['username'] . ' <' . $newUser['email'] . '>',\n 'subject' => \"Please verify your account.\",\n 'html' => $content));\n $result = curl_exec($ch);\n curl_close($ch);\n\n /*\n Now we should register qb user at first.....\n */\n parent::returnWithoutErr(\"User has been created successfully. Please verfiy your account from verification email.\", $newUser);\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function action_signup()\r\n\t{\r\n\t\t$this->title = 'Sign Up';\r\n\t\t$user = ORM::factory('user');\r\n\t\t$errors = array();\r\n\t\tif ($_POST)\r\n\t\t{\r\n\t\t\t$user->values($_POST);\r\n\t\t\t$user->level_id = Model_User::DEFAULT_LEVEL;\r\n\t\t\tif ($user->check())\r\n\t\t\t{\r\n\t\t\t\t$user->save(); // must save before adding relations\r\n\t\t\t\t$user->add('roles', ORM::factory('role', array('name'=>'login')));\r\n\t\t\t\t$this->session->set($this->success_session_key, \"Your account is set up.\");\r\n\t\t\t\t$user->login($_POST);\r\n\t\t\t\t$user->create_sample_form();\r\n\t\t\t\t$this->request->redirect('account');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$errors = $user->validate()->errors('validate');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$view = 'account/signup';\r\n\t\t$vars = array(\r\n\t\t\t'user' => $user,\r\n\t\t\t'errors' => $errors,\r\n\t\t);\r\n\t\t$this->template->content = View::factory($view)->set($vars);\r\n\t}",
"public static function allowUserSignUp()\n {\n return false;\n }",
"public function signup()\n {\n $data = [\n 'title' => 'This is the signup page | Whitelabel',\n 'headline' => 'This is the headline',\n 'callToAction' => 'Buy now',\n 'subHeadline' => 'Some description',\n 'subSubHeadline' => trans('signup.slogan'),\n 'articleText' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',\n\n 'productImageUrl' => '/img/whitelabel/product-thumb.png',\n\n 'testimonials' => [\n [\n 'text' => 'Great website have recommended to family and friends',\n 'author' => 'Shereen A',\n 'time' => \\Carbon\\Carbon::today()->formatLocalized('%A %d %B %Y'),\n 'rating' => 5,\n ],\n [\n 'text' => 'Great website have recommended to family and friends',\n 'author' => 'Shereen A',\n 'time' => \\Carbon\\Carbon::today()->formatLocalized('%A %d %B %Y'),\n 'rating' => 5,\n ],\n [\n 'text' => 'Great website have recommended to family and friends',\n 'author' => 'Shereen A',\n 'time' => \\Carbon\\Carbon::yesterday()->formatLocalized('%A %d %B %Y'),\n 'rating' => 4,\n ]\n ],\n ];\n\n return view($this->getViewName(), $data);\n }",
"public function signUp()\n\t{\n\t\t$user_name = Request::input('user_name');\n\n\t\treturn view('sign-up');\n\t}",
"public function getFbSignUp(){\n\t\t//make the sign up view\n\t\treturn View::make('account.fb-signup');\n\t}",
"public function contactUs()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'contact');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Contact Us')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/contact_us');\n }",
"function wpmu_signup_user($user, $user_email, $meta = array())\n {\n }",
"public function signUp() {\n if ($this->request->is('post')) {\n\n $this->User->create();\n\n if ($this->User->save($this->request->data['signUp'])) {\n $this->Flash->set(__(\"Your user has been created\"),array(\n 'element' => 'success'\n ));\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->set(\n __('The user could not be saved. Please, try again.',\n array(\n 'element' => 'error.ctp'\n ))\n );\n }\n\n $this->autoRender = false;\n }",
"public function doAction() {\n if ($this->request->isPost() === false) {\n\n $this->flashSession->error('Invalid request');\n return $this->response->redirect('signup', false, 302);\n }\n\n // Validate the form\n $form = new \\Aiden\\Forms\\RegisterForm();\n if (!$form->isValid($this->request->getPost())) {\n foreach ($form->getMessages() as $message) {\n $this->flashSession->error($message);\n return $this->response->redirect('/#form-response', 302);\n }\n }\n\n $name = $this->request->getPost(\"name\", \"string\");\n $email = $this->request->getPost(\"email\", \"string\");\n $password = $this->request->getPost(\"password\");\n $websiteUrl = $this->request->getPost(\"websiteUrl\", \"string\");\n $companyName = $this->request->getPost(\"companyName\", \"string\");\n $companyCountry = $this->request->getPost(\"companyCountry\", \"string\");\n $companyCity = $this->request->getPost(\"companyCity\", \"string\");\n $checkfirst = \\Aiden\\Models\\Users::findFirst(array(\n \"email = ?1\",\n \"bind\" => array(\n 1 => $email,\n )));\n\n if ($checkfirst) {\n $errorMessage = 'Email is already existed, please try another.';\n $this->flashSession->error($errorMessage);\n return $this->response->redirect('signup', false, 302);\n }\n $user = new \\Aiden\\Models\\Users();\n $user->setName($name);\n $user->setEmail($email);\n $user->setWebsiteUrl($websiteUrl);\n $user->setCompanyName($companyName);\n $user->setCompanyCountry($companyCountry);\n $user->setCompanyCity($companyCity);\n $user->setPasswordHash($this->security->hash($password));\n $user->setLevel(\\Aiden\\Models\\Users::LEVEL_USER);\n $user->setCreated(new \\DateTime());\n $user->setLastLogin(new \\DateTime());\n $user->setImageUrl(BASE_URI.\"dashboard_assets/images/avatars/avatar.jpg\");\n $user->setSeenModal(0);\n $user->setPhraseDetectEmail(0);\n $user->setSubscriptionStatus('trial');\n\n if ($user->save()) {\n\n $this->session->set('auth', [\n 'user' => $user\n ]);\n\n // Log message\n $message = sprintf('User with email [%s] has successfully registered.', $email);\n $this->logger->info($message);\n\n return $this->response->redirect('leads', false, 302);\n }\n else {\n\n // Client message\n $errorMessage = 'Something went wrong, please try again.';\n $this->flashSession->error($errorMessage);\n\n // Log message\n $message = sprintf('Could not signup user [%s]. (Model error: %s)', $email, print_r($user->getMessages(), true));\n $this->logger->error($message);\n\n return $this->response->redirect('signup', false, 302);\n }\n\n }",
"public function signUpAction() {\n //initialize an emtpy message string\n $message = '';\n //check if we have a logged in user\n if ($this->has('security.context') && $this->getUser() && TRUE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n //set a hint message for the user\n $message = $this->get('translator')->trans('you will be logged out and logged in as the new user');\n }\n //initialize the form validation groups array\n $formValidationGroups = array('signup');\n $container = $this->container;\n //get the login name configuration\n $loginNameRequired = $container->getParameter('login_name_required');\n //check if the login name is required\n if ($loginNameRequired) {\n //add the login name group to the form validation array\n $formValidationGroups [] = 'loginName';\n }\n //get the request object\n $request = $this->getRequest();\n //create an emtpy user object\n $user = new User();\n //this flag is used in the view to correctly render the widgets\n $popupFlag = FALSE;\n //check if this is an ajax request\n if ($request->isXmlHttpRequest()) {\n //create a signup form\n $formBuilder = $this->createFormBuilder($user, array(\n 'validation_groups' => $formValidationGroups\n ))\n ->add('email')\n ->add('firstName', null, array('required' => false))\n ->add('userPassword');\n //use the popup twig\n $view = 'ObjectsUserBundle:User:signup_popup.html.twig';\n $popupFlag = TRUE;\n } else {\n //create a signup form\n $formBuilder = $this->createFormBuilder($user, array(\n 'validation_groups' => $formValidationGroups\n ))\n ->add('email', 'email')\n ->add('firstName', null, array('required' => false))\n ->add('userPassword', 'repeated', array(\n 'type' => 'password',\n 'first_name' => 'Password',\n 'second_name' => 'RePassword',\n 'invalid_message' => \"The passwords don't match\",\n ));\n //use the signup page\n $view = 'ObjectsUserBundle:User:signup.html.twig';\n }\n //check if the login name is required\n if ($loginNameRequired) {\n //add the login name field\n $formBuilder->add('loginName');\n }\n //create the form\n $form = $formBuilder->getForm();\n //check if this is the user posted his data\n if ($request->getMethod() == 'POST') {\n //fill the form data from the request\n $form->handleRequest($request);\n //check if the form values are correct\n if ($form->isValid()) {\n //get the user object from the form\n $user = $form->getData();\n if (!$loginNameRequired) {\n $user->setLoginName($this->suggestLoginName($user->__toString()));\n }\n //user data are valid finish the signup process\n return $this->finishSignUp($user);\n }\n }\n $twitterSignupEnabled = $container->getParameter('twitter_signup_enabled');\n $facebookSignupEnabled = $container->getParameter('facebook_signup_enabled');\n $linkedinSignupEnabled = $container->getParameter('linkedin_signup_enabled');\n $googleSignupEnabled = $container->getParameter('google_signup_enabled');\n return $this->render($view, array(\n 'form' => $form->createView(),\n 'loginNameRequired' => $loginNameRequired,\n 'message' => $message,\n 'popupFlag' => $popupFlag,\n 'twitterSignupEnabled' => $twitterSignupEnabled,\n 'facebookSignupEnabled' => $facebookSignupEnabled,\n 'linkedinSignupEnabled' => $linkedinSignupEnabled,\n 'googleSignupEnabled' => $googleSignupEnabled\n ));\n }",
"public function postSignup()\n {\n \tif ($this->userForm->create(Input::all())) {\n \t\treturn Redirect::route('auth.getSignup')\n \t\t->with('message', 'Successfully registered. Please check your email and activate your account.')\n \t\t->with('messageType', \"success\");\n \t}\n \n \treturn Redirect::route('auth.getSignup')\n \t->withInput()\n \t->withErrors($this->userForm->errors());\n }",
"public function getSignup(){\n return view('pages.signup');\n }",
"public function testLoggedInContactUsForm()\n {\n if (LOCATION == 'Live') {\n $this->markTestSkipped('Cannot run in Live environment');\n return;\n }\n $this->loginPage->open()\n ->enterUserId($this->userData['loggedInContactForm']['uid'])\n ->enterUserPassword($this->userData['loggedInContactForm']['pwd'])\n ->clickButton();\n $this->loggedOnContactPage->open()\n ->checkPageTitle('contact us')\n ->checkContactForm()\n ->navigateToContactUsViaSideButton()\n ->clickSignOut();\n }",
"function hosting_signup_form() {\n drupal_add_js(drupal_get_path('module', 'hosting_signup') . '/hosting_signup_form.js');\n $form = xmlrpc(_hosting_signup_get_url(), 'hosting_signup.getForm', _hosting_signup_get_key(), $_POST);\n if (!$form) {\n drupal_set_message(t(\"XMLRPC request failed: %error\", array('%error' => xmlrpc_error_msg())), 'error');\n }\n $form['#action'] = '/hosting/signup';\n $form['#submit'][] = 'hosting_signup_form_submit';\n $form['#validate'][] = 'hosting_signup_form_validate';\n return $form;\n}",
"public function display_account_register( ){\n\t\tif( $this->is_page_visible( \"register\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_register.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_register.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_register.php' );\n\t\t}\n\t}",
"function NeedToRegister(){\n \t$HTML = '';\n\n \t$HTML .= _JNEWS_REGISTER_REQUIRED . '<br />';\n\n\t\t $text = _NO_ACCOUNT.\" \";\n\t\t if ( isset( $GLOBALS[JNEWS.'cb_integration'] ) && $GLOBALS[JNEWS.'cb_integration'] ) {\n\t\t\t $linkme = 'option=com_comprofiler&task=registers';\n\t\t } else {\n\t\t \tif( version_compare(JVERSION,'1.6.0','>=') ){ //j16\n\t\t \t\t$linkme = 'option=com_users&view=registration';\n\t\t \t} else {\n\t\t \t\t$linkme = 'option=com_user&task=register';\n\t\t \t}\n\t\t }\n\n\t\t $linkme = jNews_Tools::completeLink($linkme,false);\n\n\t\t $text .= '<a href=\"'. $linkme.'\">';\n\t\t $text .= _CREATE_ACCOUNT.\"</a>\";\n\t\t $HTML .= jnews::printLine( $this->linear, $text );\n\n \treturn $HTML;\n }",
"public function register() \n\t{\n $referer = isset($_GET['referer']) ? htmlentities($_GET['referer'], ENT_QUOTES) : '';\n\t\t\n\t\t$this->View->RenderMulti(['_templates/header','user/register']);\n }",
"function validate_user_signup()\n {\n }",
"public function logInRegisterPage();",
"public function do_register_user() {\n\t\tif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t$redirect_url = home_url( 'member-register' );\n\t\t\t\n\t\t\tif( !get_option( 'users_can_register' ) ) {\n\t\t\t\t// Reg closed\n\t\t\t\t$redirect_url = add_query_arg( 'register-errors', 'closed', $redirect_url );\n\t\t\t} else {\n\t\t\t\t$email = sanitize_email($_POST['email']);\n\t\t\t\t$company_name = sanitize_text_field( $_POST['company_name'] );\n\t\t\t\t$first_name = sanitize_text_field( $_POST['first_name'] );\n\t\t\t\t$last_name = sanitize_text_field( $_POST['last_name'] );\n\t\t\t\t$contact_phone = sanitize_text_field( $_POST['contact_phone'] );\n\t\t\t\t$mobile_phone = sanitize_text_field( $_POST['mobile_phone'] );\n\t\t\t\t$job_title = sanitize_text_field( $_POST['job_title'] );\n\t\t\t\t$sector = sanitize_text_field( $_POST['sector'] );\n\t\t\t\t$ftseIndex = sanitize_text_field( $_POST['ftseIndex'] );\n\t\t\t\t$invTrust = sanitize_text_field( $_POST['invTrust'] );\n\t\t\t\t$sec_name = sanitize_text_field( $_POST['sec_name'] );\n\t\t\t\t$sec_email = sanitize_text_field( $_POST['sec_email'] );\n\t\t\t\t\n\t\t\t\t$result = $this->register_user( $email, $company_name, $first_name, $last_name, $contact_phone, $mobile_phone, $job_title, $sector, $ftseIndex, $invTrust, $sec_name, $sec_email );\n\t\t\t\t\n\t\t\t\tif( is_wp_error( $result ) ) {\n\t\t\t\t\t// Parse errors into string and append as parameter to redirect\n\t\t\t\t\t$errors = join( ',', $result->get_error_codes() );\n\t\t\t\t\t$redirect_url = add_query_arg( 'register-errors', $errors, $redirect_url );\n\t\t\t\t} else {\n\t\t\t\t\t// Success\n\t\t\t\t\t$redirect_url = home_url( 'thank-you-for-registering' );\n//\t\t\t\t\t$redirect_url = add_query_arg( 'registered', $email, $redirect_url );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twp_redirect( $redirect_url );\n\t\t\texit;\n\t\t}\n\t}",
"public function signup()\n\t{\n\t\treturn View::make('auth/signup', ['title' => 'Sign un']);\n\t}",
"function indexAction()\n {\n if(!$this->getDi()->auth->getUserId() && $this->_request->isGet())\n $this->getDi()->auth->checkExternalLogin($this->_request);\n /*==TRIAL_SPLASH==*/\n\n if (!$this->getDi()->auth->getUserId() && $this->getDi()->config->get('signup_disable')) {\n $e = new Am_Exception_InputError(___('New Signups are Disabled'));\n $e->setLogError(false);\n throw $e;\n }\n\n $this->loadForm();\n $this->view->title = ___($this->record->title);\n $this->form = new Am_Form_Signup();\n $this->form->setParentController($this);\n\n if (($h = $this->getDi()->request->getFiltered('order-data')) &&\n ($hdata = $this->getDi()->store->get('am-order-data-'.$h)))\n {\n $dhdata = json_decode($hdata, true);\n if ($this->getDi()->auth->getUser() && isset($dhdata['redirect'])) {\n $this->getDi()->store->delete('am-order-data-'.$h);\n Am_Mvc_Response::redirectLocation($dhdata['redirect']);\n }\n $this->form->getSessionContainer()->storeOpaque('am-order-data', $dhdata);\n }\n $this->form->initFromSavedForm($this->record);\n try {\n $this->form->run();\n } catch (Am_Exception_QuietError $e){\n $e->setPublicTitle($this->record->title);\n throw $e;\n }\n }",
"public function registerFamilyConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $validator = $this->view->validator; /* @var BeMaverick_Validator $validator */\n\n // set the input params\n $requiredParams = array(\n 'emailAddress',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'authRegisterParent' );\n }\n\n // get the variables\n $emailAddress = $input->emailAddress;\n\n // perform the checks\n $validator->checkParentEmailAddressAssociatedWithAKid( $site, $emailAddress, $errors );\n\n $errorPopupCode = null;\n if ( $errors->hasErrors() ) {\n $errorPopupCode = 'EMAIL_NOT_ASSOCIATED';\n }\n\n if ( $errorPopupCode && $this->view->ajax ) {\n $input->errorCode = $errorPopupCode;\n return $this->renderPage( 'authError' );\n } else if ( $errorPopupCode ) {\n $this->view->popupUrl = $site->getUrl( 'authError', array( 'errorCode' => $errorPopupCode ) );\n return $this->renderPage( 'authRegisterParent' );\n }\n\n // parent is registering, so send them to verify the first kid. they had to have at least\n // one kid to get to this point\n $kids = $site->getKidsByParentEmailAddress( $emailAddress );\n\n if( $kids[0] && !($kids[0]->getVPCStatus()) ) {\n $redirectUrl = BeMaverick_Util::getParentVerifyMaverickUrl( $site, $kids[0] );\n if ( $this->view->ajax ) {\n $this->view->redirectUrl = $redirectUrl;\n return $this->renderPage( 'redirect' );\n }\n\n return $this->_redirect( $redirectUrl );\n } else {\n //if one of the kid is verified, send the parent to set their email.\n $parent = $site->getUserByEmailAddress( $emailAddress );\n BeMaverick_Cookie::updateUserCookie( $parent );\n $successPage = 'authParentVerifyMaverickStep3';\n if ( $this->view->ajax && $this->view->ajax != 'dynamicModule' ) {\n $successPage = $this->view->ajax.'Ajax';\n }\n return $this->renderPage( $successPage );\n }\n }",
"function handleSignUpRequest() {\n if (connectToDB()) {\n if (array_key_exists('signUp', $_POST)) {\n signUpRequest();\n }\n disconnectFromDB();\n }\n}",
"function thank_you()\n\t{\n\t\tlog_message('debug', 'Account/thank_you');\n\t\t$data = filter_forwarded_data($this);\n\n\t\tif($this->native_session->get('__direct_invitation_count') && $this->native_session->get('__direct_invitation_count') >= MINIMUM_INVITE_COUNT)\n\t\t{\n\t\t\t# if a new default view has been set, go to that instead\n\t\t\tif($this->native_session->get('__default_view')\n\t\t\t\t&& $this->native_session->get('__default_view') != 'account/thank_you'\n\t\t\t) {\n\t\t\t\tredirect(base_url().$this->native_session->get('__default_view'));\n\t\t\t}\n\t\t\t# else show the current page\n\t\t\telse {\n\t\t\t\t$data = load_page_labels('invite_five', $data);\n\t\t\t\t$this->load->view('account/thank_you', $data);\n\t\t\t}\n\t\t}\n\t\t# otherwise take the user back to enter more invites\n\t\telse redirect(base_url().'network/invite');\n\t}",
"protected function renderSignUp(){\n return '<form class=\"forms\" action=\"'.Router::urlFor('check_signup').'\" method=\"post\">\n <input class=\"forms-text\" type=\"text\" name=\"fullname\" placeholder=\"Nom complet\">\n <input class=\"forms-text\" type=\"text\" name=\"username\" placeholder=\"Pseudo\">\n <input class=\"forms-text\" type=\"password\" name=\"password\" placeholder=\"Mot de passe\">\n <input class=\"forms-text\" type=\"password\" name=\"password_verify\" placeholder=\"Retape mot de passe\">\n <button class=\"forms-button\" name=\"login_button\" type=\"submit\">Créer son compte</button>\n </form>';\n }",
"public function showSignupForm()\n {\n return view('auth.signup');\n }"
] | [
"0.7082398",
"0.68792564",
"0.6831655",
"0.68097335",
"0.665257",
"0.6623255",
"0.6605127",
"0.65552413",
"0.6510237",
"0.64957774",
"0.6473126",
"0.6436043",
"0.638036",
"0.63757384",
"0.6365833",
"0.63474023",
"0.6334867",
"0.6302438",
"0.629012",
"0.6289079",
"0.6278242",
"0.62580705",
"0.6243761",
"0.6238855",
"0.6237237",
"0.62287396",
"0.6213002",
"0.62014496",
"0.61816186",
"0.6176994",
"0.6176444",
"0.61649126",
"0.61539125",
"0.614349",
"0.61347985",
"0.6130511",
"0.6117161",
"0.61147356",
"0.61046386",
"0.6102644",
"0.61014557",
"0.6097274",
"0.6096818",
"0.6094496",
"0.60905796",
"0.60836226",
"0.60706615",
"0.60524315",
"0.60394335",
"0.6037014",
"0.6033581",
"0.60318005",
"0.60264313",
"0.6025381",
"0.6021781",
"0.6000441",
"0.5999255",
"0.5997188",
"0.59962577",
"0.59956884",
"0.59930617",
"0.5986901",
"0.5980769",
"0.59654456",
"0.59587973",
"0.59586513",
"0.59575284",
"0.59565455",
"0.59484017",
"0.5937329",
"0.593586",
"0.59341365",
"0.59341365",
"0.5930257",
"0.59204966",
"0.59203935",
"0.5911614",
"0.5909401",
"0.5907541",
"0.5898051",
"0.5889818",
"0.58891606",
"0.58889395",
"0.5882637",
"0.5881582",
"0.5881027",
"0.5873874",
"0.5872054",
"0.58664095",
"0.586547",
"0.5863095",
"0.5860965",
"0.5857641",
"0.58575976",
"0.5856623",
"0.58511513",
"0.58429927",
"0.5840509",
"0.5832319",
"0.5831833"
] | 0.6173542 | 31 |
Forcably logged out due to idleness | public function timeout() {
$this->user->logout();
$this->session->sess_create();
$this->session->set_flashdata('logged_out', 'logged_out');
redirect('', 'refresh');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function logoff() {}",
"public function logoff() {}",
"public function logoff() {}",
"public function logoff();",
"function logOutOnTimeout() {\n\t\tglobal $POSHWEBROOT;\n\t\t\n\t\tLogger::logAction(Logger::LOGOUT_ACTION, array('msg'=>'session was too old'));\n\t\t\n\t\tsession_destroy();\n \tsession_unset();\n\n \theader('Location: ' . $POSHWEBROOT . '/portal/login.php?message=' . lg(\"lblYouHaveBeenDisconnected\", round($IDLE_MAXTIMEOUT/60)));\n\t}",
"public function log_out() {\n $this->store_token(null);\n }",
"public function logOut() {\n\t$this->isauthenticated = false;\n\tunset($_SESSION['clpauthid'], $_SESSION['clpareaname'], $_SESSION['clpauthcontainer']);\n\tsession_regenerate_id();\n}",
"public function logOff();",
"public function Logoff();",
"public function interruptLogin();",
"function userLogOut() {\n try {\n delete_key();\n return 1;\n } catch (Exception $ex) {\n return 0;\n }\n }",
"function session_die( $msg ) {\n\tglobal $session_id;\n\n\tif ( isset( $session_id ) && $session_id ) {\n\t\t$result = restCall( 'logout', [ 'session_id' => $session_id ] );\n\t\t$result || die( \"$msg\\nAdditionally, could not get logout result, session id $session_id may now be abandoned.\\n\" );\n\t}\n\n\tdie( \"$msg\\n\" );\n}",
"public function logOut(): void;",
"private function logout() {\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 logOut()\n {\n self::startSession();\n session_destroy();\n }",
"private function aim() {\n\t\t# The class pretends to use the session for storing the\n\t\t# permanent memory of one application\n\t\t# wheteher it does or doesn't a log in to execute it.\n\t\t# It has two ways of make the logout:\n\t\t#\ta) The logout is performed by calling to a website from\n\t\t#\t\twhich yhe user will need to login again to come back\n\t\t#\t\tinside the app.\n\t\t#\tb) The logout is performed changing to the anonymous user\n\t\t#\t\tand accessing to the places suitable for that user.\n\t}",
"public function logOut () : void {\n $this->destroySession();\n }",
"public function log_member_out(){\n\t\tif(isset($_SESSION['status'])) {\n\t\t\t$_SESSION = array();\n\t\t\t$params = session_get_cookie_params();\n\t\t\t//Delete the actual cookie.\n\t\t\tsetcookie(session_name(), '', time() - 42000, $params[\"path\"], $params[\"domain\"], $params[\"secure\"], $params[\"httponly\"]);\n\t\t\t//Destroy session\n\t\t\tsession_destroy();\n\t\t}\n\t}",
"function health_check_troubleshooter_mode_logout() {\n\t\tif ( ! $this->is_troubleshooting() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $_COOKIE['wp-health-check-disable-plugins'] ) ) {\n\t\t\t$this->disable_troubleshooting_mode();\n\t\t}\n\t}",
"public function logout()\n {\n $this->userId = 0;\n $this->createSession();\n $this->logger->loginOutEntry(2);\n }",
"function remoteLogout(){\n if ($this->wtps == NULL)\n return;\n XLogs::notice(get_class($this), '::remoteLogout '.$this->wtps->getSessionId());\n $this->wtps->forceLogout();\n }",
"public function logOut(){\n $this->authToken=\"\";\n $this->loggedUser=\"\";\n $this->clearAuthCookie();\n }",
"function logmemberout()\n\t\t\t{\n\t\t\tif(isset($_SESSION['status'])){\n\t\t\t\t\t\t\t\t\t\t\tunset($_SESSION['status']);\n\n\t\t\t \t\t\t }\n\t\t\tif(isset($_COOKIE[session_name()]))\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tsetcookie(session_name(),'',time() - 1000);\t\t\t\t\t\t\tsession_destroy();\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t}",
"private function isLoggedin()\n\t{\n\t\t$this->idletime = 18000;\n\n\t\tif ((time()-$_SESSION['timestamp'])>$this->idletime)\n\t\t{\n\t\t\t$message = \"You are signed out from the previous session ! Please try sign in again!\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telseif($this->logged_in() == false)\n\t\t{\n\t\t\t$message = \"Invalid session !! Please try sign in again.\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\t}",
"public function end_login(){\n\n\t\t//STARTS SESSION IF NON\n\t\tsession_id() == ''? session_start(): NULL;\n\n\t\t$this->LOGGED_IN = false;\n\t\tunset($this->USER_ID);\n\n\t\t$_SESSION = Array();\n\n\t\tsetcookie(\"PHPSESSID\", NULL, time()-3600, '/');\n\t\tsetcookie(\"user\", NULL, time()-3600, '/');\n\n\t\techo Janitor::build_json_alert('Logged Out Successfully', 'Success', 107, 1);\n\t\texit;\n\t\t}",
"public function logout()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth])) {\t\n\t\t\tSessionManager::instance()->trashLoginCreadentials();\n\t\t}\n\t}",
"public function logOut(){\n\t\t$success = parent::logOut();\n\n\t\tif ( !$_SESSION['login'] ) {\n\t\t\treturn $this->createAnswer( 0,\"log out cuccess\");\n\t\t}else{\n\t\t\treturn $this->createAnswer( 1,\"something went wrong \",403);\n\t\t}\n\t\t\n\t}",
"function onesignin_client_handle_logout_notification($account) {\n watchdog('onesignin', 'Logging out user %name on request of One Signin server.', array('%name' => $account->name), WATCHDOG_INFO);\n drupal_session_destroy_uid($account->uid);\n}",
"static public function logOut(){\n \tself::setId(1);\n }",
"public function _logout()\n {\n $this->_login( self::getGuestID() );\n }",
"function disconnectBL() {\n if ( !empty($_SESSION['userId']) )\n {\n echo 'Bye '.$_SESSION['userId'];\n session_destroy();\n }\n else\n {\n echo \"notConnected\";\n }\n }",
"abstract protected function logout();",
"function ds_logout_internal(): void\n {\n if (isset($_SESSION['ds_access_token'])) {\n unset($_SESSION['ds_access_token']);\n }\n if (isset($_SESSION['ds_refresh_token'])) {\n unset($_SESSION['ds_refresh_token']);\n }\n if (isset($_SESSION['ds_user_email'])) {\n unset($_SESSION['ds_user_email']);\n }\n if (isset($_SESSION['ds_user_name'])) {\n unset($_SESSION['ds_user_name']);\n }\n if (isset($_SESSION['ds_expiration'])) {\n unset($_SESSION['ds_expiration']);\n }\n if (isset($_SESSION['ds_account_id'])) {\n unset($_SESSION['ds_account_id']);\n }\n if (isset($_SESSION['ds_account_name'])) {\n unset($_SESSION['ds_account_name']);\n }\n if (isset($_SESSION['ds_base_path'])) {\n unset($_SESSION['ds_base_path']);\n }\n if (isset($_SESSION['envelope_id'])) {\n unset($_SESSION['envelope_id']);\n }\n if (isset($_SESSION['eg'])) {\n unset($_SESSION['eg']);\n }\n if (isset($_SESSION['envelope_documents'])) {\n unset($_SESSION['envelope_documents']);\n }\n if (isset($_SESSION['template_id'])) {\n unset($_SESSION['template_id']);\n }\n }",
"function startSessionLoged() {\n $this->session->set_ini(); //call ini_set. must be called in every script cause it doesnt remain!\n $this->session->regenerate(); //regenerate the session id\n $this->session->generateTokenId($this->connection,$this->user->getUsrID()); //return the tokenId \n $this->session->initiate($this->user->getKeepMeLogged()); //set values for ip, agent... confirmation\n $this->session->initiateToken($this->session->getToken(), $this->user->getUsrID());\n $this->session->setExpiration(); //set the expiration of idle session\n $this->session->setCookie(); //secure the session cookie\n $this->session->wClose();\n\n }",
"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 }",
"function mysql_auth_can_logout()\n{\n return TRUE;\n}",
"public function logOut(){\r\n\t\t// Starting sessions\r\n\t\tsession_start();\r\n\t\t\r\n\t\t// Emptying sessions\r\n\t\t$_SESSION['userID'] = '';\r\n\t\t$_SESSION['logged_in'] = false;\r\n\t\t\r\n\t\t// Destroying sessions\r\n\t\tsession_destroy();\r\n\t\theader(\"Location: ?controller=home\");\r\n\t\texit();\r\n\t}",
"function LogOut() {\n\t\tunset($user);\n\t\t$loggedIn=false;\n\t}",
"function user_logging_out($user_id) {\n \n }",
"public function logoff(){\n\t ServiceSession::destroy();\n\t Redirect::to(\"/login\")->do();\n\t }",
"public static function logOut()\r\n {\r\n (new Session())->remove(static::$userIdField);\r\n }",
"public function logout_user() {\n\t\tif(isset($_SESSION['eeck'])) {\n\t\t\tunset($_SESSION['eeck']);\n\t\t}\n\t}",
"function log_out() {\n\t// session_destroy ();\n\t\n\tupdate_option('access_token', '');\n\tupdate_option('insta_username', '');\n\tupdate_option('insta_user_id', '');\n\tupdate_option('insta_profile_picture', '');\n\n}",
"function checkLogin() {\n\t\t$fingerprint = fingerprint();\n\t\tsession_start();\n\t\tif (!isset($_SESSION['log_user']) || $_SESSION['log_fingerprint'] != $fingerprint) logout();\n\t\tsession_regenerate_id();\n\t}",
"function user_logging_out($user_id)\n\t{\n\t}",
"function checkLogout(){\n\t\tif ($_SESSION['logrec_logout'] == 0){\n\t\t\tshowMessage(\"You forgot to logout last time. Please remember to log out properly.\");\n\t\t\t$_SESSION['logrec_logout'] = 1;\n\t\t}\n\t}",
"function sessionTimeoutError(){\r\n\t\techo \"<ResponseHeader>\r\n\t\t<ResponseCode>1000</ResponseCode>\r\n\t\t<ResponseMessage>Session timeout</ResponseMessage>\r\n\t\t</ResponseHeader>\";\r\n\t\tsession_destroy();\r\n\t\texit;\r\n\t}",
"public static function Logout()\n {\n Session::CloseSession();\n }",
"public function logoutInactiveIdenties($timeout)\n {\n $sql = \"UPDATE dlayer_identity\n\t\tSET logged_in = 0\n\t\tWHERE last_action < (NOW() - INTERVAL :timeout SECOND)\";\n $stmt = $this->_db->prepare($sql);\n $stmt->bindValue(':timeout', $timeout, PDO::PARAM_INT);\n $stmt->execute();\n }",
"public function __destruct(){ if($this->logged) $this->logoff(); }",
"function logout() {\n $stmt = self::$_db->prepare(\"UPDATE user SET session='' WHERE session=:sid\");\n $sid = session_id();\n $stmt->bindParam(\":sid\", $sid);\n $stmt->execute();\n }",
"function exec_kickout_if_timeout(){\t\r\n if(!(isset($_SESSION['timeout']))){\r\n //echo \"setting time ~~~~~~~~~~~~~</ br>\";\r\n $_SESSION['timeout'] = time();\r\n }\r\n //set delay time,secs\r\n else{\r\n $delay=dev_delay();\r\n if ($_SESSION['timeout'] + $delay < time()) {\r\n $_SESSION = array();\r\n session_destroy();\r\n //return a little feeedback message\r\n //echo \"<div class='alert alert-success' role='alert'>由于长时间未操作,您已退出系统,请重新登录!</div>\";\r\n\r\n header(\"Location:login.php?timeout&redirect_to=\" . urlencode($_SERVER['REQUEST_URI']));\r\n die();\r\n \r\n } else {\r\n $cha=time()-$_SESSION['timeout'];\r\n $cha_div=$cha / 60 ;\r\n $delay_min=$delay / 60;\r\n echo '\r\n <script type=\"text/javascript\">console.log(\"您距离上一次操作相差'.$cha.'秒,即'.$cha_div.' 分钟,超过'.$delay_min.'分钟会强制退出!\")</script> \r\n ';\r\n $_SESSION['timeout'] = time();\r\n // session ok\r\n }\r\n }\r\n}",
"public static function Logout()\n\t{\n\t\t$_SESSION = array();\n\t\tsession_destroy();\n\t\tsession_start();\n\t\tsession_regenerate_id();\n\t\treturn !isset($_SESSION['userID']);\n\t}",
"public function logAdminOff()\n {\n //session must be started before anything\n session_start ();\n\n // Add the session name user_id to a variable $id\n $id = $_SESSION['user_id'];\n\n //if we have a valid session\n if ( $_SESSION['logged_in'] == TRUE )\n {\n $lastActive = date(\"l, M j, Y, g:i a\");\n $online= 'OFF';\n $sql = \"SELECT id,online, last_active FROM users WHERE id = '\".$id.\"'\";\n $res = $this->processSql($sql);\n if ($res){\n $update = \"UPDATE users SET online ='\".$online.\"', last_active ='\".$lastActive.\"' WHERE id = '\".$id.\"'\";\n $result = $this->processSql($update);\n }\n //unset the sessions (all of them - array given)\n unset ( $_SESSION );\n //destroy what's left\n session_destroy ();\n\n header(\"Location: \".APP_PATH.\"admin_login\");\n }\n\n\n \t\t//It is safest to set the cookies with a date that has already expired.\n \t\tif ( isset ( $_COOKIE['cookie_id'] ) && isset ( $_COOKIE['authenticate'] ) ) {\n \t\t\t/**\n \t\t\t\t* uncomment the following line if you wish to remove all cookies\n \t\t\t\t* (don't forget to comment or delete the following 2 lines if you decide to use clear_cookies)\n \t\t\t*/\n \t\t\t//clear_cookies ();\n \t\t\tsetcookie ( \"cookie_id\", '', time() - 3600);\n \t\t\tsetcookie ( \"authenticate\", '', time() - 3600 );\n \t\t}\n\n \t}",
"public function logoff()\n\t{\n\t\t$this->session->sess_destroy();\n\t\tredirect(base_url());\n\t}",
"public function logout()\n {\n $this->_delAuthId();\n }",
"function logout() {\n\t}",
"abstract public function logout();",
"public function logOffEmployee()\n {\n $this->destroyEmployeeHash($_SESSION[\"emp_id\"], $_SESSION[\"emp_hash\"]);\n $this->destroyEmployeeSession();\n }",
"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 ifNotConnected() : void\n {\n if( !isset($_SESSION['_userStart']) )\n {\n header('Location:/vue/user/signin.php');\n die();\n }\n }",
"public function logout() {\n $this->_disconnect_user();\n redirect(base_admin_url('identification'), 'refresh');\n }",
"public function logout()\n\t{\n\t\tif ($this->_loged_in)\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\n\t\t\tunset($_SESSION[\"user_id\"]);\n\t\t\tunset($_SESSION[\"client\"]);\n\t\t\tunset($this->_user_id);\n\n\t\t\t\n\t\t}\n\t}",
"public function logOut()\n {\n $auth = new AuthenticationService();\n\n if ($auth->hasIdentity()) {\n Session::getDefaultManager()->forgetMe();\n $auth->clearIdentity();\n }\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}",
"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 disconnetUser() {\n\t\tsession_start();\n\t\tunset($_SESSION['id_users']);\n\t\tunset($_SESSION['username']);\n\t\theader('Location: index.php');\n\t}",
"function log_member_out()\r\n\t{\r\n\t\tsession_destroy();\r\n\t}",
"public static function LogOut ($destroyWholeSession = FALSE);",
"function clear_expired_sessions() {\n $dbh = DB::connect();\n $timeout = config_get_int('options', 'login_timeout');\n $q = \"DELETE FROM Sessions WHERE ts < (UNIX_TIMESTAMP() - \" . $timeout . \")\";\n $dbh->exec($q);\n}",
"public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://www.plurk.com/Users/logout\",true); \n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}",
"public function hideActiveLogin() {}",
"public function logoff(): void{\n if(!$this->logged) throw new ClientNotFound();\n $this->client = null;\n $this->clientData = null;\n $this->rootClient = null;\n $this->token = null;\n $this->logged = false;\n }",
"public function invalidateCurrentLogin();",
"function logout ($reason=NULL)\n\t{\n\n\t\t// first destroy their user data\n\t\tglobal $xnyo_parent;\n\t\tif (XNYO_DEBUG) $xnyo_parent->debug('Logging out current user'.(empty($xnyo_parent->user->username) ? '.' : ' ('.$xnyo_parent->user->username.')'));\n\n\t\tif (!is_null($reason))\n\t\t\t$_SESSION['_logout_reason'] = $reason;\n\n\t\tsession_unregister('auth');\n\t}",
"public function logout(){\n\t\t$_SESSION['ip'] = '';\n\t\t$_SESSION['username'] = '';\n\t\t$_SESSION['uid'] = '';\n\t\tsession_destroy();\n\t}",
"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 avoidSessionHijacking()\n\t{\n\t\t// TODO\n\t}",
"public function logoff(){\n\t\tsession_destroy();\n\t\theader('location: ../view/login.php');\n\t\texit;\n\t}",
"public function forceLogout($id)\n {\n $rs = $this->db->query(\"Select * from Users where id = ?\", array($id)); \n if($rs->num_rows())\n { \n $row = $rs->row(); \n $token = base64_encode(implode(self::ENCRYPTION_KEY, array(md5($row->accountName), $row->passwordHash))); \n $header = array(getenv(\"APIKEY\"), \"TOKEN: \" . $token);\n $url = getenv(\"APISERVER\") . \"api/1/players/logout\";\n $ch = curl_init($url); \n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $ret = json_decode(curl_exec($ch), true);\n if($row->fbId && !isset($ret['code'])) // If facebook account, try to kill both possible tokens\n {\n $token = base64_encode(implode(self::ENCRYPTION_KEY, array(md5($row->email), md5(NULL)))); \n $header = array(getenv(\"APIKEY\"), \"TOKEN: \" . $token);\n $url = getenv(\"APISERVER\") . \"api/1/players/logout\";\n $ch = curl_init($url); \n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $ret = json_decode(curl_exec($ch), true);\n }\n return $ret;\n }\n return json_encode(array('code' => 1, 'message' => 'Logout Unsuccessful'));\n }",
"protected function handleSessionLifeTimeExpired() {}",
"protected function handleSessionLifeTimeExpired() {}",
"function log_me_out() {\n\n// remove all session variables\n\n session_unset();\n\n// destroy the Session\n session_destroy();\n}",
"function doLogout() \n { \n //echo \"UserID:\".$_SESSION['UserID'];\n // .. die Session ID aus der Datenbank gelöscht werden \n $sql = \"UPDATE \n mitglieder \n SET \n SessionID = NULL, \n Autologin = NULL\n WHERE\n ID = '\".mysql_real_escape_string(trim($_SESSION['user_id'])).\"' \n \"; \n mysql_query($sql) OR die(\"<pre>\\n\".$sql.\"</pre>\\n\".mysql_error()); \n }",
"function logout() {\n\tif (isset($_SESSION['user_id'])) {\n\t\tunset($_SESSION['user_id']);\n\t}\n}",
"public function LogOut() {\n\t\t$this->session->UnsetAuthenticatedUser();\n\t\t$this->session->AddMessage('success', \"You have been successfully logged out.\");\n\t}",
"public function logOut() {\r\n //Logs when a user exit\r\n $ctrLog = new ControllerLog();\r\n $ctrLog->logOff();\r\n\r\n header('location:../index');\r\n session_destroy();\r\n }",
"public function inactividad_logout()\n\t{\n\t\t// realizamos la peticion al modelo de cerrar sesion\n\t\t$this->auth->logout();\n\t\t// retornamos a la vista de inicio de sesion\n\t\techo \"true\";\n\t}",
"private function _logout(){\n\t\tredirect('/', 'refresh');\n\t\treturn;\n\t}",
"public function logout()\n {\n unset( $_SESSION['login'] );\n ( new Events() )->trigger( 3, true );\n }",
"public static function logout();",
"public function delog()\n\t{\n\n\t}",
"public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://m.linkedin.com/session/logout\",true);\n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}",
"function log_out_user() {\r\n if(isset($_SESSION['admin_id'])) {\r\n unset($_SESSION['admin_id']);\r\n }\r\n if(isset($_SESSION['user_id'])){\r\n unset($_SESSION['user_id']);\r\n }\r\n unset($_SESSION['last_login']);\r\n unset($_SESSION['username']);\r\n //session_destroy(); // optional: destroys the whole session\r\n return true;\r\n}",
"function submitLogOutRequest(){\n session_start();\n \t\t\t$_SESSION['loggedIn'] = NULL;\n\t\t\t$_SESSION['userID'] = NULL;\n\t\t\t$_SESSION['accessLevel'] = NULL;\n session_destroy();\n return true;\n\n}",
"public function logOff ()\r\n {\r\n unset($_SESSION['username']);\r\n unset($_SESSION['parola']);\r\n $_SESSION = array();\r\n session_destroy();\r\n }",
"public function logout() {\n\t\t//Log this connection into the users_activity table\n\t\t\\DB::table('users_activity')->insert(array(\n\t\t\t'user_id'=>$this->user->attributes[\"id\"],\n\t\t\t'type_id'=>15,\n\t\t\t'data'=>'Log out',\n\t\t\t'created_at'=>date(\"Y-m-d H:i:s\")\n\t\t));\n\t\t$this->user = null;\n\t\t$this->cookie($this->recaller(), null, -2000);\n\t\tSession::forget($this->token());\n\t\t$this->token = null;\n\t}",
"function wp_destroy_other_sessions()\n {\n }",
"public function logout(){\n session_destroy();\n $arr = array(\n 'sessionID' => ''\n );\n dibi::query('UPDATE `user` SET ', $arr, \n 'WHERE `email`=%s', $email);\n parent::redirection(\"index.php\");\n }"
] | [
"0.71865857",
"0.7186461",
"0.7185969",
"0.7050248",
"0.7033858",
"0.6855602",
"0.68308175",
"0.68216264",
"0.6801203",
"0.6768715",
"0.6603127",
"0.65940446",
"0.65900296",
"0.65101",
"0.6460797",
"0.6432696",
"0.64112425",
"0.63645446",
"0.63523585",
"0.6319613",
"0.6319116",
"0.63152146",
"0.6252956",
"0.6252341",
"0.6246766",
"0.6245421",
"0.62384427",
"0.621686",
"0.62167305",
"0.62024677",
"0.61972845",
"0.61884636",
"0.6172017",
"0.61615",
"0.61529505",
"0.61527187",
"0.6150634",
"0.61489224",
"0.6144911",
"0.6142842",
"0.61339885",
"0.61326045",
"0.613016",
"0.6127946",
"0.6127852",
"0.6114831",
"0.6112622",
"0.6102011",
"0.60970837",
"0.6095929",
"0.6095381",
"0.6092956",
"0.6088866",
"0.60873455",
"0.6074193",
"0.6069593",
"0.60665774",
"0.6065149",
"0.6064831",
"0.60610336",
"0.6059904",
"0.6051239",
"0.60284084",
"0.60233295",
"0.60182005",
"0.601546",
"0.6014422",
"0.6013893",
"0.6009994",
"0.60080135",
"0.60059816",
"0.6001037",
"0.59960985",
"0.5995285",
"0.5993558",
"0.59901005",
"0.5988483",
"0.59821624",
"0.5981807",
"0.59815294",
"0.5973553",
"0.59699565",
"0.59699565",
"0.59691197",
"0.59677297",
"0.5961875",
"0.59541607",
"0.59516555",
"0.59499705",
"0.5940542",
"0.5939107",
"0.5929342",
"0.59288025",
"0.5928135",
"0.5916428",
"0.5913362",
"0.59127843",
"0.5902467",
"0.59018165",
"0.59014064"
] | 0.6418147 | 16 |
Validation function for Zip Code | public function _validate_zipcode($zip) {
$state = $this->user->get_state_from_zip($zip);
if ($state != '') {
return true;
}
$this->form_validation->set_message('_validate_zipcode', i18n('zipcode_not_found'));
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateUSAZip($zip_code)\n\t\t\t{\n\t \t\tif(preg_match(\"/^([0-9]{5})(-[0-9]{4})?$/i\",$zip_code))\n\t \t\t\treturn true;\n\t \t\telse\n\t \t\t\t return false;\n\t\t\t}",
"function is_zip ($zipcode = \"\")\r\n \t{\r\n \t\tif(empty($zipcode))\r\n \t\t{\r\n \t\treturn false;\r\n \t\t}\r\n \r\n \t\t$Bad = preg_replace(\"/([-0-9]+)/i\",\"\",$zipcode);\r\n \t\tif(!empty($Bad))\r\n \t\t{\r\n \t\treturn false;\r\n \t\t}\r\n \t\tif (strlen($zipcode)<>10){\r\n return false;\r\n }\r\n \r\n \t\tif ($zipcode[5] <> '-') {\r\n \t\t\treturn false;\r\n \t\t}\r\n \r\n \t\t$Num = preg_replace(\"/\\-/i\",\"\",$zipcode);\r\n \t\t$len = strlen($Num);\r\n \t\tif ($len <> 9)\t{\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\treturn true;\r\n }",
"function validateZipCode($string){\n\tif($string == '') {return 'Zip code is required </br>';}\n\tif(!preg_match(\"/^[A-Za-z]\\d[A-Za-z] \\d[A-Za-z]\\d$/\", $string)){\n\t\treturn 'Zip code is invalid </br>';\n\t}\n\treturn '';\n}",
"private function checkZipCode($zipCode) {\n if (!preg_match('#[0-9]{5}#', $zipCode)){\n echo \"ERRORE nel CAP : \".$zipCode;\n \tthrow new InvalidArgumentException();\n }\n else return true;\n }",
"function give_donation_form_validate_cc_zip( $zip = 0, $country_code = '' ) {\n\t$ret = false;\n\n\tif ( empty( $zip ) || empty( $country_code ) ) {\n\t\treturn $ret;\n\t}\n\n\t$country_code = strtoupper( $country_code );\n\n\t$zip_regex = array(\n\t\t'AD' => 'AD\\d{3}',\n\t\t'AM' => '(37)?\\d{4}',\n\t\t'AR' => '^([A-Z]{1}\\d{4}[A-Z]{3}|[A-Z]{1}\\d{4}|\\d{4})$',\n\t\t'AS' => '96799',\n\t\t'AT' => '\\d{4}',\n\t\t'AU' => '^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$',\n\t\t'AX' => '22\\d{3}',\n\t\t'AZ' => '\\d{4}',\n\t\t'BA' => '\\d{5}',\n\t\t'BB' => '(BB\\d{5})?',\n\t\t'BD' => '\\d{4}',\n\t\t'BE' => '^[1-9]{1}[0-9]{3}$',\n\t\t'BG' => '\\d{4}',\n\t\t'BH' => '((1[0-2]|[2-9])\\d{2})?',\n\t\t'BM' => '[A-Z]{2}[ ]?[A-Z0-9]{2}',\n\t\t'BN' => '[A-Z]{2}[ ]?\\d{4}',\n\t\t'BR' => '\\d{5}[\\-]?\\d{3}',\n\t\t'BY' => '\\d{6}',\n\t\t'CA' => '^[ABCEGHJKLMNPRSTVXY]{1}\\d{1}[A-Z]{1} *\\d{1}[A-Z]{1}\\d{1}$',\n\t\t'CC' => '6799',\n\t\t'CH' => '^[1-9][0-9][0-9][0-9]$',\n\t\t'CK' => '\\d{4}',\n\t\t'CL' => '\\d{7}',\n\t\t'CN' => '\\d{6}',\n\t\t'CR' => '\\d{4,5}|\\d{3}-\\d{4}',\n\t\t'CS' => '\\d{5}',\n\t\t'CV' => '\\d{4}',\n\t\t'CX' => '6798',\n\t\t'CY' => '\\d{4}',\n\t\t'CZ' => '\\d{3}[ ]?\\d{2}',\n\t\t'DE' => '\\b((?:0[1-46-9]\\d{3})|(?:[1-357-9]\\d{4})|(?:[4][0-24-9]\\d{3})|(?:[6][013-9]\\d{3}))\\b',\n\t\t'DK' => '^([D-d][K-k])?( |-)?[1-9]{1}[0-9]{3}$',\n\t\t'DO' => '\\d{5}',\n\t\t'DZ' => '\\d{5}',\n\t\t'EC' => '([A-Z]\\d{4}[A-Z]|(?:[A-Z]{2})?\\d{6})?',\n\t\t'EE' => '\\d{5}',\n\t\t'EG' => '\\d{5}',\n\t\t'ES' => '^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$',\n\t\t'ET' => '\\d{4}',\n\t\t'FI' => '\\d{5}',\n\t\t'FK' => 'FIQQ 1ZZ',\n\t\t'FM' => '(9694[1-4])([ \\-]\\d{4})?',\n\t\t'FO' => '\\d{3}',\n\t\t'FR' => '^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$',\n\t\t'GE' => '\\d{4}',\n\t\t'GF' => '9[78]3\\d{2}',\n\t\t'GL' => '39\\d{2}',\n\t\t'GN' => '\\d{3}',\n\t\t'GP' => '9[78][01]\\d{2}',\n\t\t'GR' => '\\d{3}[ ]?\\d{2}',\n\t\t'GS' => 'SIQQ 1ZZ',\n\t\t'GT' => '\\d{5}',\n\t\t'GU' => '969[123]\\d([ \\-]\\d{4})?',\n\t\t'GW' => '\\d{4}',\n\t\t'HM' => '\\d{4}',\n\t\t'HN' => '(?:\\d{5})?',\n\t\t'HR' => '\\d{5}',\n\t\t'HT' => '\\d{4}',\n\t\t'HU' => '\\d{4}',\n\t\t'ID' => '\\d{5}',\n\t\t'IE' => '((D|DUBLIN)?([1-9]|6[wW]|1[0-8]|2[024]))?',\n\t\t'IL' => '\\d{5}',\n\t\t'IN' => '^[1-9][0-9][0-9][0-9][0-9][0-9]$', // India.\n\t\t'IO' => 'BBND 1ZZ',\n\t\t'IQ' => '\\d{5}',\n\t\t'IS' => '\\d{3}',\n\t\t'IT' => '^(V-|I-)?[0-9]{5}$',\n\t\t'JO' => '\\d{5}',\n\t\t'JP' => '\\d{3}-\\d{4}',\n\t\t'KE' => '\\d{5}',\n\t\t'KG' => '\\d{6}',\n\t\t'KH' => '\\d{5}',\n\t\t'KR' => '\\d{3}[\\-]\\d{3}',\n\t\t'KW' => '\\d{5}',\n\t\t'KZ' => '\\d{6}',\n\t\t'LA' => '\\d{5}',\n\t\t'LB' => '(\\d{4}([ ]?\\d{4})?)?',\n\t\t'LI' => '(948[5-9])|(949[0-7])',\n\t\t'LK' => '\\d{5}',\n\t\t'LR' => '\\d{4}',\n\t\t'LS' => '\\d{3}',\n\t\t'LT' => '\\d{5}',\n\t\t'LU' => '\\d{4}',\n\t\t'LV' => '\\d{4}',\n\t\t'MA' => '\\d{5}',\n\t\t'MC' => '980\\d{2}',\n\t\t'MD' => '\\d{4}',\n\t\t'ME' => '8\\d{4}',\n\t\t'MG' => '\\d{3}',\n\t\t'MH' => '969[67]\\d([ \\-]\\d{4})?',\n\t\t'MK' => '\\d{4}',\n\t\t'MN' => '\\d{6}',\n\t\t'MP' => '9695[012]([ \\-]\\d{4})?',\n\t\t'MQ' => '9[78]2\\d{2}',\n\t\t'MT' => '[A-Z]{3}[ ]?\\d{2,4}',\n\t\t'MU' => '(\\d{3}[A-Z]{2}\\d{3})?',\n\t\t'MV' => '\\d{5}',\n\t\t'MX' => '\\d{5}',\n\t\t'MY' => '\\d{5}',\n\t\t'NC' => '988\\d{2}',\n\t\t'NE' => '\\d{4}',\n\t\t'NF' => '2899',\n\t\t'NG' => '(\\d{6})?',\n\t\t'NI' => '((\\d{4}-)?\\d{3}-\\d{3}(-\\d{1})?)?',\n\t\t'NL' => '^[1-9][0-9]{3}\\s?([a-zA-Z]{2})?$',\n\t\t'NO' => '\\d{4}',\n\t\t'NP' => '\\d{5}',\n\t\t'NZ' => '\\d{4}',\n\t\t'OM' => '(PC )?\\d{3}',\n\t\t'PF' => '987\\d{2}',\n\t\t'PG' => '\\d{3}',\n\t\t'PH' => '\\d{4}',\n\t\t'PK' => '\\d{5}',\n\t\t'PL' => '\\d{2}-\\d{3}',\n\t\t'PM' => '9[78]5\\d{2}',\n\t\t'PN' => 'PCRN 1ZZ',\n\t\t'PR' => '00[679]\\d{2}([ \\-]\\d{4})?',\n\t\t'PT' => '\\d{4}([\\-]\\d{3})?',\n\t\t'PW' => '96940',\n\t\t'PY' => '\\d{4}',\n\t\t'RE' => '9[78]4\\d{2}',\n\t\t'RO' => '\\d{6}',\n\t\t'RS' => '\\d{5}',\n\t\t'RU' => '\\d{6}',\n\t\t'SA' => '\\d{5}',\n\t\t'SE' => '^(s-|S-){0,1}[0-9]{3}\\s?[0-9]{2}$',\n\t\t'SG' => '\\d{6}',\n\t\t'SH' => '(ASCN|STHL) 1ZZ',\n\t\t'SI' => '\\d{4}',\n\t\t'SJ' => '\\d{4}',\n\t\t'SK' => '\\d{3}[ ]?\\d{2}',\n\t\t'SM' => '4789\\d',\n\t\t'SN' => '\\d{5}',\n\t\t'SO' => '\\d{5}',\n\t\t'SZ' => '[HLMS]\\d{3}',\n\t\t'TC' => 'TKCA 1ZZ',\n\t\t'TH' => '\\d{5}',\n\t\t'TJ' => '\\d{6}',\n\t\t'TM' => '\\d{6}',\n\t\t'TN' => '\\d{4}',\n\t\t'TR' => '\\d{5}',\n\t\t'TW' => '\\d{3}(\\d{2})?',\n\t\t'UA' => '\\d{5}',\n\t\t'UK' => '^(GIR|[A-Z]\\d[A-Z\\d]??|[A-Z]{2}\\d[A-Z\\d]??)[ ]??(\\d[A-Z]{2})$',\n\t\t'US' => '^\\d{5}([\\-]?\\d{4})?$',\n\t\t'UY' => '\\d{5}',\n\t\t'UZ' => '\\d{6}',\n\t\t'VA' => '00120',\n\t\t'VE' => '\\d{4}',\n\t\t'VI' => '008(([0-4]\\d)|(5[01]))([ \\-]\\d{4})?',\n\t\t'WF' => '986\\d{2}',\n\t\t'YT' => '976\\d{2}',\n\t\t'YU' => '\\d{5}',\n\t\t'ZA' => '\\d{4}',\n\t\t'ZM' => '\\d{5}',\n\t);\n\n\tif ( ! isset( $zip_regex[ $country_code ] ) || preg_match( '/' . $zip_regex[ $country_code ] . '/i', $zip ) ) {\n\t\t$ret = true;\n\t}\n\n\treturn apply_filters( 'give_is_zip_valid', $ret, $zip, $country_code );\n}",
"public static function check_zip_code($zip_code) {\n\t\tif(preg_match(\"/^([0-9]{5})(-[0-9]{4})?$/i\",$zip_code)) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n \t\treturn false;\n\t\t}\n\t}",
"public function validateZipCode(Request $request) {\n $client = new Client([\n 'timeout' => 15,\n ]);\n $_response = $client->get(\"http://www.geonames.org/postalCodeLookupJSON\", [\n 'query' => array(\n 'country' => 'US',\n 'callback' => '',\n 'postalcode' => $request->get('zip_code'),\n ),\n ]);\n $bodyObj = $_response->getBody();\n $response = (string)$bodyObj;\n $response = substr($response, 1, strlen($response) - 3);\n return response($response);\n }",
"function zipCode($value) {\n\t$reg = \"/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/\";\n\treturn preg_match($reg,$value);\n}",
"public function testValidPostalCode()\n {\n $request = ['postal_code' => '1000 AP'];\n $rules = ['postal_code' => 'postal_code:NL'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertFalse($validator->fails());\n }",
"abstract public function postalCode();",
"function isPostcodeValid($postcode)\n{\n //remove all whitespace\n $postcode = preg_replace('/\\s/', '', $postcode);\n \n //make uppercase\n $postcode = strtoupper($postcode);\n \n if(preg_match(\"/^[A-Z]{1,2}[0-9]{2,3}[A-Z]{2}$/\",$postcode)\n || preg_match(\"/^[A-Z]{1,2}[0-9]{1}[A-Z]{1}[0-9]{1}[A-Z]{2}$/\",$postcode)\n || preg_match(\"/^GIR0[A-Z]{2}$/\",$postcode))\n {\n return true;\n }\n else {\n return false;\n }\n}",
"function estUnCp($codePostal)\n{\n return strlen($codePostal)== 5 && estEntier($codePostal);\n}",
"function checkAddress($address = null, $state = null, $city = null, $zip = null) {\n $this->autoRender = false;\n if (isset($_POST)) {\n $zipCode = ltrim($zip, \" \");\n $stateName = $state;\n $cityName = strtolower($city);\n $cityName = ucwords($cityName);\n $dlocation = $address . \" \" . $cityName . \" \" . $stateName . \" \" . $zipCode;\n $adjuster_address2 = str_replace(' ', '+', $dlocation);\n $geocode = file_get_contents('https://maps.google.com/maps/api/geocode/json?key='.GOOGLE_GEOMAP_API_KEY.'&address=' . $adjuster_address2 . '&sensor=false');\n $output = json_decode($geocode);\n if ($output->status == \"ZERO_RESULTS\" || $output->status != \"OK\") {\n echo 2;\n die; // Bad Address\n } else {\n $latitude = @$output->results[0]->geometry->location->lat;\n $longitude = @$output->results[0]->geometry->location->lng;\n $formated_address = @$output->results[0]->formatted_address;\n if ($latitude) {\n echo 1;\n die; // Good Address\n }\n }\n }\n }",
"public function testPostal()\n {\n $this->assertTrue(RuValidation::postal('101135'));\n $this->assertTrue(RuValidation::postal('693000'));\n\n $this->assertFalse(RuValidation::postal('100123'));\n $this->assertFalse(RuValidation::postal('200321'));\n }",
"function validateCountryPostalCode($postalCode, $tbsCountriesCode){\r\n\t\t// build filter\r\n\t\t$filters = array(\r\n\t\t\tarray(\r\n\t\t\t\t\t\"field\" => 'NumericCode',\r\n\t\t\t\t\t\"filter\" => 'Equal',\r\n\t\t\t\t\t\"value\" => $tbsCountriesCode\r\n\t\t\t\t)\r\n\t\t);\r\n\t\t// call resource\r\n\t\t$tbsResult = $this->getResource('countries', null, 'All', $filters);\r\n\t\t// appply the regex \r\n\t\tif(preg_match('/' . $tbsResult[0]->ZipcodeRegex . '/', $postalCode) === 1 || $tbsResult[0]->ZipcodeRegex == null) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function validateZip($attribute, $value, $parameters) {\n return preg_match('/^[0-9]{5}(\\-[0-9]{4})?$/', $value);\n }",
"public function boot()\n {\n \\Validator::extend('zip_validate', function($attribute, $value, $parameters, $validator) {\n if(isset($parameters[0])){\n $country = $parameters[0];\n }else{\n $country = \"1\"; //$country = \"Finland\";\n }\n\n $zipCodes=array(\n \"US\"=>\"^\\d{5}([\\-]?\\d{4})?$\",\n \"UK\"=>\"^(GIR|[A-Z]\\d[A-Z\\d]??|[A-Z]{2}\\d[A-Z\\d]??)[ ]??(\\d[A-Z]{2})$\",\n \"DE\"=>\"\\b((?:0[1-46-9]\\d{3})|(?:[1-357-9]\\d{4})|(?:[4][0-24-9]\\d{3})|(?:[6][013-9]\\d{3}))\\b\",\n \"CA\"=>\"^([ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ])\\ {0,1}(\\d[ABCEGHJKLMNPRSTVWXYZ]\\d)$\",\n \"FR\"=>\"^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$\",\n \"IT\"=>\"^(V-|I-)?[0-9]{5}$\",\n \"AU\"=>\"^(0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2})$\",\n \"NL\"=>\"^[1-9][0-9]{3}\\s?([a-zA-Z]{2})?$\",\n \"ES\"=>\"^([1-9]{2}|[0-9][1-9]|[1-9][0-9])[0-9]{3}$\",\n \"DK\"=>\"^([D-d][K-k])?( |-)?[1-9]{1}[0-9]{3}$\",\n \"SE\"=>\"^(s-|S-){0,1}[0-9]{3}\\s?[0-9]{2}$\",\n \"BE\"=>\"^[1-9]{1}[0-9]{3}$\",\n \"1\"=>\"^(?:FI)*(\\d{5})$\", // Finland\n \"2\"=> \"^(?:SE)*(\\d{5})$\" // Sweden\n );\n\n if ($zipCodes[$country]) {\n\n if (!preg_match(\"/\".$zipCodes[$country].\"/i\",$value)){\n return false;\n\n } else {\n return true;\n }\n\n } else {\n\n //Validation not available\n\n }\n });\n\n\n /**\n * This is use for check is valid url\n */\n \\Validator::extend('url_validate', function($attribute, $value, $parameters, $validator) {\n\n if(!empty($value)){\n\n if(filter_var($value,FILTER_VALIDATE_URL)){\n return true;\n } else {\n return false;\n }\n } else {\n if(!empty($parameters[0]) && $parameters[0] == \"Link\"){\n return false;\n } else{\n return true;\n }\n }\n });\n\n\n /**\n *\n */\n \\Validator::extend('content_update', function($attribute, $value, $parameters, $validator) {\n\n if(!empty($parameters[0]) && $parameters[0] != \"Link\"){\n if(!empty($parameters[1])){\n return true;\n } else {\n return false;\n }\n } else{\n return true;\n }\n\n });\n\n\n Schema::defaultStringLength(191);\n }",
"public function isValidAddress($address);",
"function postalCode($postcode)\n {\n return (bool)preg_match('/^(H-)?\\d{4}$/', $postcode);\n }",
"public function validZIP($ZIP)\r\n\t{\r\n\t\treturn DB::table('zip_codes')->where('zip_code', $ZIP)->exists();\r\n\t}",
"public function testPostal()\n {\n $this->assertFalse(BrValidation::postal('111'));\n $this->assertFalse(BrValidation::postal('1111'));\n $this->assertFalse(BrValidation::postal('1234-123'));\n $this->assertFalse(BrValidation::postal('12345-12'));\n\n $this->assertTrue(BrValidation::postal('88000-123'));\n $this->assertTrue(BrValidation::postal('01234-123'));\n $this->assertTrue(BrValidation::postal('01234123'));\n }",
"function checkPostcode(&$toCheck) {\n\t$alpha1 = \"[abcdefghijklmnoprstuwyz]\"; // Character 1\n\t$alpha2 = \"[abcdefghklmnopqrstuvwxy]\"; // Character 2\n\t$alpha3 = \"[abcdefghjkpmnrstuvwxy]\"; // Character 3\n\t$alpha4 = \"[abehmnprvwxy]\"; // Character 4\n\t$alpha5 = \"[abdefghjlnpqrstuwxyz]\"; // Character 5\n\t// Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA with a space\n\t$pcexp[0] = '/^(' . $alpha1 . '{1}' . $alpha2 . '{0,1}[0-9]{1,2})([[:space:]]{0,})([0-9]{1}' . $alpha5 . '{2})$/';\n\n\t// Expression for postcodes: ANA NAA\n\t$pcexp[1] = '/^(' . $alpha1 . '{1}[0-9]{1}' . $alpha3 . '{1})([[:space:]]{0,})([0-9]{1}' . $alpha5 . '{2})$/';\n\n\t// Expression for postcodes: AANA NAA\n\t$pcexp[2] = '/^(' . $alpha1 . '{1}' . $alpha2 . '{1}[0-9]{1}' . $alpha4 . ')([[:space:]]{0,})([0-9]{1}' . $alpha5 . '{2})$/';\n\n\t// Exception for the special postcode GIR 0AA\n\t$pcexp[3] = '/^(gir)(0aa)$/';\n\n\t// Standard BFPO numbers\n\t$pcexp[4] = '/^(bfpo)([0-9]{1,4})$/';\n\n\t// c/o BFPO numbers\n\t$pcexp[5] = '/^(bfpo)(c\\/o[0-9]{1,3})$/';\n\n\t// Overseas Territories\n\t$pcexp[6] = '/^([a-z]{4})(1zz)$/';\n\n\t// Load up the string to check, converting into lowercase\n\t$postcode = strtolower($toCheck);\n\n\t// Assume we are not going to find a valid postcode\n\t$valid = false;\n\n\t// Check the string against the six types of postcodes\n\tforeach ($pcexp as $regexp) {\n\t\tif (preg_match($regexp, $postcode, $matches)) {\n\n\t\t\t// Load new postcode back into the form element\n\t\t\t$postcode = strtoupper($matches[1] . ' ' . $matches [3]);\n\n\t\t\t// Take account of the special BFPO c/o format\n\t\t\t$postcode = str_replace('C\\/O', 'c/o ', $postcode);\n\n\t\t\t// Remember that we have found that the code is valid and break from loop\n\t\t\t$valid = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return with the reformatted valid postcode in uppercase if the postcode was\n\t// valid\n\tif ($valid) {\n\t\t$toCheck = $postcode;\n\t\t$data['post_code'] = $postcode;\n\t\t$_POST['post_code'] = $postcode;\n\t\treturn true;\n\t} else\n\t\treturn false;\n}",
"function validatePostcode(&$errors, $field_list, $field_name)\n{\n\t$PostcodePat = '/^[0-9]{4}$/'; //postcode regex\n\tif (!isset($field_list[$field_name])|| empty($field_list[$field_name])) //checks if empty\n\t\t$errors[$field_name] = ' Required';\n\telse if (!preg_match($PostcodePat, $field_list[$field_name])) //checks if matches the given regex\n\t\t$errors[$field_name] = ' Invalid';\n}",
"static public function isZipCodeFormat($zip_code)\n {\n if (!empty($zip_code))\n return preg_match('/^[NLCnlc -]+$/', $zip_code);\n return true;\n }",
"public function testInvalidPostalCode()\n {\n $request = ['postal_code' => 'Some arbitrary string'];\n $rules = ['postal_code' => 'postal_code:BE'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertTrue($validator->fails());\n }",
"function isAddress($input)\n{\n $pattern = \"/^[a-zA-Z0-9]{33,34}$/\";\n return preg_match($pattern, $input);\n}",
"static function checkAddress($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d,][\\W\\w\\d\\s,]{1,40}$/', $input)) {\r\n return true; //Illegal Character found!\r\n }\r\n else{\r\n echo PageBuilder::printError(\"Please enter alphabets and numbers with comma seperation, maximum of 40 characters.\");\r\n return false;\r\n }\r\n }",
"function isZipInCity($zip){\r\n\t\t$filters = array(\r\n\t\t\tarray(\r\n\t\t\t\t\t\"field\" => 'Zip',\r\n\t\t\t\t\t\"filter\" => 'Equal',\r\n\t\t\t\t\t\"value\" => $zip\r\n\t\t\t\t)\r\n\t\t);\r\n\t\t$tbsResult = $this->getResource('lkzipcodes', null, 'All', $filters);\r\n\t\t$count = count($tbsResult);\r\n\t\t\tif($count > 1){\r\n\t\t\t\tforeach ($tbsResult as $zipCodeRecord) {\r\n\t\t\t\t\tif($zipCodeRecord->DEFAULT == \"Y\") {\r\n\t\t\t\t\t\t$inCity = $zipCodeRecord->INOUTCITY;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t} elseif ($count == 1){\r\n\t\t\t\t$inCity = $tbsResult[0]->INOUTCITY;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\tswitch($inCity){\r\n\t\t\tcase \"I\":\r\n\t\t\t// in city\r\n\t\t\treturn true;\r\n\r\n\t\t\tcase \"O\":\r\n\t\t\t// out of city\r\n\t\t\treturn false;\r\n\r\n\t\t\tcase \"B\":\r\n\t\t\t// both\r\n\t\t\treturn true;\r\n\r\n\t\t\tcase null:\r\n\t\t\t// not set\r\n\t\t\treturn false;\r\n\r\n\t\t\tdefault :\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }",
"public static function _postalcode($value, $field) {\n\t\t$regex = '/^[A-Za-z][0-9][A-Za-z] ?[0-9][A-Za-z][0-9]$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"private function setPostalCode()\n {\n \tif ( ! isset( $_POST['postal_code'] ) ) {\n \t\t$this->data['error']['postal_code'] = 'Please provide your postal or zip code.';\n $this->error = true;\n return;\n }\n \n $pc = trim( $_POST['postal_code'] );\n\t\n \n // Make sure the country is set\n if ( ! isset( $this->data['country'] ) ) {\n $pc_obj = new PostalCode( $pc );\n if ( $pc_obj->isValid() ) {\n $this->data['postal_code'] = $pc_obj->get();\n return;\n }\n \n $zip_obj = new ZipCode( $pc );\n if ( $zip_obj->isValid() ) {\n $this->data['postal_code'] = $zip_obj->get();\n return;\n }\n }\n \n if ( $this->data['country'] == 'CA' ) {\n $pc_obj = new PostalCode( $pc );\n if ( ! $pc_obj->isValid() ) {\n\t\t\t\t$this->data['error']['postal_code'] = 'Please provide a valid postal code.';\n $this->error = true;\n return;\n }\n $this->data['postal_code'] = $pc_obj->get();\n }\n elseif ( $this->data['country'] == 'US' ) {\n $zip_obj = new ZipCode( $pc );\n if ( ! $zip_obj->isValid() ) {\n\t\t\t\t$this->data['error']['postal_code'] = 'Please provide a valid zip code.';\n $this->error = true;\n return;\n }\n $this->data['postal_code'] = $zip_obj->get();\n }\n }",
"public static function isZipCodeFormat($zip_code)\n {\n if (!empty($zip_code))\n return preg_match('/^[NLCnlc 0-9-]+$/', $zip_code);\n return true;\n }",
"public static function validate_zip( $field_names ) {\n\t\tif ( is_array( $field_names ) ) {\n\t\t\tforeach ( $field_names as $field )\n\t\t\t\tself::validate_zip( $field );\n\n\t\t\treturn; // We're done with this method at this point\n\t\t}\n\t\t\n\t\t// Don't try to validate blank data (this allows optional fields to be validated only if they've been filled out)\n\t\tif ( $_POST[$field_names] === '' )\n\t\t\treturn;\n\t\t\n\t\t// Check if the formatting is valid\n\t\tif ( ! preg_match( '/^\\d{5}(-\\d{4})?$/', $_POST[$field_names] ) && ! self::is_invalid( $field_names ) )\n\t\t\tself::log_error( $field_names, ERROR_ZIP_FORMAT );\n\t}",
"function validateLatitude($lat) {\n return preg_match('/^(\\+|-)?(?:90(?:(?:\\.0{1,8})?)|(?:[0-9]|[1-8][0-9])(?:(?:\\.[0-9]{1,8})?))$/', $lat);\n }",
"function isSchoolYearinvalid($str = null){\n if ($str) {\n $year1 =substr($str,0 ,4);\n $year2 =substr($str,5 ,4);\n if ((strlen($str)==9) && ($str[4])==\"-\" && is_numeric($year1) && is_numeric($year2)){\n echo \"is valid<br>\";\n return false;\n }else\n echo \"invalid<br>\";\n return true;\n }\n}",
"public function testInvalidCountryCode()\n {\n $exception = null;\n $request = ['postal_code' => '75008'];\n $rules = ['postal_code' => 'postal_code:FOO'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertTrue($validator->fails());\n }",
"public function isAddressValid()\n {\n //TODO: consider does it make sense to have a special validation by country? how does the app handle different country addresses ?\n $addressValid = trim($this->Streetname1) != '' && trim($this->PostalCode) != '' && trim($this->City) != '' && trim($this->Country) != '' ;\n\n if (!$addressValid) {\n $this->errors[] = 'Invalid Shipping Address';\n }\n\n return $addressValid;\n }",
"function validate_phone($phone)\n{\n $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n if (strlen($filtered_phone_number) != 12) {\n return false;\n } else {\n return true;\n }\n}",
"private function validate_address_2($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_alphanum($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 1; /* field empty */\n\t\t}\n\t}",
"public function getZipCode()\n {\n return parent::getValue('zip_code');\n }",
"public function validate_address( $address ) {\n\t\t// @codingStandardsIgnoreStart\n\t\treturn strlen( $address ) == 35\n\t\t\t&& ( $address[0] == 'D' || $address[0] == 'T' )\n\t\t\t&& $address[1] == 's';\n\t\t// @codingStandardsIgnoreEnd\n\t}",
"function validateLatitude($lat) {\n return preg_match('/^(\\+|-)?(?:90(?:(?:\\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\\.[0-9]{1,6})?))$/', $lat);\n }",
"public function validateAddress() {\r\n $leng = mb_strlen($this->data[$this->name]['Address']);\r\n if ($leng > 256) {\r\n return FALSE;\r\n } else if ($leng > 128) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['Address']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }",
"protected function _check_zip($zip_code) {\n\n $selectZipQry = \"select zipcode from zipcodes where zipcode = '\" . $zip_code . \"'\";\n $selectZipRes = mysql_query($selectZipQry, $this->db->conn);\n if (mysql_num_rows($selectZipRes) > 0)\n return true;\n else\n return false;\n }",
"function edd_stripe_require_zip_and_country( $fields ) {\n\n\t$fields['card_zip'] = array(\n\t\t'error_id' => 'invalid_zip_code',\n\t\t'error_message' => __( 'Please enter your zip / postal code', 'edds' )\n\t);\n\n\t$fields['billing_country'] = array(\n\t\t'error_id' => 'invalid_country',\n\t\t'error_message' => __( 'Please select your billing country', 'edds' )\n\t);\n\n\treturn $fields;\n}",
"public function test_postal_code_validation()\n {\n /*\n * Valid\n */\n $validPostalCodeLocation = Location::factory()->make([\n 'postalCode' => 'A9 9AA',\n ]);\n $validPostalCodeData = $validPostalCodeLocation->toArray();\n $this->post($this->route(), $validPostalCodeData)->assertStatus(201);\n\n /*\n * Invalid: missing\n */\n $missingPostalCodeLocation = Location::factory()->make();\n $missingPostalCodeData = $missingPostalCodeLocation->toArray();\n unset($missingPostalCodeData['postalCode']);\n\n $response = $this->post($this->route(), $missingPostalCodeData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.postalCode', 'The postal code field is required.');\n\n /**\n * Invalid: not a string\n */\n $nonStringLocation = Location::factory()->make([\n 'postalCode' => ['invalid'],\n ]);\n $nonStringData = $nonStringLocation->toArray();\n\n $response = $this->post($this->route(), $nonStringData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.postalCode', 'The postal code must be a string.');\n\n /**\n * Invalid: No space\n */\n $noSpaceLocation = Location::factory()->make([\n 'postalCode' => 'A99AA',\n ]);\n $noSpaceData = $noSpaceLocation->toArray();\n\n $response = $this->post($this->route(), $noSpaceData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.postalCode', 'The postal code format is invalid.');\n\n /**\n * Invalid: Too many outcode characters\n */\n $outcodeSurplusLocation = Location::factory()->make([\n 'postalCode' => 'AA999 9AA',\n ]);\n $outcodeSurplusData = $outcodeSurplusLocation->toArray();\n\n $response = $this->post($this->route(), $outcodeSurplusData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.postalCode', 'The postal code format is invalid.');\n\n /**\n * Invalid: Too many incode characters\n */\n $incodeSurplusLocation = Location::factory()->make([\n 'postalCode' => 'AA99 9AAA',\n ]);\n $incodeSurplusData = $incodeSurplusLocation->toArray();\n\n $response = $this->post($this->route(), $incodeSurplusData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.postalCode', 'The postal code format is invalid.');\n }",
"public function getPostalcode();",
"public function testValidGetByZip() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/?\\'zip\\'=\\'' . $this->VALID_ZIP . '\\'', [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations just checking (enough to make sure the right thing was obtained)\n\t\t//0th entry is the organization for the volunteers, so need to check against the 1st\n\t\t$this->assertSame($retrievedOrg->data[1]->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data[1]->orgZip, $this->VALID_ZIP);\n\n\t}",
"public function getReqZipcode()\n\t{\n\t\treturn $this->req_zipcode;\n\t}",
"public function validateDeliveryAddress($street = '', $postcode = \"\", $city = \"\")\n {\n return $this->apiClient->doCall(\n \"get\",\n \"address?\" . http_build_query(\n array(\n 'street' => $street,\n 'postcode' => $postcode,\n 'city' => $city,\n )\n )\n );\n }",
"public function getPostalCode();",
"public function getPostalCode();",
"public function verifyAndSetAddress($a,$bRequired) {\n\t\tif ($a['country'] != 'USA')\n\t\t\tthrow new exception(\"internation addresses not supported yet\");\n\t\t$this->country='USA';\t\t\n\t\t$this->line1 = isset($a['line1']) ? $a['line1'] : ''; \t\n\t\t$this->line2 = isset($a['line2']) ? $a['line2'] : ''; \t\n\t\t$this->city = isset($a['city']) ? $a['city'] : ''; \t\n\t\t$this->state = isset($a['state2']) ? $a['state2'] : ''; \t\n\t\t$this->zip = isset($a['zip']) ? $a['zip'] : ''; \t\n\t\t\t\n\t\tif ($this->line1 == '' && $this->line2 == '') {\n\t\t\tif ($bRequired || $this->city != '' || $this->zip != '')\n\t\t\t\treturn (array('*line1'=>'You must provide an address'));\n\t\t\telse {\n\t\t\t\t$this->city=$this->state=$this->zip='';\n\t\t\t\treturn True;\t\t// OK -- just no address\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$retval=array();\n\t\tif ($this->city == '')\n\t\t\t$retval['*city']='You must provide a city';\n\t\tif ($this->zip == '')\n\t\t\t$retval['*zip']='You must provide a ZIP code';\n\t\telse {\n\t\t\t$nmatches=preg_match('/^[\\\\d]{5}(-[\\\\d]{4})??$/',$this->zip);\n\t\t\tif (0 == $nmatches)\n\t\t\t\t$retval['*zip']=\"Invalid ZIP code\";\n\t\t}\t\n\t\treturn (sizeof($retval) != 0) ? $retval : True;\n\t}",
"function hasValidAddress()\n{\n return isset($_POST[\"address\"]) && isAddress($_POST[\"address\"]);\n}",
"public function testEmptyPostalCode()\n {\n $request = ['postal_code' => null];\n $rules = ['postal_code' => 'postal_code:RU'];\n $validator = $this->factory->make($request, $rules);\n\n if (version_compare($this->app->version(), '5.3.0', '<')) {\n # Before Laravel 5.3 nullable was the implicit default\n # See: https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0\n $this->markTestSkipped('Laravel won\\'t run the validation code in this instance');\n }\n\n $this->assertTrue($validator->fails());\n }",
"function checkAddress(){\n $country = $_POST[\"country\"];\n $city = $_POST[\"city\"];\n $street = $_POST[\"street\"];\n $number = $_POST[\"number\"];\n if(empty($country) || empty($city) || empty($street) || empty($number)){\n return false; \n }\n return true; \n }",
"private function validate_country($value)\n \t{\n \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_int_range($value, 1, 197);\n\t\t\t//echo \"p_field_valid: \" . $p_field_valid . \"<br>\";\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}",
"function isnumincorrect($str = null){\n if ($str) {\n if (strlen($str)==13) \n if (($str[0]==\"+\") && ($str[1]==6) && ($str[2]==3) && ($str[3]==9)){\n echo \"is valid<br>\";\n return false;\n }else{\n echo \"input is Incorrect Number or Incorrect Format<br>\";\n return true;\n }else{\n echo \"input is Incorrect format<br>\";\n return true;\n }\n }\n}",
"public function cityname_validation($city) {\n $this->form_validation->set_message('cityname_validation', 'The %s field is not valid City or Destination Code');\n\n preg_match_all('/\\(([A-Za-z0-9 ]+?)\\)/', $city, $out);\n $cityCode = $out[1];\n\n if (!empty($cityCode))\n return TRUE;\n else\n return FALSE;\n }",
"protected function validateEmailZip($args) {\n\n if ($args['ent_email'] == '' || $args['ent_user_type'] == '')//$args['zip_code'] == '' || \n return $this->_getStatusMessage(1, 1);\n\n\n if ($args['ent_user_type'] == '1')\n $verifyEmail = $this->_verifyEmail($args['ent_email'], 'mas_id', 'master'); //_verifyEmail($email,$field,$table);\n else\n $verifyEmail = $this->_verifyEmail($args['ent_email'], 'slave_id', 'slave'); //_verifyEmail($email,$field,$table);\n\n if (is_array($verifyEmail))\n $email = array('errFlag' => 1);\n else\n $email = array('errFlag' => 0);\n\n\n// $vmail = new verifyEmail();\n//\n// if ($vmail->check($args['ent_email'])) {\n// $email = $this->_getStatusMessage(34, $args['ent_email']);\n// } else if ($vmail->isValid($args['ent_email'])) {\n// $email = $this->_getStatusMessage(24, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n// //echo 'email valid, but not exist!';\n// } else {\n// $email = $this->_getStatusMessage(25, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n// //echo 'email not valid and not exist!';\n// }\n// $selectZipQry = \"select zipcode from zipcodes where zipcode = '\" . $args['zip_code'] . \"'\";\n// $selectZipRes = mysql_query($selectZipQry, $this->db->conn);\n// if (mysql_num_rows($selectZipRes) > 0)\n $zip = array('errFlag' => 0);\n// else\n// $zip = array('errFlag' => 1);\n\n\n if ($email['errFlag'] == 0 && $zip['errFlag'] == 0)\n return $this->_getStatusMessage(47, $verifyEmail);\n else if ($email['errFlag'] == 1 && $zip['errFlag'] == 1)\n return $this->_getStatusMessage(46, $verifyEmail);\n else if ($email['errFlag'] == 0 && $zip['errFlag'] == 1)\n return $this->_getStatusMessage(46, $verifyEmail);\n else if ($email['errFlag'] == 1 && $zip['errFlag'] == 0)\n return $this->_getStatusMessage(2, $verifyEmail);\n }",
"public function setUserZip($newUserZip){\n //clear out white space\n $newUserZip = trim($newUserZip);\n \n \n //allows null\n if($newUserZip === null){\n $this->userZip = null;\n return;\n }\n \n //validates value is Integer\n if(filter_var($newUserZip, FILTER_VALIDATE_INT) === false){\n throw(new UnexpectedValueException(\"The Zip Code you entered is Invalid\"));\n }\n \n //sets value\n $this->userZip = $newUserZip;\n }",
"public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }",
"public function setZipCode($zip_code): void\n {\n $trimmedZip = preg_replace('/\\s/', '', $zip_code);\n if( strlen($trimmedZip) > 6 )\n {\n throw new InvalidArgumentException(\"Attempted to set zip code to a string longer than the limit of 6 characters [$trimmedZip]\");\n }\n $this->_zipCode = $trimmedZip;\n }",
"public function validate()\n {\n if ($this->addressA->getCountryCode() !== $this->addressB->getCountryCode()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getZip() !== $this->addressB->getZip()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getCity() !== $this->addressB->getCity()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getStreet() !== $this->addressB->getStreet()) {\n $this->invalidate();\n return false;\n }\n\n if ($this->addressA->getAddressAdditional() !== $this->addressB->getAddressAdditional()) {\n $this->invalidate();\n return false;\n }\n\n return true;\n }",
"function checkIfAddress2_Meditech($addressToCheck){\r\n\t\t\t$aSplit = explode(\",\", $addressToCheck); //city\r\n\t\t\t$bSplit = explode(\" \", trim($aSplit[1])); //state, zip\r\n\r\n\t\t\tswitch($this->clientId){\r\n\t\t\t\tcase \"Y3373\":\r\n\t\t\t\t\tif(strstr($addressToCheck,\",\")){ //if it contains a comma then it could be the second address line\r\n\t\t\t\t\t\t//if(strstr($bSplit[1], \"-\")){ $bSplit[2] = substr($bSplit[2],0,5); } //if the zip has a hyphen, strip it and use the first 5\r\n\t\t\t\t\t\tif(strstr($bSplit[1], \"-\")){ $bSplit[1] = substr($bSplit[1],0,5); } //if the zip has a hyphen, strip it and use the first 5\r\n\r\n\t\t\t\t\t\tif( strlen($bSplit[0])==2 && ( strlen($bSplit[1])==5 && is_numeric($bSplit[1]) || strlen($bSplit[2])==5 && is_numeric($bSplit[2]) ) ){ //this had to be expanded because they have a varying format for the poe which sometimes contains another space inbetween the state and zip\r\n\t\t\t\t\t\t\t$city = $aSplit[0];\r\n\t\t\t\t\t\t\t$state = $bSplit[0];\r\n\t\t\t\t\t\t\tif(strlen($bSplit[1])==5){ //we don't have the extra space\r\n\t\t\t\t\t\t\t\t$zip = $bSplit[1];\r\n\t\t\t\t\t\t\t}elseif(strlen($bSplit[2])==5){ //we do have the extra space\r\n\t\t\t\t\t\t\t\t$zip = $bSplit[2];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$rArray = array('cityStateZip'=>true, 'city'=>$city, 'state'=>$state, 'zip'=>$zip, 'address2'=>'');\r\n\t\t\t\t\t\t\treturn $rArray;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$rArray = array('cityStateZip'=>false, 'city'=>'', 'state'=>'', 'zip'=>'', 'address2'=>$addressToCheck);\r\n\t\t\t\t\t\t\treturn $rArray;\r\n\t\t\t\t\t\t} //end inner if\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$rArray = array('error'=>true, 'cityStateZip'=>'', 'city'=>'', 'state'=>'', 'zip'=>'', 'address2'=>'');\r\n\t\t\t\t\t\treturn $rArray;\r\n\t\t\t\t\t} //end outer if\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(strstr($addressToCheck,\",\")){ //if it contains a comma then it could be the second address line\r\n\t\t\t\t\t\tif(strstr($bSplit[2], \"-\")){ $bSplit[2] = substr($bSplit[2],0,5); } //if the zip has a hyphen, strip it and use the first 5\r\n\t\t\t\t\t\tif( strlen($bSplit[0])==2 && strlen($bSplit[2])==5 && is_numeric($bSplit[2]) ){\r\n\t\t\t\t\t\t\t$city = $aSplit[0];\r\n\t\t\t\t\t\t\t$state = $bSplit[0];\r\n\t\t\t\t\t\t\t$zip = $bSplit[2];\r\n\t\t\t\t\t\t\t$rArray = array('cityStateZip'=>true, 'city'=>$city, 'state'=>$state, 'zip'=>$zip, 'address2'=>'');\r\n\t\t\t\t\t\t\treturn $rArray;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$rArray = array('cityStateZip'=>false, 'city'=>'', 'state'=>'', 'zip'=>'', 'address2'=>$addressToCheck);\r\n\t\t\t\t\t\t\treturn $rArray;\r\n\t\t\t\t\t\t} //end inner if\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$rArray = array('error'=>true, 'cityStateZip'=>'', 'city'=>'', 'state'=>'', 'zip'=>'', 'address2'=>'');\r\n\t\t\t\t\t\treturn $rArray;\r\n\t\t\t\t\t} //end outer if\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}",
"public function setZipCode($zipCode)\n {\n if (!preg_match('/^\\d{5}(\\-\\d{4})?$/', $zipCode))\n {\n throw new Exception(sprintf('The given zip code \"%s\"does not match \"ddddd\" or \"ddddd-dddd\" pattern', $zipCode));\n }\n\n $this->setParameter('zip', $zipCode);\n\n return $this;\n }",
"function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}",
"public function validate_postal_code($str, $country_code)\n {\n //load the custom postal code validator library\n $this->load->library('Postal_code_validator');\n\n //verify postal code with user country using the method \"isValid\" from the library, returns a boolean value\n $validate = $this->postal_code_validator->isValid($country_code, $str);\n\n //if postal code does not match country, set error message for form_validation and return false\n if($validate == false)\n {\n $this->form_validation->set_message('validate_postal_code', 'Incorrect Postal Code');\n return false;\n }\n else\n {\n return true;\n }\n }",
"function cjpopups_geo_address_by_zipcode($zip, $only_zip = false){\n\t$url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($zip).\"&sensor=false\";\n\t$json = @file_get_contents($url);\n\t$data = json_decode($json, true);\n\t$status = $data['status'];\n\tif($status==\"OK\"){\n\t\tif(count($data['results']) > 0){\n\t\t\tforeach ($data['results'] as $key => $result) {\n\t\t\t\t$location = $data['results'][$key]['geometry']['location'];\n\t\t\t\t$address = cjpopups_geo_address_by_latlng($location['lat'], $location['lng']);\n\t\t\t\tif(is_array($address)){\n\t\t\t\t\tforeach ($address as $key => $adval) {\n\t\t\t\t\t\tif($only_zip){\n\t\t\t\t\t\t\tif($adval['zipcode'] != ''){\n\t\t\t\t\t\t\t\t$return[] = $adval;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$return[] = $adval;\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$return = is_array($return) ? array_values($return) : '';\n\t }else{\n\t \t$return = __('No locations found.', 'cjpopups');\n\t }\n\t}else{\n\t $return = __('No locations found.', 'cjpopups');\n\t}\n\treturn $return;\n}",
"public function getZipCode()\n {\n return $this->getParameter('zip');\n }",
"function checkZipData(&$data) \n {\n if (strpos($data, $this->_fileHeader) === false) {\n return VWP::raiseWarning(\"Invalid zip file!\",get_class($this),null,false);\n }\n return true;\n }",
"public function testValidatePhoneNumber__ReturnsValid_GivenCountrycodeNoDialingCodeRequiredTrue()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'Please enter a valid phone number',\n $person->validatePhoneNumber(\"+44 360832\", true)\n );\n }",
"protected function validateZipByRegExp ($zip, $regExpMatch, $localeCode) {\n\t\t$matched = @preg_match('#^' . $regExpMatch . '$#', $zip, $matches);\n\t\tif ($matched === FALSE) {\n\t\t\t$this->field->AddValidationError(\n\t\t\t\tstatic::GetErrorMessage(self::ERROR_WRONG_PATTERN),\n\t\t\t\t[$regExpMatch]\n\t\t\t);\n\t\t}\n\t\tif ($matched) return [$matched, $zip];\n\t\treturn [FALSE, NULL];\n\t}",
"public function hasZip() {\n return $this->_has(3);\n }",
"public function testNonPlusPrefixedNumbersNotFoundForInvalidRegion()\n {\n $iterable = $this->phoneUtil->findNumbers('1 456 764 156', RegionCode::ZZ);\n\n $iterable->next();\n $this->assertFalse($iterable->valid());\n }",
"function _addresses_province_valid($country, $province) {\n if (substr($country, 0, 4) == 'top_') {\n $country = substr($country, 4);\n }\n\n // Ensure that country code provided is valid\n if (!_addresses_country_valid($country)) {\n return FALSE;\n }\n\n $provinces = _addresses_province_get($country);\n\n // If the country chosen does not contain any provinces\n if (empty($provinces)) {\n return NULL;\n }\n\n // If $province provided matches ISO-3166-2 code.\n if ($provinces[strtoupper($province)]) {\n // Province supplied is ISO-3166-2 code.\n return $province;\n }\n\n // Flip array and change to lowercase to match names in key, can not use\n // array_search() or in_array() as they are case-sensitive.\n $provinces = array_change_key_case(array_flip($provinces));\n if ($provinces[strtolower($province)]) {\n // Return the ISO-3166-2 province code.\n return $provinces[strtolower($province)];\n }\n\n // $province provided did not return any valid matches.\n return FALSE;\n}",
"public function testEmptyCountryCode()\n {\n $request = ['postal_code' => '75008'];\n $rules = ['postal_code' => 'postal_code'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertTrue($validator->fails());\n }",
"function get_postcode_location($zip, $country){\n\n\t\t$url = \"http://geo.localsearchmaps.com/?zip={zip}&country={country}\";\n\t\t$url = str_replace('{zip}', urlencode($zip), $url);\n\t\t$url = str_replace('{country}', urlencode($country), $url);\n\t\t\n\t\t$data = safe_scrape_cached($url);\n\t\t\n\t\treturn process_emag_geocoder($data);\n\t}",
"public static function isEUTaxFreeZone($iso, $zip)\n {\n if (in_array($iso, self::$EUTaxFreeZones)) {\n // Tax free region from ISO.\n return true;\n }\n\n if (!in_array($iso, self::$EUCountriesWithTaxFreeZones)) {\n // Not applicable.\n return false;\n }\n\n $zip = trim(str_replace(' ', '', $zip));\n\n if ($iso == 'ES') {\n $part = substr($zip, 0, 2);\n // Canary Islands.\n if ($part == '35') {\n return true;\n }\n // Tenerife\n if ($part == '38') {\n return true;\n }\n // Ceuta.\n if ($part == '51') {\n return true;\n }\n // Mellila.\n if ($part == '52') {\n return true;\n }\n } elseif ($iso == 'GB') {\n $part = strtoupper(substr($zip, 0, 2));\n if ($part == 'GY') {\n // Guernsey.\n return true;\n } elseif ($part == 'JE') {\n // Jersey.\n return true;\n } elseif ($part == 'IM') {\n // Isle of Man.\n return true;\n }\n } elseif ($iso == 'FI') {\n // Aland islands.\n if (22100 <= $zip && $zip <= 22999) {\n return true;\n }\n } elseif ($iso == 'IT') {\n // Livigno 23030.\n // Campione d'Italia 22060.\n if (in_array($zip, array(23030, 22060))) {\n return true;\n }\n } elseif ($iso == 'DE') {\n // Heligoland 27498.\n // Büsingen 78266.\n if (in_array($zip, array(27498, 78266))) {\n return true;\n }\n } elseif ($iso == 'GR') {\n // Mount Athos 630 87, 630 86\n if (in_array($zip, array(63087, 63086))) {\n return true;\n }\n } elseif ($iso == 'FR') {\n if ($zip == '97133') {\n // Saint-Barthélemy.\n return true;\n }\n if ($zip == '97150') {\n // Saint-Martin.\n return true;\n }\n $list = array(\n '974', // Reunion.\n '975', // Saint Pierre and Miquelon.\n '973', // French Guiana.\n '971', // Guadeloupe.\n '972', // Martinique.\n '976', // Mayotte.\n '977', // Saint-Barthélemy.\n '978', // Saint-Martin.\n '987', // French Polynesia.\n '988', // New Caledonia.\n '986', // Wallis and Futuna.\n );\n if (in_array(substr($zip, 0, 3), $list)) {\n return true;\n }\n\n if (substr($zip, 0, 2) == 'WF') {\n // Wallis and Futuna.\n return true;\n }\n }\n\n return false;\n }",
"public function testValidatePhoneNumber__ReturnsValid_GivenCountrycodeNoDialingCodeRequiredFalse()\n {\n $person = new StdPerson;\n\n $this->assertEquals(\n 'Please enter a valid phone number',\n $person->validatePhoneNumber(\"+44 360832\", false)\n );\n }",
"public static function validate_nip($nip){\r\n $nip_9 = strlen($nip)==9?TRUE:FALSE;\r\n $nip_18 = strlen($nip)==18?TRUE:FALSE;\r\n \r\n if(Validasi::validate_number($nip)==FALSE) return FALSE;\r\n \r\n if($nip_9 OR $nip_18){\r\n if(strlen($nip)==9){\r\n return preg_match('/^060[0-9]{6}$/',$nip);\r\n }else if(strlen($nip)==18){\r\n $th_lhr = (int) substr($nip, 0,4);\r\n $bl_lhr = (int) substr($nip, 4,2);\r\n $bl_angkat = (int) substr($nip,12,2);\r\n $year = (int) date('Y');\r\n $resign = $year-50;\r\n if($resign<$th_lhr AND $th_lhr<($year-18)){\r\n if(0<$bl_lhr AND $bl_lhr<13 AND 0<$bl_angkat AND $bl_angkat<13){\r\n if(preg_match('/^19([0-9]{12})([1-2]{1})([0]{1})([0-9]{2})$/', $nip)) return TRUE;\r\n return FALSE;\r\n }\r\n }\r\n \r\n }\r\n }else{\r\n return FALSE;\r\n }\r\n }",
"public function getZipCode(){\r\n\t\treturn $this->zipCode;\r\n\t}",
"public function getZipcode()\n {\n return $this->zipcode;\n }",
"public function getZipcode()\n {\n return $this->zipcode;\n }",
"public function getZipcode()\n {\n return $this->zipcode;\n }",
"protected function canRunZipCheck(Blackbox_Data $data, Blackbox_IStateData $state_data)\n\t{\n\t\treturn !empty($data->home_zip) && !empty($data->home_city) && !empty($data->home_state);\n\t}",
"public function test_address_country_validation()\n {\n /*\n * Valid\n */\n $validCountryLocation = Location::factory()->make([\n 'addressCountry' => 'United Kingdom',\n ]);\n $validCountryData = $validCountryLocation->toArray();\n $this->post($this->route(), $validCountryData)->assertStatus(201);\n\n /*\n * Invalid: missing\n */\n $missingCountryLocation = Location::factory()->make();\n $missingCountryData = $missingCountryLocation->toArray();\n unset($missingCountryData['addressCountry']);\n\n $response = $this->post($this->route(), $missingCountryData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.addressCountry', 'The address country field is required.');\n\n /**\n * Invalid: not a string\n */\n $nonStringLocation = Location::factory()->make([\n 'addressCountry' => ['invalid'],\n ]);\n $nonStringData = $nonStringLocation->toArray();\n\n $response = $this->post($this->route(), $nonStringData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.addressCountry', 'The address country must be a string.');\n }",
"function validate_phone($input) {\n // Possible formats: (408) 375-2798, 408-375-2798, 408 375 2798, 4083752798, 408.375.2798\n\n if(preg_match(\"/^[(]?[0-9]{3}[)]?[.\\s-]?[0-9]{3}[.\\s-]?[0-9]{4}$/\",$input)){\n return true;\n }\n \n return false;\n}",
"public function validateaddress($address){\n return $this->bitcoin->validateaddress($address);\n }",
"function is_valid_ssn($ssn)\n{\n if(is_null($ssn) || strlen($ssn) != 18)\n {\n return false;\n }\n $pattern = \"/^[1-8][0-7]\\d{4}(19|20)\\d{2}(0[1-9]|1(0|1|2))(0[1-9]|(1|2)\\d|3(0|1))\\d{3}(\\d|x)$/i\";\n return preg_match($pattern, $ssn) == 1;\n}",
"public function testValidateDocumentZipValidation()\n {\n }",
"public function testDebtorSaveZipcodeEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '1234567890',\n 'birthdate' => '12/01/1994',\n 'phone_number' => '(79) 9 9999-9999',\n 'zipcode' => '',\n 'address' => 'Rua Teste',\n 'number' => '25',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }",
"public function getFactZipCode() {\n return $this->fact_zip_code;\n }",
"public static function validatePhoneNumber($input)\r\n\t{\r\n\t\treturn preg_match('/\\d{3}-\\d{3}-\\d{4}/', $input) && (strlen($input) == 12);\r\n\t}",
"public function checkAddress($address)\n\t\t{\n\t\t\t$address = strip_tags($address);\n\t\t\t\n\t\t\t$this->groestlcoin->validateaddress($address);\n\t\t\t\n\t\t\tif ($this->groestlcoin->response['result']['isvalid'] == 1){\n\t\t\t\treturn 1;}\n\t\t\telse{\n\t\t\t\treturn 0;}\t\t\t\n\t\t}",
"public function testCheckAddress() {\n\t$this->assertTrue(Bitcoin::checkAddress(\"1pA14Ga5dtzA1fbeFRS74Ri32dQjkdKe5\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1F417eczAAbh41V4oLGNf3DqXLY72hsM73\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJkwJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1111111fnord\"));\n\t}",
"public function validate(string $number): bool;",
"function direzioneLatFormat ($value){\n \n if(!preg_match(VALID_DIR_LAT_FORMAT,$value)){\n return false;\n }\n \n return true;\n}",
"function validateAddress($field)\n\t{\n //Make sure field is not blank; unable to validate anything beyond that.\n if ($field == \"\") return \"Please specify your address.\\\\n\";\n\t\treturn \"\";\n\t}",
"public function test_address_locality_validation()\n {\n /*\n * Valid\n */\n $validRegionLocation = Location::factory()->make([\n 'addressLocality' => 'Salford',\n ]);\n $validRegionData = $validRegionLocation->toArray();\n $this->post($this->route(), $validRegionData)->assertStatus(201);\n\n /**\n * Invalid: not a string\n */\n $nonStringLocation = Location::factory()->make([\n 'addressLocality' => ['invalid'],\n ]);\n $nonStringData = $nonStringLocation->toArray();\n\n $response = $this->post($this->route(), $nonStringData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.addressLocality', 'The address locality must be a string.');\n }"
] | [
"0.7933685",
"0.78354853",
"0.7706438",
"0.76262736",
"0.75493795",
"0.7174282",
"0.70434016",
"0.6973166",
"0.68261147",
"0.669255",
"0.6688768",
"0.6684849",
"0.6601482",
"0.6594676",
"0.6544151",
"0.65030885",
"0.6493323",
"0.6465881",
"0.6451635",
"0.6444327",
"0.64317554",
"0.63995963",
"0.6378031",
"0.6349336",
"0.6302687",
"0.62922734",
"0.6205107",
"0.6191323",
"0.61811066",
"0.6155425",
"0.6143197",
"0.6110709",
"0.6104758",
"0.6068603",
"0.59889466",
"0.59773356",
"0.59626824",
"0.59446454",
"0.590747",
"0.5893118",
"0.5892546",
"0.5875026",
"0.5873367",
"0.58473057",
"0.5843478",
"0.5830906",
"0.582398",
"0.5818961",
"0.5802407",
"0.5801397",
"0.58007306",
"0.58007306",
"0.5742567",
"0.57355416",
"0.57298505",
"0.5725227",
"0.5712181",
"0.57067114",
"0.5704664",
"0.56982714",
"0.56914234",
"0.5688056",
"0.5685896",
"0.56713384",
"0.5670734",
"0.5661652",
"0.56540185",
"0.56411654",
"0.5640071",
"0.5637428",
"0.5634436",
"0.5627954",
"0.5625332",
"0.5613976",
"0.5608967",
"0.5608451",
"0.55972946",
"0.55931956",
"0.5589167",
"0.5588092",
"0.5573376",
"0.5565825",
"0.5563737",
"0.5563737",
"0.5563737",
"0.55563885",
"0.5534742",
"0.55219465",
"0.55058414",
"0.5498305",
"0.5493607",
"0.5491889",
"0.54905254",
"0.54876035",
"0.54771644",
"0.547559",
"0.5461139",
"0.54562",
"0.5449757",
"0.5448947"
] | 0.74683386 | 5 |
Validation function for IP addresses NOTE: Currently Disabled!! | public function _validate_ip_address($value, $field) {
return true;
$ip = $this->input->ip_address();
if ($this->input->valid_ip($ip)) {
return $this->user->is_unique_ip($ip);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function validIpDataProvider() {}",
"function f_validateIP($ip)\r\n{\r\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\r\n return false;\r\n }\r\n return true;\r\n}",
"function isValidIP($ip_addr){\n //first of all the format of the ip address is matched\n if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr)) {\n //now all the intger values are separated\n $parts=explode(\".\",$ip_addr);\n //now we need to check each part can range from 0-255\n foreach($parts as $ip_parts) {\n if(intval($ip_parts)>255 || intval($ip_parts)<0)\n return false; //if number is not within range of 0-255\n }\n return true;\n }\n else\n return false; //if format of ip address doesn't matches\n}",
"function validate_ip($ip)\n{\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n}",
"function validIP($ip){\r\n if(preg_match(\"^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}^\", $ip))\r\n return true;\r\n else\r\n return false;\r\n}",
"function validate_ip($ip) {\n\t\t\t// Define all IPv6 address types\n\t\t\t$ipv6regexes = array(\n\t\t\t\t\"preferred\" => array(\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i\"\n\t\t\t\t),\n\t\t\t\t\"compressed\" => array(\n\t\t\t\t\t\"/^[a-f0-9]{0,4}::$/i\",\n\t\t\t\t\t\"/^:(?::[a-f0-9]{1,4}){1,6}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){1,6}:$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,6}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,5}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,4}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}){1,3}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){5}(?::[a-f0-9]{1,4}){1,2}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){6}(?::[a-f0-9]{1,4})$/i\"\n\t\t\t\t),\n\t\t\t\t\"ipv4\" => array(\n\t\t\t\t\t\"/^::(?:\\d{1,3}\\.){3}\\d{1,3}$/\",\n\t\t\t\t\t\"/^(?:0:){6}(?:\\d{1,3}\\.){3}\\d{1,3}$/i\"\n\t\t\t\t),\n\t\t\t\t\"ipv4_mapped\" => array(\n\t\t\t\t\t\"/^(?:0:){5}ffff:(?:\\d{1,3}\\.){3}\\d{1,3}$/i\",\n\t\t\t\t\t\"/^::ffff:(?:\\d{1,3}\\.){3}\\d{1,3}$/\"\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Search the address types and return the name if it matches\n\t\t\tforeach ($ipv6regexes as $type => $regexes) {\n\t\t\t\tforeach ($regexes as $regex)\n\t\t\t\t\tif (preg_match($regex, $ip)) {\n\t\t\t\t\t\tif (in_array($type, array(\"ipv4\", \"ipv4_mapped\"))) {\n\t\t\t\t\t\t\t$ipparts = explode(\":\", $ip);\n\t\t\t\t\t\t\t$ipv4part = $ipparts[count($ipparts)-1];\n\t\t\t\t\t\t\tif (IPv4::validate_ip($ipv4part))\n\t\t\t\t\t\t\t\treturn $type;\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\treturn $type;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Return false if we didn't match an address type\n\t\t\treturn false;\n\t\t}",
"public static function validate_ip($value){\n\t\treturn preg_match( \"/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\", $value);\n\t}",
"protected function isValidIp($ip)\n{\n $ips = array('IP_ADDRESS');\nreturn in_array($ip, $ips);\n}",
"function validateIp($ip) {\n\treturn inet_pton($ip);\n }",
"function validIP($value)\n {\n return filter_var($value, FILTER_VALIDATE_IP);\n }",
"public function checkIPs () {\n\n\t\t$validation = true;\n\n\t\tforeach ($this->allow as $key => $ip) {\n\t\t\t\n\t\t\tif ($this->matchIP($ip)) {\n \n return true;\n \n }\n\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public static function invalidIpDataProvider() {}",
"protected function validateIp($value) {\n if (filter_var($value, FILTER_VALIDATE_IP))\n return true;\n $this->setError(t(\"Invalid IP-address\"));\n return false;\n }",
"function validate_ip($ip) {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647)\n return false;\n if ($ip >= 167772160 && $ip <= 184549375)\n return false;\n if ($ip >= 2130706432 && $ip <= 2147483647)\n return false;\n if ($ip >= 2851995648 && $ip <= 2852061183)\n return false;\n if ($ip >= 2886729728 && $ip <= 2887778303)\n return false;\n if ($ip >= 3221225984 && $ip <= 3221226239)\n return false;\n if ($ip >= 3232235520 && $ip <= 3232301055)\n return false;\n if ($ip >= 4294967040)\n return false;\n }\n return true;\n }",
"function ipValid($ip) {\n $matches = [];\n $pattern =\"/([1-9]\\.|[1-9]\\d\\.|1\\d\\d\\.|25[0-5]\\.|2[0-4][0-9]\\.)(\\.\\d|[1-9]\\d|1\\d\\d|25[0-5]|2[0-4][0-9]){3}/\";\n preg_match($pattern, $ip, $matches);\n return $matches[0];\n}",
"function validate_ip($ip)\n {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) return false;\n if ($ip >= 167772160 && $ip <= 184549375) return false;\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n if ($ip >= 4294967040) return false;\n }\n return true;\n }",
"protected function validateIp($value){\n\t\treturn filter_var($value, FILTER_VALIDATE_IP) !== false;\n\t}",
"public function validate_ip($ip) {\n if (filter_var($ip, FILTER_VALIDATE_IP, \n FILTER_FLAG_IPV4 | \n FILTER_FLAG_IPV6 |\n FILTER_FLAG_NO_PRIV_RANGE | \n FILTER_FLAG_NO_RES_RANGE) === false)\n return false;\n self::$ip = $ip;\n return true;\n }",
"function valid_ip($ip)\n\t{\n\t\t$ip_segments = explode('.', $ip);\n\n\t\t// Always 4 segments needed\n\t\tif (count($ip_segments) != 4)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// IP can not start with 0\n\t\tif ($ip_segments[0][0] == '0')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Check each segment\n\t\tforeach ($ip_segments as $segment)\n\t\t{\n\t\t\t// IP segments must be digits and can not be\n\t\t\t// longer than 3 digits or greater then 255\n\t\t\tif ($segment == '' OR preg_match(\"/[^0-9]/\", $segment) OR $segment > 255 OR strlen($segment) > 3)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"function ip_good($ip)\n{\n\t$bad_ip = true;\n\t\n\t# check the ip to see if it is a private ip\n\t# 192.168.x.x\n\t# 172.16-31.x.x\n\t# 10.x.x.x\n\t# 127.x.x.x\n\t$private_ip = '/^(172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3})|(192\\.168\\.\\d{1,3}.\\d{1,3})|(10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})|(127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})$/';\n\tif(preg_match($private_ip, $ip))\n\t{\n\t\t$bad_ip = true;\n\t} else {\n\t\t$bad_ip = false;\n\t}\n\t\n\t# Checks to see if the ip address is correctly formated\n\t# ie. It is between 0 and 255\n\t# exp. 206.13.28.12 would pass but 268.221.2.58 would fail.\n\t$patter = '/^\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/';\n\tif(preg_match($patter, $ip) && $bad_ip === false)\n\t{\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function isValidIP($var) {\n //Returns error message for an invalid IP Address\n \n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n\n if (filter_var($var, FILTER_VALIDATE_IP)) {\n return \"\";\n } else {\n return \"Invalid IP Address\";\n }\n}",
"function is_ip($ip){\n return (filter_var($ip, FILTER_VALIDATE_IP) !== false);\n}",
"function esip($ip_addr)\n\t{\n\t\t if(preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\",$ip_addr)) \n\t\t {\n\t\t\t //now all the intger values are separated \n\t\t\t $parts=explode(\".\",$ip_addr); \n\t\t\t //now we need to check each part can range from 0-255 \n\t\t\t foreach($parts as $ip_parts) \n\t\t\t {\n\t\t\t\t if(intval($ip_parts)>255 || intval($ip_parts)<0) \n\t\t\t\t return FALSE; //if number is not within range of 0-255\n\t\t\t }\n\t\t\t return TRUE; \n\t\t }\n\t\t else return FALSE; //if format of ip address doesn't matches \n\t}",
"public function validate_ip($ip) {\n\t\tif (strtolower($ip) === 'unknown')\n\t\t\treturn false;\n\n\t\t// generate ipv4 network address\n\t\t$ip = ip2long($ip);\n\n\t\t// if the ip is set and not equivalent to 255.255.255.255\n\t\tif ($ip !== false && $ip !== -1) {\n\t\t\t// make sure to get unsigned long representation of ip\n\t\t\t// due to discrepancies between 32 and 64 bit OSes and\n\t\t\t// signed numbers (ints default to signed in PHP)\n\t\t\t$ip = sprintf('%u', $ip);\n\t\t\t// do private network range checking\n\t\t\tif ($ip >= 0 && $ip <= 50331647) return false;\n\t\t\tif ($ip >= 167772160 && $ip <= 184549375) return false;\n\t\t\tif ($ip >= 2130706432 && $ip <= 2147483647) return false;\n\t\t\tif ($ip >= 2851995648 && $ip <= 2852061183) return false;\n\t\t\tif ($ip >= 2886729728 && $ip <= 2887778303) return false;\n\t\t\tif ($ip >= 3221225984 && $ip <= 3221226239) return false;\n\t\t\tif ($ip >= 3232235520 && $ip <= 3232301055) return false;\n\t\t\tif ($ip >= 4294967040) return false;\n\t\t}\n\t\treturn true;\n\t}",
"public function validAddresses() {}",
"public function validate_ip($ip) {\n if (strtolower($ip) === 'unknown')\n return false;\n\n // generate ipv4 network address\n $ip = ip2long($ip);\n\n // if the ip is set and not equivalent to 255.255.255.255\n if ($ip !== false && $ip !== -1) {\n // make sure to get unsigned long representation of ip\n // due to discrepancies between 32 and 64 bit OSes and\n // signed numbers (ints default to signed in PHP)\n $ip = sprintf('%u', $ip);\n // do private network range checking\n if ($ip >= 0 && $ip <= 50331647) return false;\n if ($ip >= 167772160 && $ip <= 184549375) return false;\n if ($ip >= 2130706432 && $ip <= 2147483647) return false;\n if ($ip >= 2851995648 && $ip <= 2852061183) return false;\n if ($ip >= 2886729728 && $ip <= 2887778303) return false;\n if ($ip >= 3221225984 && $ip <= 3221226239) return false;\n if ($ip >= 3232235520 && $ip <= 3232301055) return false;\n if ($ip >= 4294967040) return false;\n }\n return true;\n }",
"function checkIPorRange ($ip_address) {\r\n\t if (ereg(\"-\",$ip_address)) {\r\n\t // Range\r\n\t $ar = explode(\"-\",$ip_address);\r\n\t $your_long_ip = ip2long($_SERVER[\"REMOTE_ADDR\"]);\r\n\t if ( ($your_long_ip >= ip2long($ar[0])) && ($your_long_ip <= ip2long($ar[1])) ) {\r\n\t return TRUE;\r\n\t }\r\n\t } else {\r\n\t // Single IP\r\n\t if ($_SERVER[\"REMOTE_ADDR\"] == $ip_address) {\r\n\t return TRUE;\r\n\t }\r\n\t }\r\n\t return FALSE;\r\n\t}",
"function rest_is_ip_address($ip)\n {\n }",
"public static function check_ip_address($ip_addr) {\n\t // First of all the format of the ip address is matched\n\t if (preg_match(\"/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/\", $ip_addr)) {\n\t // Now all the intger values are separated\n\t $parts = explode(\".\", $ip_addr);\n\t // Now we need to check each part can range from 0-255\n\t foreach ($parts as $ip_parts)\n\t {\n\t if (intval($ip_parts) > 255 || intval($ip_parts) < 0)\n\t return false; // If number is not within range of 0-255\n\t }\n\t return true;\n\t }\n\t else\n\t return false; // If format of ip address doesn't matches\n\t}",
"protected function checkIpAddress()\n {\n $allowedIpAddresses = \\XLite\\Core\\Config::getInstance()->CDev->XPaymentsConnector->xpc_allowed_ip_addresses;\n return !$allowedIpAddresses \n || false !== strpos($allowedIpAddresses, $_SERVER['REMOTE_ADDR']);\n }",
"function allow_ip_address()\r\n\t{\r\n\t\t$bad = apply_filters('three_strikes_count', 0, $_SERVER['REMOTE_ADDR']);\r\n\t\treturn ($bad < THREE_STRIKES_LIMIT);\r\n\t}",
"protected function isValidIpRange($ip)\n{\n $ipRanges = env('IP_RANGE');\nreturn IpUtils::checkIp($ip, $ipRanges);\n}",
"protected function validateIp(): bool\n {\n $meta = $this->getGitHubApiMeta();\n\n $ip = @$_SERVER['REMOTE_ADDR'];\n $ranges = (array) ($meta['hooks'] ?? []);\n\n // Check if IP comes from a GitHub hook.\n foreach ($ranges as $range) {\n if (Utils::cidrMatch($ip, $range)) {\n return true;\n }\n }\n\n return false;\n }",
"public static function is_ip_address($maybe_ip)\n {\n }",
"public function invalidAddresses() {}",
"public function testIPIsValid()\n {\n $settings = require(__DIR__ . '/../src/settings.php');\n $geo_ip = new GeoIP($settings['settings']);\n\n $this->assertTrue($geo_ip->validateIP('10.0.0.1'));\n }",
"public function validip($ip) {\n $ips = explode(\",\", $this->get_prop(\"ip\"));\n foreach ($ips as $ip_l) {\n $editedip = str_replace('.', '\\\\.', trim($ip_l));\n $editedip = str_replace('*', '[0-9]{1,3}', $editedip);\n if (preg_match('/^' . $editedip . '$/', $ip)) {\n return true;\n }\n }\n return false;\n }",
"private function validateIp($IpAddress) {\n if(filter_var($IpAddress, FILTER_VALIDATE_IP)) {\n return TRUE;\n }\n return FALSE;\n }",
"function vIP( $ip )\r\n\t\t{\r\n\t\t return filter_var( $ip, FILTER_VALIDATE_IP );\r\n\t\t \r\n\t\t}",
"public function checkIpAllowed()\n {\n $ip_list = $this->options->get('allowed_ips');\n if ($ip_list) {\n $client_ip = $this->request->getClientIp();\n $status = Ip::match($client_ip, explode(',', $ip_list));\n if (!$status) {\n $this->logger->warning('IP Not Allowed');\n $response = Response::create('Access denied for IP: '.$client_ip, 403);\n $response->send();\n exit();\n }\n }\n }",
"public function testIPIsNotValid()\n {\n $settings = require(__DIR__ . '/../src/settings.php');\n $geo_ip = new GeoIP($settings['settings']);\n\n $this->assertFalse($geo_ip->validateIP('10.0.0'));\n }",
"function verifyAndCleanAddresses($data, $subnets_allowed = 'subnets-allowed') {\n\t/** Remove extra spaces */\n\t$data = preg_replace('/\\s\\s+/', ' ', $data);\n\t\n\t/** Swap delimiters for ; */\n\t$data = str_replace(array(\"\\n\", ';', ' ', ','), ',', $data);\n\t$data = str_replace(',,', ',', $data);\n\t$data = trim($data, ',');\n\t\n\t$addresses = explode(',', $data);\n\tforeach ($addresses as $ip_address) {\n\t\t$cidr = null;\n\n\t\t$ip_address = rtrim(trim($ip_address), '.');\n\t\tif (!strlen($ip_address)) continue;\n\t\t\n\t\t/** Handle negated addresses */\n\t\tif (strpos($ip_address, '!') === 0) {\n\t\t\t$ip_address = substr($ip_address, 1);\n\t\t}\n\t\t\n\t\tif (strpos($ip_address, '/') !== false && $subnets_allowed == 'subnets-allowed') {\n\t\t\t$cidr_array = explode('/', $ip_address);\n\t\t\tlist($ip_address, $cidr) = $cidr_array;\n\t\t}\n\t\t\n\t\t/** IPv4 checks */\n\t\tif (strpos($ip_address, ':') === false) {\n\t\t\t/** Valid CIDR? */\n\t\t\tif ($cidr && !checkCIDR($cidr, 32)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t\t\n\t\t\t/** Create full IP */\n\t\t\t$ip_octets = explode('.', $ip_address);\n\t\t\tif (count($ip_octets) < 4) {\n\t\t\t\t$ip_octets = array_merge($ip_octets, array_fill(count($ip_octets), 4 - count($ip_octets), 0));\n\t\t\t}\n\t\t\t$ip_address = implode('.', $ip_octets);\n\t\t} else {\n\t\t\t/** IPv6 checks */\n\t\t\tif ($cidr && !checkCIDR($cidr, 128)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t}\n\t\t\n\t\tif (verifyIPAddress($ip_address) === false) return sprintf(__('%s is not valid.'), $ip_address);\n\t}\n\t\n\treturn $data;\n}",
"public function checkBackendIpOrDie() {}",
"public function valid() {\n return filter_var($this->address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;\n }",
"private function doIpCheck($ip)\r\n {\r\n $allowedList = array();\r\n $allowedList['85.158.206.17'] = 1;\r\n $allowedList['85.158.206.18'] = 1;\r\n $allowedList['85.158.206.19'] = 1;\r\n $allowedList['85.158.206.20'] = 1;\r\n $allowedList['85.158.206.21'] = 1;\r\n if (!isset($allowedList[$ip]))\r\n {\r\n return false;\r\n }\r\n return true;\r\n }",
"public static function validateIpAddress($ipAddress = '') {\n if (strtolower($ipAddress) === 'unknown') {\n return false;\n }\n // Generate ipv4 network address\n $ipAddress = ip2long($ipAddress);\n // If the ip is set and not equivalent to 255.255.255.255\n if ($ipAddress !== false && $ipAddress !== -1) {\n /**\n * Make sure to get unsigned long representation of ip\n * due to discrepancies between 32 and 64 bit OSes and\n * signed numbers (ints default to signed in PHP)\n */\n $ipAddress = sprintf('%u', $ipAddress);\n // Do private network range checking\n if ($ipAddress >= 0 && $ipAddress <= 50331647) return false;\n if ($ipAddress >= 167772160 && $ipAddress <= 184549375) return false;\n if ($ipAddress >= 2130706432 && $ipAddress <= 2147483647) return false;\n if ($ipAddress >= 2851995648 && $ipAddress <= 2852061183) return false;\n if ($ipAddress >= 2886729728 && $ipAddress <= 2887778303) return false;\n if ($ipAddress >= 3221225984 && $ipAddress <= 3221226239) return false;\n if ($ipAddress >= 3232235520 && $ipAddress <= 3232301055) return false;\n if ($ipAddress >= 4294967040) return false;\n }\n return true;\n }",
"function ip_is_local($ip){\r\n\t\r\n\t $ipv4array = explode('.',$ip); $ipv6array = explode(':',$ip);\r\n\t $lenipv4 = count($ipv4array) ; $lenipv6 = count($ipv6array); \r\n\t $ipint = array(); \r\n\t if($lenipv4 > 0 ){//We have an ipv4 address\r\n\t\t for ($i = 0 ; $i<$lenipv4 ; $i++){\r\n\t\t\t $ipint[$i] = intval($ipv4array[$i]) ; //Generating integera values for the ips\r\n\t\t }\r\n\t\t \r\n\t\t\t//Let's see if our IP is riv ate\r\n\t\t\tif ($ipint[0] == 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 172 && $ipint[1] > 15 && $ipint[1] < 32) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 192 && $ipint[1] == 168) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else return false ;\r\n\t }else{\r\n\t //Either something went wrong, or we are in IPV6 format.\t \r\n\t\t \r\n\t\t if( $lenipv6 > 0){//We are having a big IPV6 address here !\r\n\t\t\t //We are in IPV4. Haven't implemented IPV6 yet\r\n\t\t\t \r\n\t\t }\r\n\t\t return false ;\r\n\t }\r\n\t \r\n\t \r\n\t return false;\r\n}",
"function is_ip_banned($ip, $banned_ips)\n {\n foreach($banned_ips as $banned_ip) // go through every $banned_ip\n {\n if(strpos($banned_ip,'*')!==false) // $banned_ip contains \"*\" = > IP range\n {\n $ip_range = substr($banned_ip, 0, strpos($banned_ip, '*')); // fetch part before \"*\"\n if(strpos($ip, $ip_range)===0) // check if IP begins with part before \"*\"\n {\n return true;\n }\n }\n elseif(strpos($banned_ip,'/')!==false && preg_match(\"/(([0-9]{1,3}\\.){3}[0-9]{1,3})\\/([0-9]{1,2})/\", $banned_ip, $regs)) // $banned_ip contains \"/\" => CIDR notation (the regular expression is only used if $banned_ip contains \"/\")\n {\n // convert IP into bit pattern:\n $n_user_leiste = '00000000000000000000000000000000'; // 32 bits\n $n_user_ip = explode('.',trim($ip));\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_user_ip[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_user_ip[$i] = $n_user_ip[$i] - pow(2, 7-$n_j);\n $n_user_leiste[$n_j + $i*8] = '1';\n }\n }\n }\n // analyze prefix length:\n $n_byte_array = explode('.',trim($regs[1])); // IP -> 4 Byte\n $n_cidr_bereich = $regs[3]; // prefix length\n // bit pattern:\n $n_bitleiste = '00000000000000000000000000000000';\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n if ($n_byte_array[$i] > 255) // invalid\n {\n $n_cidr_bereich = 0;\n }\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_byte_array[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_byte_array[$i] = $n_byte_array[$i] - pow(2, 7-$n_j);\n $n_bitleiste[$n_j + $i*8] = '1';\n }\n }\n }\n // check if bit patterns match on the first n chracters:\n if (strncmp($n_bitleiste, $n_user_leiste, $n_cidr_bereich) == 0 && $n_cidr_bereich > 0)\n {\n return true;\n }\n }\n else // neither \"*\" nor \"/\" => simple comparison:\n {\n if($ip == $banned_ip)\n {\n return true;\n }\n }\n }\n return false;\n }",
"function _checkIP($ip)\n{\n _log(\"checkIP: Starting.\",\"info\");\n global $caasnode;\n _log(\"checkIP: IP address is $ip.\",\"info\");\n $cIP = ip2long($ip);\n $fIP = long2ip($cIP);\n if($fIP=='0.0.0.0')\n\t{\n\t\t_log(\"-----Failed to process node ($caasnode): IPaddress is not valid.\",\"SUMMARY\");\n\t\t_logProvsionEndToDb(0,\"Failed to process node: IPaddress is not valid.\");\n\t\t_exit1(\"Exiting at checkIP: Invalid ip address, aborting \\n\\n\\n\");\n\t}\n _log(\"checkIP: $ip is a valid ip address.\",\"info\");\n _log(\"checkIP: Exiting.\",\"info\");\n}",
"private function is_from_valid_ip() {\n\t\t$my_ip = getenv( 'REMOTE_ADDR' );\n\t\t\n\t\t// Check if we are in testing mode, and get list of valid IPs\n\t\t//if ( Mage::getStoreConfig( 'payment/fssnet/is_testing' ) )\n\t\t\t$valid_ips = array( '221.134.101.174', '221.134.101.169','198.64.129.10','198.64.133.213' );\n\t\t//else\n\t\t\t//$valid_ips = array( '221.134.101.187', '221.134.101.175', '221.134.101.166','198.64.129.10','198.64.133.213' );\n\t\t\n\t\t// Check if our IP is valid\n\t\tif ( in_array( $my_ip, $valid_ips ) )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function validAndInvalidIpPatterns()\n {\n return [\n ['127.0.0.1', '127.0.0.1', true],\n ['127.0.0.0/24', '127.0.0.1', true],\n ['255.255.255.255/0', '127.0.0.1', true],\n ['127.0.255.255/16', '127.0.0.1', true],\n ['127.0.0.1/32', '127.0.0.1', true],\n ['1:2::3:4', '1:2:0:0:0:0:3:4', true],\n ['127.0.0.2/32', '127.0.0.1', false],\n ['127.0.1.0/24', '127.0.0.1', false],\n ['127.0.0.255/31', '127.0.0.1', false],\n ['::1', '127.0.0.1', false],\n ['::127.0.0.1', '127.0.0.1', true],\n ['127.0.0.1', '::127.0.0.1', true],\n ];\n }",
"protected static function validate_valid_ip($field, $input, $param = NULL)\n\t{\n\t\tif(!isset($input[$field]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(!filter_var($input[$field], FILTER_VALIDATE_IP) !== FALSE)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'field' => $field,\n\t\t\t\t'value' => $input[$field],\n\t\t\t\t'rule'\t=> __FUNCTION__\n\t\t\t);\n\t\t}\n\t}",
"protected function validateIp($attribute, $value)\n {\n return filter_var($value, FILTER_VALIDATE_IP) !== false;\n }",
"private function _isValidIPAddress($ipAddress)\n {\n return filter_var($ipAddress, FILTER_VALIDATE_IP);\n }",
"public function testValidateIpv4()\n {\n $test = array(\n '141.225.185.101',\n '255.0.0.0',\n '0.255.0.0',\n '0.0.255.0',\n '0.0.0.255',\n '127.0.0.1',\n );\n foreach ($test as $val) {\n $this->assertTrue($this->_filter->validateIpv4($val));\n }\n }",
"protected function validateIPv4($value)\n {\n if (preg_match('/^([01]{8}\\.){3}[01]{8}\\z/i', $value)) {\n // binary format 00000000.00000000.00000000.00000000\n $value = bindec(substr($value, 0, 8)) . '.' . bindec(substr($value, 9, 8)) . '.'\n . bindec(substr($value, 18, 8)) . '.' . bindec(substr($value, 27, 8));\n } elseif (preg_match('/^([0-9]{3}\\.){3}[0-9]{3}\\z/i', $value)) {\n // octet format 777.777.777.777\n $value = (int) substr($value, 0, 3) . '.' . (int) substr($value, 4, 3) . '.'\n . (int) substr($value, 8, 3) . '.' . (int) substr($value, 12, 3);\n } elseif (preg_match('/^([0-9a-f]{2}\\.){3}[0-9a-f]{2}\\z/i', $value)) {\n // hex format ff.ff.ff.ff\n $value = hexdec(substr($value, 0, 2)) . '.' . hexdec(substr($value, 3, 2)) . '.'\n . hexdec(substr($value, 6, 2)) . '.' . hexdec(substr($value, 9, 2));\n }\n\n $ip2long = ip2long($value);\n if ($ip2long === false) {\n return false;\n }\n\n return ($value == long2ip($ip2long));\n }",
"public function rules(){\n\t\treturn [\n\t\t\t[['allowFrom','allowTo'],'match','pattern'=>\"/^(\\d{1,3}\\.){3,3}\\d{1,3}$/\",'message'=>'{attribute} ist keine gültige IP Adresse'],\n\t\t];\n\t}",
"function testIP($a, $allowzero=FALSE) {\r\n $t = explode(\".\", $a);\r\n \r\n if (sizeof($t) != 4)\r\n return 1;\r\n \r\n for ($i = 0; $i < 4; $i++) {\r\n // first octet may not be 0\r\n if ($t[0] == 0 && $allowzero == FALSE)\r\n return 1;\r\n if ($t[$i] < 0 or $t[$i] > 255)\r\n return 1;\r\n if (!is_numeric($t[$i]))\r\n return 1;\r\n };\r\n return 0;\r\n}",
"public function isUserIPAddressAllowedAccess()\n\t{\n\t\ttry\n {\n $IpBin = new IpBin();\n return $IpBin->isUserIPAddressAllowedAccess($this->getSiteUser()->getId());\n }\n catch(\\Whoops\\Example\\Exception $e)\n {\n Log::error(\"Could not check if ip address is allowed access for user [\" . $this->getSiteUser()->getId() . \"]. \" . $e);\n return FALSE;\n }\n\t}",
"public function validate($data, DBaseModel $model = null, DField $field = null)\n {\n $errors = array();\n // Empty strings are also valid.\n if (strlen($data) > 0) {\n $parts = explode('.', $data);\n if (!$this->validateParts($parts)) {\n $errors[] = '#fieldName# is not a valid IP address.';\n }\n }\n\n return $errors;\n }",
"function geoCheckIP($ip)\n{\n\t if(!filter_var($ip, FILTER_VALIDATE_IP))\n\t {\n\t\t\t throw new InvalidArgumentException(\"IP is not valid\");\n\t }\n\n\t //contact ip-server\n\t \n\t //$response=@file_get_contents('http://www.netip.de/search?query='.$ip);\n\t $response=@file_get_contents('http://api.hostip.info/country.php?ip='.$ip);\n\t \n\t if (empty($response))\n\t {\n\t\t\t throw new InvalidArgumentException(\"Error contacting Geo-IP-Server\");\n\t }\n\n\t /*\n\t //Array containing all regex-patterns necessary to extract ip-geoinfo from page\n\t $patterns=array();\n\t $patterns[\"domain\"] = '#Domain: (.*?) #i';\n\t $patterns[\"country\"] = '#Country: (.*?) #i';\n\t $patterns[\"state\"] = '#State/Region: (.*?)<br#i';\n\t $patterns[\"town\"] = '#City: (.*?)<br#i';\n\n\t //Array where results will be stored\n\t $ipInfo=array();\n\n\t //check response from ipserver for above patterns\n\t foreach ($patterns as $key => $pattern)\n\t {\n\t\t\t //store the result in array\n\t\t\t $ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : 'not found';\n\t }\n\n\t return $ipInfo;\n\t */\n\t return $response;\n}",
"function check_ip($ip)\r\n\t{\r\n\t\treturn (!strcmp(long2ip(sprintf('%u',ip2long($ip))),$ip) ? true : false);\r\n\t}",
"public function rules()\n {\n return [\n 'ip_address' => [\n 'required',\n new IPAddress(),\n 'exists:ip,ip'\n ]\n ];\n }",
"public static function validate_filter_ip_address($ip) {\n\t//--\n\t$ip = @filter_var((string)$ip, FILTER_VALIDATE_IP);\n\t//--\n\tif($ip === false) {\n\t\t$ip = '';\n\t} //end if\n\t//--\n\treturn (string) $ip;\n\t//--\n}",
"function valid_ipv4($var) {\n\treturn filter_var($var, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);\n}",
"public static function is_ip6($ip) {\r\n\t\t$ret = false;\r\n\t\tif (function_exists('filter_var')) {\r\n\t\t\t// This regards :: as valid, also ::0 or ::0.0.0.0 as OK, which is wrong\r\n\t\t\t$ret = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// This regards :: as invalid, but ::0 or ::0.0.0.0 as OK, which is wrong\r\n\t\t\t// Taken from here: http://regexlib.com/REDetails.aspx?regexp_id=1000\r\n\t\t\t$regex = \"@^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){1,5}:((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){1}:([0-9A-Fa-f]{1,4}:){0,4}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,2}:([0-9A-Fa-f]{1,4}:){0,3}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,3}:([0-9A-Fa-f]{1,4}:){0,2}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,4}:([0-9A-Fa-f]{1,4}:){1}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$@\";\r\n\t\t\t$ret = preg_match($regex, $ip);\r\n\t\t}\t\r\n\t\tif ($ret) {\r\n\t\t\t// :: in any combination (::, ::0, 0::0:0.0.0.0) is invalid!\r\n\t\t\t$regex = '@^[0.:]*$@'; // Contains only ., :, and 0\r\n\t\t\t$ret = !preg_match($regex, $ip);\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}",
"static public function checkClientIp(array $allowed_ips = [])\n {\n array_unshift($allowed_ips, '127.0.0.1');\n $ip = static::getClientIp(); \n $check_ip_arr= explode('.',$ip); //要检测的ip拆分成数组\n \n if(!in_array($ip, $allowed_ips)) {\n foreach ($allowed_ips as $val) {\n if(strpos($val,'*')!==false){//发现有*号替代符\n $arr = explode('.', $val);\n $bl = true;//用于记录循环检测中是否有匹配成功的\n for($i=0;$i<4;$i++){\n if($arr[$i]!='*'){//不等于* 就要进来检测,如果为*符号替代符就不检查\n if($arr[$i]!=$check_ip_arr[$i]){\n $bl=false;\n break;//终止检查本个ip 继续检查下一个ip\n }\n }\n }//end for\n if($bl){//如果是true则找到有一个匹配成功的就返回\n return true;\n }\n }\n }\n \n return false;\n }\n \n return true;\n }",
"public static function isValidIpAddress($ip_address){\n return (filter_var($ip_address, FILTER_VALIDATE_IP)) ? true : false;\n }",
"public static function isValidAddress($ip_address)\n {\n return filter_var($ip_address, FILTER_VALIDATE_IP) !== false;\n }",
"public function getValidIPs()\n {\n return $this->validIPs;\n }",
"protected function ip(string $field, string $value, $param = null)\n {\n if (!empty($value)) {\n if (filter_var($value, FILTER_VALIDATE_IP) === false) {\n $this->addError($field, 'ip', $param);\n }\n }\n }",
"function validateIpFields($ipFields, $errorMsg=NULL)\n{\n\t $errorOut =\"\";\n\t $errorArray =\tarray();\n\t\n\t foreach($ipFields as $fieldName => $displayName)\n\t\t{\n\t\t\tif(!filter_var($_REQUEST[$fieldName], FILTER_VALIDATE_IP)) \n\t\t\t{\n\t\t\t\tif(count($errorArray)> 0)\n\t\t\t\t\tarray_push($errorArray,\" & \". $displayName);\n\t\t\t\telse\n\t\t\t\t\tarray_push($errorArray, $displayName);\n\t\t\t}\n\t\t}\n\t\t\n\t\n\n\t if(count($errorArray)> 0)\n\t\t {\n\t\t\t\n\t\t\tif($errorMsg!=NULL) // inserting the error message, if any at the first \n\t\t\t\t$errorArray=array_insert($errorArray, $errorMsg, 0);\n\t\t\t\n\t\t\tforeach($errorArray as $error)\n\t\t\t{\n\t\t\t\t$errorOut .= $error.'<br/>';\n\t\t\t}\n\t \n\t\t\t\n\t\t }\n\t\n\treturn $errorOut;\n}",
"private function isIPAddressMeetRange() {\n\t\tif(get_option(\"wp_broadbean_iprange\") == \"\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn ip_in_range($this->ip_request, get_option(\"wp_broadbean_iprange\"));\n\t\t}\n\t}",
"public function filter($value)\n {\n\n\n\n $ip = long2ip(hexdec($value));\n\n return $ip;\n $validate = new Zend_Validate_Ip();\n if ($validate->isValid($ip)) {\n return $ip;\n }\n return false;\n }",
"private function checkFieldIp($postParams): bool\n {\n if (filter_var(explode('/', $postParams['ip'])[0], FILTER_VALIDATE_IP)) {\n return true;\n }\n return false;\n }",
"function isValidInetAddress($data, $strict = false)\n {\n $regex = $strict ? '/^([.0-9a-z_+-]+)@(([0-9a-z-]+\\.)+[0-9a-z]{2,})$/i' : '/^([*+!.&#$|\\'\\\\%\\/0-9a-z^_`{}=?~:-]+)@(([0-9a-z-]+\\.)+[0-9a-z]{2,})$/i';\n if (preg_match($regex, trim($data), $matches)) {\n return array($matches[1], $matches[2]);\n } else {\n return false;\n }\n }",
"public static function validarIP($ip, $version){\n filter_var($ip, FILTER_VALIDATE_IP, $version) ? $resultado = TRUE : $resultado = FALSE;\n return $resultado;\n }",
"public function strictIPs() {\n\t\treturn false;\n\t}",
"public function isValidIP(string $ip, string $which = null): bool;",
"function is_internal_IP() {\n if (is_admins())\n return true;\n $ip_prefix = array(\"172.31.\",\n \"172.\",\n \"10.\",\n \"222.200.\",\n \"192.168.\",\n \"202.116.\",\n \"211.66\",\n \"219.222\",\n \"125.217\",\n \"127.0.0.1\"\n );\n foreach ($ip_prefix as $ip) {\n if (!strncmp($_SERVER['REMOTE_ADDR'], $ip, strlen($ip)))\n return true;\n }\n return false;\n}",
"public function rules() \n \t{\n \t\treturn [\n \t\t\t[['address'], 'required'],\n \t\t\t['address', 'ip']\n \t\t];\n \t}",
"static private function filterIP($input) {\n $in_addr = @inet_pton($input);\n if ($in_addr === false) {\n return 'badip-' . self::filterEvilInput($input, self::HEX_EXTENDED);\n }\n return inet_ntop($in_addr);\n }",
"protected function validateAndAddIp(string $ip): void\n {\n $ip = trim($ip);\n\n if (empty($ip)) {\n return;\n }\n\n // Split IP and subnet if needed\n if (strpos($ip, '/') !== false) {\n [$ip, $subnet] = explode('/', $ip, 2);\n } else {\n $subnet = false;\n }\n\n // If IPv6, subnet 128 can be omitted\n if ($subnet === '128' && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n $subnet = false;\n }\n\n // If IPv4, subnet 32 can be omitted\n if ($subnet === '32' && filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n $subnet = false;\n }\n\n // Compress and validate IP-address\n $ipBin = inet_pton($ip);\n\n if ($ipBin === false) {\n $this->logWarn(\"Invalid IP address: '{$ip}'\");\n\n return;\n }\n\n $ip = inet_ntop($ipBin);\n\n if ($ip === false) {\n $this->logWarn(\"Invalid IP address: '{$ip}'\");\n\n return;\n }\n\n // Add back subnet to the IP\n $ip .= ($subnet !== false ? '/' . $subnet : '');\n\n $this->list[] = $ip;\n }",
"function verify_address($address) // Colorize: green\n { // Colorize: green\n return isset($address) // Colorize: green\n && // Colorize: green\n is_string($address) // Colorize: green\n && // Colorize: green\n ( // Colorize: green\n filter_var($address, FILTER_VALIDATE_IP) // Colorize: green\n || // Colorize: green\n filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) // Colorize: green\n ); // Colorize: green\n }",
"function cern_dev_status_settings_form_validate($form, &$form_state) {\n $lockedout = TRUE;\n\n $ip_addresses = $form_state['values']['cern_dev_status_restrict_ip_address_list'];\n if (strlen(trim($ip_addresses))) {\n $ip_addresses = explode(PHP_EOL, trim($form_state['values']['cern_dev_status_restrict_ip_address_list']));\n foreach ($ip_addresses as $ip_address) {\n if (trim($ip_address) != '::1') { \n //one ip\n if (!preg_match('~^\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b$~', trim($ip_address))) { \n //ip range\n if (!preg_match('@\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\/(?:[12]?[0-9]|3[0-2])\\b@', trim($ip_address))) {\n form_set_error('cern_dev_status_restrict_ip_address_list', t('@ip_address is not a valid range of IP addresses.', array('@ip_address' => $ip_address)));\n } \n else {\n //$ip_address is an IP range, check if the admin's ip is included in it\n if (cern_dev_status_ipCIDRCheck(trim(ip_address()), $ip_address)) $lockedout = FALSE;\n }\n } \n else {\n //$ip_address is a single ip, check if it's the admin's ip\n if (trim($ip_address) == ip_address()) $lockedout = FALSE;\n }\n } \n else {\n //$ip_address is ::1, check if it's the admin's ip\n if (trim($ip_address) == ip_address()) $lockedout = FALSE;\n }\n }\n }\n if ($lockedout) {\n form_set_error('cern_dev_status_restrict_ip_address_list', t('Your IP address is not included in the list, cannot save the settings: you would be locked out of the site.')); \n }\n \n $emaddr = $form_state['values']['cern_dev_status_restrict_ip_mail_address'];\n if (!valid_email_address($emaddr)) {\n form_set_error('cern_dev_status_restrict_ip_mail_address', t('@emaddr is not a valid email address.', array('@emaddr' => $emaddr)));\n }\n \n \n}",
"private function isValidIPN($data)\n\t{\n\t\t// 1. Check valid host\n\t\t$validIps = array();\n\n\t\tforeach ($this->validHosts as $validHost)\n\t\t{\n\t\t\t// Returns a list of IPv4 addresses to which the Internet host specified by hostname resolves.\n\t\t\t$ips = gethostbynamel($validHost);\n\n\t\t\tif ($ips !== false)\n\t\t\t{\n\t\t\t\t$validIps = array_merge($validIps, $ips);\n\t\t\t}\n\t\t}\n\n\t\t$validIps = array_unique($validIps);\n\n\t\tif (!in_array($_SERVER['REMOTE_ADDR'], $validIps))\n\t\t{\n\t\t\t// Return false;\n\t\t}\n\n\t\t// 2. Check signature\n\t\t// Build returnString from 'm_payment_id' onwards and exclude 'signature'\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif ($key == 'm_payment_id')\n\t\t\t{\n\t\t\t\t$returnString = '';\n\t\t\t}\n\n\t\t\tif (!isset($returnString))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($key == 'signature')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$returnString .= $key . '=' . urlencode($val) . '&';\n\t\t}\n\n\t\t$returnString = substr($returnString, 0, -1);\n\n\t\tif (md5($returnString) != $data['signature'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// 3. Call PayFast server for validity check\n\t\t$header = \"POST /eng/query/validate HTTP/1.0\\r\\n\";\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t\t$header .= \"Content-Length: \" . strlen($returnString) . \"\\r\\n\\r\\n\";\n\n\t\t// Connect to server\n\t\t$fp = fsockopen($this->getCallbackURL(), 443, $errno, $errstr, 10);\n\n\t\tif (!$fp)\n\t\t{\n\t\t\t// HTTP ERROR\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Send command to server\n\t\t\tfputs($fp, $header . $returnString);\n\n\t\t\t// Read the response from the server\n\t\t\twhile (! feof($fp))\n\t\t\t{\n\t\t\t\t$res = fgets($fp, 1024);\n\n\t\t\t\tif (strcmp($res, \"VALID\") == 0)\n\t\t\t\t{\n\t\t\t\t\tfclose($fp);\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfclose($fp);\n\n\t\treturn false;\n\t}",
"public static function ipaddress_or_cidr(string $input): bool {\r\n return preg_match('/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(\\d|[1-2]\\d|3[0-2]))?$/', $input) === 1;\r\n }",
"Function ip_in_range($ip, $range) {\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2long($netmask);\r\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n list($a,$b,$c,$d) = $x;\r\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range_dec = ip2long($range);\r\n $ip_dec = ip2long($ip);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n\r\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\r\n }\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\r\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\r\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n\r\n}",
"protected function _checkIpAddressIsAllowed()\n\t{\n\t\t/* Check the IP address is banned */\n\t\tif ( \\IPS\\Request::i()->ipAddressIsBanned() )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'IP_ADDRESS_BANNED', '1S290/A', 403 );\n\t\t}\n\t\t\n\t\t/* If we have tried to access the API with a bad key more than 10 times, ban the IP address */\n\t\tif ( \\IPS\\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1', \\IPS\\Request::i()->ipAddress() ) )->first() > 10 )\n\t\t{\n\t\t\t/* Remove the flag from these logs so that if the admin unbans the IP we aren't immediately banned again */\n\t\t\t\\IPS\\Db::i()->update( 'core_api_logs', array( 'is_bad_key' => 0 ), array( 'ip_address=?', \\IPS\\Request::i()->ipAddress() ) );\n\t\t\t\n\t\t\t/* Then insert the ban... */\n\t\t\t\\IPS\\Db::i()->insert( 'core_banfilters', array(\n\t\t\t\t'ban_type'\t\t=> 'ip',\n\t\t\t\t'ban_content'\t=> \\IPS\\Request::i()->ipAddress(),\n\t\t\t\t'ban_date'\t\t=> time(),\n\t\t\t\t'ban_reason'\t=> 'API',\n\t\t\t) );\n\t\t\tunset( \\IPS\\Data\\Store::i()->bannedIpAddresses );\n\t\t\t\n\t\t\t/* And throw an error */\n\t\t\tthrow new \\IPS\\Api\\Exception( 'IP_ADDRESS_BANNED', '1S290/C', 403 );\n\t\t}\n\t\t\n\t\t/* If we have tried to access the API with a bad key more than once in the last 5 minutes, throw an error to prevent brute-forcing */\n\t\tif ( \\IPS\\Db::i()->select( 'COUNT(*)', 'core_api_logs', array( 'ip_address=? AND is_bad_key=1 AND date>?', \\IPS\\Request::i()->ipAddress(), \\IPS\\DateTime::create()->sub( new \\DateInterval( 'PT5M' ) )->getTimestamp() ) )->first() > 1 )\n\t\t{\n\t\t\tthrow new \\IPS\\Api\\Exception( 'TOO_MANY_REQUESTS_WITH_BAD_KEY', '1S290/D', 429 );\n\t\t}\n\t}",
"public function ip()\n {\n return $this->rule('ip');\n }",
"Function ip_in_range($ip, $range) {\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n\n //echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\n return false;\n }\n\n}",
"public function validateAddress() {\r\n $leng = mb_strlen($this->data[$this->name]['Address']);\r\n if ($leng > 256) {\r\n return FALSE;\r\n } else if ($leng > 128) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['Address']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }",
"public function validate_email($email){\n $pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';\n if(preg_match($pattern, $email)){\n return true;\n }\n else{\n return false;\n }\n }",
"public static function is_private_ip($ip) { \n\t\treturn ! filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);\n\t}",
"public static function is_ip4(&$ip) {\r\n\t\t// Using filter_var here fails in recognizing 255.255.255.0255 as a valid IP\r\n\t\t// See http://en.wikipedia.org/wiki/IPv4#Address_representations\r\n\t\t$test = explode('.', $ip);\r\n\t\t$ints = array();\r\n\t\t$ret = (count($test) == 4);\r\n\t\tforeach($test as $datum) {\r\n\t\t\t$ret = $ret && self::is_int($datum, 0, 255);\r\n\t\t\tif ($ret) { $ints[] = intval($datum); }\r\n\t\t}\t\r\n\t\t\r\n\t\t$regex = '@^[0.]*$@'; // Contains only ., and 0\r\n\t\t$ret = $ret && !preg_match($regex, $ip);\r\n\t\t\r\n\t\tif ($ret) {\r\n\t\t\t$ip = implode('.', $ints);\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}",
"function withRange($ip){\n\n\t\t$ipadd = explode(\".\", $ip);\n\t\t$withRange = false;\n\n\t\tfor ($i = 0; $i < sizeof($ipadd); $i++){\n\t\t\tif((strpos(($ipadd[$i]), \"-\") == true) || (strpos($ipadd[$i], \"~\") == true))\n\t\t\t\t$withRange = true; \n\t\t}\n\t\t\n\n\t\treturn $withRange;\n\n\t}",
"public function isValidAddress($address);",
"public static function checkIPSubnet( $ipAddress ){\n\t\t\tglobal $wpdb;\n\n\t\t\t/*\n\t\t\t\tGrabs allowed subnets from the \n\t\t\t\tcurrent blog.\n\t\t\t*/\n\t\t\tif( is_multisite() ){\n\t\t\t\t$currentBlogID = get_current_blog_id();\n\n\t\t\t\tglobal $switched;\n\t\t\t\tswitch_to_blog(1);\n\n\t\t\t\t$subnets = $wpdb->get_results( $wpdb->prepare(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM \".$wpdb->prefix.\"wps_subnets\n\t\t\t\t\t WHERE blog_id = '%d'\",\n\t\t\t\t\t $currentBlogID\n\t\t\t\t), ARRAY_A );\n\n\t\t\t\trestore_current_blog();\n\t\t\t}else{\n\t\t\t\t$subnets = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.\"wps_subnets\", ARRAY_A );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tIterates through subnets and checks to see\n\t\t\t\tif the IP address is within the range.\n\t\t\t*/\n\t\t\tforeach( $subnets as $subnet ){\n\t\t\t\t$subnetParts \t= explode( '.', $subnet['start_ip'] );\n\n\t\t\t\t$firstOctet \t= $subnetParts[0];\n\t\t\t\t$secondOctet \t= $subnetParts[1];\n\t\t\t\t$thirdOctet \t= $subnetParts[2];\n\t\t\t\t$fourthOctet \t= $subnetParts[3];\n\n\t\t\t\t$newFirstOctet \t= '';\n\t\t\t\t$newSecondOctet\t= '';\n\t\t\t\t$newThirdOctet \t= '';\n\t\t\t\t$newFourthOctet = '';\n\n\t\t\t\t/*\n\t\t\t\t\tChecks from the largest networks\n\t\t\t\t\tfirst down to the smallest.\n\t\t\t\t*/\n\t\t\t\tif( $subnet['subnet'] <= 8 ){\n\t\t\t\t\tif( ( $firstOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFirstOctet = 255;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min \t= ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max \t= ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress );\n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 8 ) && ( $subnet['subnet'] <= 16 ) ){\n\t\t\t\t\tif( ( $secondOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newScondOctet = ( $secondOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress ); \n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 16 ) && ( $subnet['subnet'] <= 24 ) ){\n\t\t\t\t\tif( ( $thirdOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newThirdOctet \t= ( $thirdOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + 1;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}else if( $subnet['subnet'] > 24 ){\n\t\t\t\t\tif( ( $fourthOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFourthOctet = ( $fourthOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + 1;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFourthOctet = $fourthOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tOnly reachable if nothing was returned\n\t\t\t\tmeaning that the IP is NOT in the subnet.\n\t\t\t*/\n\t\t\treturn false;\n\t\t}",
"private function matchIP($allowed) {\n\n\t\t$remote_parts = explode('.', $this->remote);\n\n\t\t$allowed_parts = explode('.', $allowed);\n\n\t\tforeach ($allowed_parts as $key => $value) {\n\t\t\t\n\t\t\tif ($value !== $remote_parts[$key]) \n {\n \n return false;\n \n }\n\n }\n \n\t\treturn true;\n\n\t}",
"public static function IP($string){\n\t\treturn filter_var($string, FILTER_VALIDATE_IP);\n\t}"
] | [
"0.8327009",
"0.7958213",
"0.7889945",
"0.7873872",
"0.78446645",
"0.7762244",
"0.7722794",
"0.7699491",
"0.7677301",
"0.7654686",
"0.7635507",
"0.76251787",
"0.7584109",
"0.7502457",
"0.7458022",
"0.74509156",
"0.74391925",
"0.74285203",
"0.742537",
"0.734235",
"0.7318938",
"0.7300081",
"0.72900075",
"0.7285987",
"0.71897227",
"0.7103898",
"0.70973927",
"0.7094552",
"0.7091572",
"0.7067058",
"0.6986194",
"0.69674045",
"0.69640005",
"0.6939578",
"0.688716",
"0.6859231",
"0.6835721",
"0.6830417",
"0.6824388",
"0.6822772",
"0.68097275",
"0.6798555",
"0.6761322",
"0.67531174",
"0.67438537",
"0.6742569",
"0.67415375",
"0.6710553",
"0.67024016",
"0.66997105",
"0.6695079",
"0.6667243",
"0.6639215",
"0.66350126",
"0.6629777",
"0.66076833",
"0.65869176",
"0.65748185",
"0.6574477",
"0.65671253",
"0.6555771",
"0.6533695",
"0.65313506",
"0.65102285",
"0.6501012",
"0.6498308",
"0.6485485",
"0.6477378",
"0.64763075",
"0.64686805",
"0.64583004",
"0.64461684",
"0.64123243",
"0.6410143",
"0.6409431",
"0.6376574",
"0.6373937",
"0.6371859",
"0.6359761",
"0.63460225",
"0.6340946",
"0.6327655",
"0.6324827",
"0.632196",
"0.63190633",
"0.6314101",
"0.63002384",
"0.629252",
"0.62878543",
"0.62769854",
"0.62755346",
"0.62670904",
"0.6264176",
"0.62572634",
"0.62550724",
"0.6244884",
"0.62307745",
"0.6228503",
"0.62153894",
"0.6213231"
] | 0.6799297 | 41 |
FIXME: remove before go Live | public function restart() {
if ($this->user->is_logged_in()) {
$this->user->restart_player();
}
redirect("/account/info");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __() {\n }",
"public function helper()\n\t{\n\t\n\t}",
"private function _i() {\n }",
"private function public_hooks()\n\t{\n\t}",
"private function init()\n\t{\n\t\treturn;\n\t}",
"private function __construct()\t{}",
"final function velcom(){\n }",
"final private function __construct(){\r\r\n\t}",
"protected function __init__() { }",
"public function init() {\t\t\n\n }",
"private function j() {\n }",
"public function __init(){}",
"public function init()\n {\n \treturn;\n }",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"private function __construct() {\r\n\t\r\n\t}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {return;}",
"private function __construct() {\r\n\t\t\r\n\t}",
"public function ogs()\r\n {\r\n }",
"public function init() {\n\t\t\n\t}",
"private function __construct () {}",
"public function custom()\n\t{\n\t}",
"protected function init()\n\t{\n\t\t\n\t}",
"public function init()\n {\t\t\t\n }",
"public function init()\n {\t\t\t\n }",
"final private function __construct() {}",
"final private function __construct() {}",
"public function extra_voor_verp()\n\t{\n\t}",
"public function init ()\r\n {\r\n }",
"private function __construct() {\n // Open source version.\n }",
"private function __construct()\r\r\n\t{\r\r\n\t}",
"private function __construct()\r\n {\r\n }",
"private function __construct()\r\n {\r\n }",
"protected final function __construct() {}",
"public function init()\n { \t\n }",
"function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}",
"private function __construct()\r\n\t{\r\n\t}",
"private function __construct( )\n {\n\t}",
"private function __construct()\r\n\t{\r\n\t\r\n\t}",
"final private function __construct() { }",
"final private function __construct() { }",
"final private function __construct() { }",
"private function __construct()\n\t{\n\t\t\n\t}",
"private function __construct () \n\t{\n\t}",
"protected function initialize() {}",
"protected function initialize() {}",
"protected function initialize() {}",
"protected function initialize() {}",
"private function __construct() {\r\n\t}",
"private function __construct() {\r\n\t}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"public static function live_preview() { }",
"protected function __construct () {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}"
] | [
"0.60248435",
"0.5887128",
"0.5711608",
"0.5708151",
"0.5703574",
"0.56949675",
"0.5674075",
"0.56648934",
"0.5649609",
"0.56222856",
"0.5600922",
"0.5586279",
"0.55619925",
"0.55205923",
"0.55205923",
"0.55205923",
"0.55205923",
"0.5520481",
"0.55201346",
"0.55201346",
"0.55201346",
"0.55201346",
"0.55201346",
"0.55201346",
"0.55193186",
"0.55193186",
"0.5506149",
"0.5499705",
"0.5499431",
"0.54990214",
"0.5491652",
"0.54870135",
"0.5480607",
"0.5445139",
"0.5445139",
"0.5442814",
"0.5442814",
"0.54349756",
"0.5433096",
"0.5428368",
"0.54141223",
"0.54105705",
"0.54105705",
"0.5399731",
"0.539565",
"0.5393399",
"0.5389289",
"0.53878224",
"0.53839505",
"0.5383389",
"0.5383389",
"0.5383389",
"0.5381014",
"0.5380235",
"0.5370602",
"0.5370602",
"0.5370602",
"0.5370602",
"0.53664285",
"0.53664285",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.5364622",
"0.53626007",
"0.5361938",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976",
"0.53585976"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.